In short.
DSPy MCP Tool Integration is a skill for Python developers connecting DSPy agents to MCP tools, but its bundled Python example does not demonstrate an MCP connection. The guide shows tool discovery, conversion to dspy.Tool and asynchronous ReAct calls over two transports. It declares DSPy 3.2.1 compatibility and leaves model configuration, server implementation and operational controls to the developer. No code was executed, so successful integration and production behavior remain unverified.
Researched and written by an AI model and checked by a second AI model. How it works
Coverage includes the complete selected folder skills/dspy-mcp-tool-integration at commit f5db3b7b1fe35b3ff5328b3216165e0853e6c884: SKILL.md and example.py, plus the repository-root LICENSE as the related notice. Other skill folders, linked documentation, dependency implementations, model services and MCP servers are outside the supplied evidence. No code was executed; installation, server connectivity, model calls, tool execution and production behavior remain unverified.
The overview
Identity
The resource is the skills/dspy-mcp-tool-integration folder in OmidZamani/dspy-skills. Its SKILL.md declares the name dspy-mcp-tool-integration, version 1.0.0 and DSPy compatibility 3.2.1. It provides assistant instructions and Python integration examples.
The original source folder is [https://github.com/OmidZamani/dspy-skills/tree/master/skills/dspy-mcp-tool-integration]. This report concerns the supplied snapshot at commit f5db3b7b1fe35b3ff5328b3216165e0853e6c884.
Assessment
The guide is useful as a compact integration starting point when a developer can supply an MCP server and language-model configuration. Its strongest practical detail is the explicit requirement to keep the MCP session alive while DSPy uses its tools.
The supplied example.py demonstrates local agent construction only. Successful server communication, tool execution, answer quality and production reliability are unverified.
Users
The skill suits Python developers building DSPy agents that need tools exposed by an MCP server. MCP is the interface through which the examples discover and call those external tools.
Beginners receive short examples for two connection methods, but need familiarity with asynchronous Python and must supply missing server and model setup. Experienced developers can use the examples to identify the conversion API and connection-lifetime requirements.
Capabilities
The guide demonstrates connecting through Streamable HTTP or launching a local server through stdio, discovering available tools, converting them with dspy.Tool.from_mcp_tool and passing them to a dspy.ReAct agent.
It shows asynchronous agent calls with max_iters=5. Actual capabilities depend on the connected server: the weather and arithmetic questions are sample requests, with no corresponding server implementations or observed answers supplied.
Using it
Requirements
The installation command requests dspy[mcp]>=3.2.1,<3.3. The examples require Python, an asynchronous runtime and MCP Python client imports. A Python version and separate MCP SDK version are not specified.
A real deployment also needs an accessible MCP endpoint or a local server program, plus language-model configuration for the agent. The MCP examples do not show provider selection, credentials or dspy.configure.
Mechanism
Each integration example opens a transport, creates a ClientSession, initializes it and calls list_tools. Each returned tool definition is converted into a DSPy tool using the same live session.
The wrappers are supplied to ReAct, and the agent is invoked through await agent.acall. Nested asynchronous context managers keep the connection open during use. DSPy performs tool conversion; the application remains responsible for the MCP connection.
Setup
The documented installation command is pip install -U "dspy[mcp]>=3.2.1,<3.3". Configure a suitable language model separately before attempting a real agent request.
For HTTP, replace the sample localhost endpoint with your server endpoint. For stdio, replace path/to/server.py with an actual server program; the sample launches it using python3. Keep tool discovery and agent use inside the initialized session context. These steps have not been executed here.
Example
SKILL.md shows a weather request through HTTP and an arithmetic request through a local stdio server. Both construct ReAct agents and await their calls, but neither includes a server implementation or recorded result.
The separate example.py configures dspy.utils.DummyLM with canned values, wraps a local_status function as a local dspy.Tool and constructs a ReAct agent with max_iters=1. It then prints OK without calling the agent. It contains no MCP client connection and provides no evidence of an MCP exchange.
Assessment & evidence
Limitations
The guide does not supply a working server, real model configuration or end-to-end execution evidence. Compatibility outside its stated DSPy installation range is unknown.
Authentication, authorization and production tracing appear as recommendations without implementations. The snippets do not demonstrate reconnection handling or timeout configuration. Performance, failure recovery and behavior under concurrent workloads are not assessed.
Reasoning
The resource fits work that already uses DSPy and needs a short, concrete explanation of connecting server-provided tools. Showing both transports and explicitly explaining session lifetime makes the guide useful for that narrow task.
The main adoption burden is completing and verifying the surrounding application. The local example does not exercise the advertised integration, so it cannot establish that an intended server, model and tool combination works.
Alternatives
For tools that are ordinary local Python functions, example.py shows direct dspy.Tool construction without an MCP connection. Whether that simpler approach fits depends on whether the application needs server-provided tools.
The guide also links to DSPy's MCP guide [https://dspy.ai/learn/programming/mcp/], its MCP tutorial [https://dspy.ai/tutorials/mcp/] and the MCP Python SDK [https://github.com/modelcontextprotocol/python-sdk]. Their contents were not supplied, so their current coverage and comparative suitability are unknown.
Evidence
The supplied material contains the complete selected skill folder, comprising SKILL.md and example.py, together with the repository-root LICENSE. It supports analysis of the documented connection patterns and the local example's code, but includes no execution logs, benchmarks or completed MCP responses.
The captured instruction file is [https://raw.githubusercontent.com/OmidZamani/dspy-skills/f5db3b7b1fe35b3ff5328b3216165e0853e6c884/skills/dspy-mcp-tool-integration/SKILL.md]. The captured example is [https://raw.githubusercontent.com/OmidZamani/dspy-skills/f5db3b7b1fe35b3ff5328b3216165e0853e6c884/skills/dspy-mcp-tool-integration/example.py]. The accompanying licence is [https://raw.githubusercontent.com/OmidZamani/dspy-skills/f5db3b7b1fe35b3ff5328b3216165e0853e6c884/LICENSE].
Access & freshness
Costs
The MIT licence grants permission to use the supplied material free of charge. Runtime costs are unknown: the files specify no model provider, token usage, MCP service pricing or hosting estimate.
The examples' iteration limits do not establish a monetary spending cap. Any estimate would require the chosen model, server services and actual workload.
Rights
The repository-root LICENSE supplies the MIT licence and names Omid Zamani as the 2025 copyright holder. It permits use, copying, modification, publication, distribution, sublicensing and sale, provided the copyright and permission notices accompany copies or substantial portions.
The material is supplied without warranty. Licence terms for dependencies, model services and connected MCP servers are not included in the supplied evidence.
Freshness
The supplied snapshot was captured on 16 November 2026 at 12:24:30.126 UTC, at commit f5db3b7b1fe35b3ff5328b3216165e0853e6c884. The skill declares version 1.0.0 and DSPy compatibility 3.2.1, with installation constrained to >=3.2.1,<3.3.
The evidence does not establish a release date, update history, current branch contents or the latest supported dependency versions. Present-day compatibility beyond the stated range is unknown.
Actions
Supply a real MCP server and configure a language model, then adapt the HTTP or stdio example to that environment. Verify a single low-risk tool call through acall while keeping ClientSession open.
Follow the guide's recommendations to apply authentication and authorization before exposing sensitive tools, use a modest iteration limit and trace tool calls. Confirm actual tool responses, dependency compatibility and service costs before expanding use. Running the bundled local example alone cannot establish these results.
