Skip to content

Commit 02b30e5

Browse files
committed
fix tests, take 3
1 parent c91cd9f commit 02b30e5

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ jobs:
159159
- run: mkdir .coverage
160160

161161
- run: uv sync --only-dev
162+
- run: uv run mcp-run-python example
162163
- run: uv run ${{ matrix.install.command }} coverage run -m pytest --durations=100 -n auto --dist=loadgroup
163164
env:
164165
COVERAGE_FILE: .coverage/.coverage.${{ matrix.python-version }}-${{ matrix.install.name }}
@@ -196,6 +197,7 @@ jobs:
196197
- run: mkdir .coverage
197198

198199
- run: uv sync --group dev
200+
- run: uv run mcp-run-python example
199201

200202
- run: unset UV_FROZEN
201203

@@ -228,10 +230,6 @@ jobs:
228230
with:
229231
enable-cache: true
230232

231-
- uses: denoland/setup-deno@v2
232-
with:
233-
deno-version: v2.x
234-
235233
- run: uv run --all-extras python tests/import_examples.py
236234

237235
coverage:

docs/mcp/client.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ from pydantic_ai import Agent
149149
from pydantic_ai.mcp import MCPServerStdio
150150

151151
server = MCPServerStdio( # (1)!
152-
'uv', args=['run', 'mcp-run-python', 'stdio'],
152+
'uv', args=['run', 'mcp-run-python', 'stdio'], timeout=10
153153
)
154154
agent = Agent('openai:gpt-4o', toolsets=[server])
155155

pydantic_ai_slim/pydantic_ai/mcp.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ class MCPServerStdio(MCPServer):
400400
from pydantic_ai.mcp import MCPServerStdio
401401
402402
server = MCPServerStdio( # (1)!
403-
'uv', args=['run', 'mcp-run-python', 'stdio'],
403+
'uv', args=['run', 'mcp-run-python', 'stdio'], timeout=10
404404
)
405405
agent = Agent('openai:gpt-4o', toolsets=[server])
406406
@@ -722,16 +722,15 @@ class MCPServerSSE(_MCPServerHTTP):
722722
from pydantic_ai import Agent
723723
from pydantic_ai.mcp import MCPServerSSE
724724
725-
server = MCPServerSSE('http://localhost:3001/sse') # (1)!
725+
server = MCPServerSSE('http://localhost:3001/sse')
726726
agent = Agent('openai:gpt-4o', toolsets=[server])
727727
728728
async def main():
729-
async with agent: # (2)!
729+
async with agent: # (1)!
730730
...
731731
```
732732
733-
1. E.g. you might be connecting to a server run with [`mcp-run-python`](https://github.com/pydantic/mcp-run-python).
734-
2. This will connect to a server running on `localhost:3001`.
733+
1. This will connect to a server running on `localhost:3001`.
735734
"""
736735

737736
@property

0 commit comments

Comments
 (0)