Dspy MCP Tool Integration
Use for MCP tools with DSPy, Model Context Protocol servers, dspy.Tool.from_mcp_tool, and ReAct agents over MCP-compatible tools.
Install
/plugin marketplace add OmidZamani/dspy-skillsThe repo is a Claude Code plugin marketplace. Run /plugin afterwards to pick the plugin that includes this skill.
npx skills add OmidZamani/dspy-skills --skill dspy-mcp-tool-integrationgit clone --depth 1 https://github.com/OmidZamani/dspy-skills.git /tmp/dspy-skills
mkdir -p ~/.claude/skills
cp -r /tmp/dspy-skills/skills/dspy-mcp-tool-integration ~/.claude/skills/dspy-mcp-tool-integrationPersonal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.
From the SKILL.md
# DSPy MCP Tool Integration
## Goal
Connect an MCP server with the MCP Python client, convert its tools to `dspy.Tool`, and use them in an async DSPy agent.
## Install
```bash
pip install -U "dspy[mcp]>=3.2.1,<3.3"
```
DSPy converts tools but does not manage MCP connections. Keep the `ClientSession` alive for as long as the DSPy tools are in use.
## Streamable HTTP Server
```python
import asyncio
import dspy
from mcp import ClientSession
from mcp.client.streamable_http import streamablehttp_client
async def main():
async with streamablehttp_client("http://localhost:8000/mcp") as (read, write):
async with ClientSession(read, write) as session:
await session.initialize()
response = await session.list_tools()
tools = [dspy.Tool.from_mcp_tool(session, tool) for tool in response.tools]
agent = dspy.ReAct("task -> result", tools=tools, max_iters=5)
output = await agent.acall(task="Check the weather in Tokyo")
print(output.result)
asyncio.run(main())
```
## Local Stdio ServerDetails
- Skill name
dspy-mcp-tool-integration- Repository
- OmidZamani/dspy-skills
- Path
skills/dspy-mcp-tool-integration/SKILL.md- License
- MIT
- Repo updated
- 23 June 2026
- Listed in
- heilcheng/awesome-agent-skills
FAQ
What does the Dspy MCP Tool Integration skill do?
Use for MCP tools with DSPy, Model Context Protocol servers, dspy.Tool.from_mcp_tool, and ReAct agents over MCP-compatible tools.
How do I install the Dspy MCP Tool Integration skill?
Claude Code plugin: /plugin marketplace add OmidZamani/dspy-skills. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.
Is Dspy MCP Tool Integration popular?
It lives in OmidZamani/dspy-skills, which has 125 GitHub stars and 13 forks, and is included in 1 curated skill list.
Related skills
Dspy Adapters Multimodal
125OmidZamani/dspy-skills
Use for DSPy adapter selection, JSONAdapter, XMLAdapter, ChatAdapter, native function calling, structured outputs, and multimodal inputs like dspy.Image or dspy.Audio.
Dspy Advanced Module Composition
125OmidZamani/dspy-skills
Use for composing DSPy modules with Ensemble, MultiChainComparison, ensemble voting, sequential pipelines, and multi-program workflows.
Dspy Better Together
125OmidZamani/dspy-skills
Use for BetterTogether, prompt plus weight optimization, fine-tuning sequences, and strategy chains like p -> w -> p.
Dspy Optimize Anything
125OmidZamani/dspy-skills
Use for GEPA optimize_anything on text artifacts such as code, prompts, agent architectures, configs, and non-DSPy optimization targets.
Dspy Haystack Integration
125OmidZamani/dspy-skills
Use for integrating DSPy with Haystack, optimizing Haystack prompts, improving retrieval pipelines, and extracting DSPy prompts.
Dspy RAG Pipeline
125OmidZamani/dspy-skills
Use for RAG pipelines, retrieval augmented generation, ColBERTv2, context retrieval, multi-hop RAG, and grounded DSPy answers.
Browse the most popular Claude skills, all ai, llms & agents skills, or write your own with the skills generator.