Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions src/strands/mcp/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"""Canonical import path for the Model Context Protocol (MCP) integration.

Model Context Protocol functionality is being promoted from
``strands.tools.mcp`` to this top-level ``strands.mcp`` package because MCP
now spans tools, prompts, resources, tasks, and elicitation -- concepts
that extend beyond ``tools``.

For now this package is a thin re-export of ``strands.tools.mcp``. A
follow-up change will invert the relationship: the implementation will
live here and ``strands.tools.mcp`` will become a deprecated alias.
Users can safely migrate imports to ``strands.mcp`` today; the public
API is identical and object identity is preserved.
"""

from ..tools.mcp import MCPAgentTool, MCPClient, MCPTransport, TasksConfig, ToolFilters

__all__ = ["MCPAgentTool", "MCPClient", "MCPTransport", "TasksConfig", "ToolFilters"]
Empty file added tests/strands/mcp/__init__.py
Empty file.
25 changes: 25 additions & 0 deletions tests/strands/mcp/test_canonical_import_path.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
"""Tests for the canonical ``strands.mcp`` import path.

The implementation currently lives in ``strands.tools.mcp``. This test
locks in the contract that ``strands.mcp`` re-exports the same objects so
that users can migrate imports ahead of the follow-up refactor that
moves the implementation.
"""


def test_strands_mcp_reexports_public_api() -> None:
import strands.mcp as new
import strands.tools.mcp as old

assert new.MCPClient is old.MCPClient
assert new.MCPAgentTool is old.MCPAgentTool
assert new.MCPTransport is old.MCPTransport
assert new.TasksConfig is old.TasksConfig
assert new.ToolFilters is old.ToolFilters


def test_strands_mcp_all_matches_tools_mcp_all() -> None:
import strands.mcp as new
import strands.tools.mcp as old

assert sorted(new.__all__) == sorted(old.__all__)