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.

125 stars 13 forksAI, LLMs & Agents Plugin marketplace

Install

Claude Code plugin
/plugin marketplace add OmidZamani/dspy-skills

The repo is a Claude Code plugin marketplace. Run /plugin afterwards to pick the plugin that includes this skill.

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add OmidZamani/dspy-skills --skill dspy-mcp-tool-integration
Manual install
git 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-integration

Personal 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 Server
Read the full skill on GitHub

Details

Skill name
dspy-mcp-tool-integration
Path
skills/dspy-mcp-tool-integration/SKILL.md
License
MIT
Repo updated
23 June 2026

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

Browse the most popular Claude skills, all ai, llms & agents skills, or write your own with the skills generator.