Skip to content

Commit 00a8162

Browse files
committed
cleanup server args
1 parent b95e034 commit 00a8162

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

pydantic_ai_slim/pydantic_ai/mcp_run_python.py

+8-5
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,21 @@ def mcp_run_python_stdio(callbacks: Sequence[Callback] = (), *, local_code: bool
2121
Returns:
2222
A server connection definition.
2323
"""
24-
return MCPServerStdio('deno', args=_deno_args('stdio', callbacks, local_code))
24+
return MCPServerStdio(
25+
'deno',
26+
args=_deno_args('stdio', callbacks, local_code),
27+
cwd='mcp-run-python' if local_code else None,
28+
)
2529

2630

2731
def _deno_args(mode: Literal['stdio', 'sse'], callbacks: Sequence[Callback], local_code: bool) -> list[str]:
28-
path_prefix = 'mcp-run-python/' if local_code else ''
2932
args = [
3033
'run',
3134
'-N',
32-
f'-R={path_prefix}node_modules',
33-
f'-W={path_prefix}node_modules',
35+
'-R=node_modules',
36+
'-W=node_modules',
3437
'--node-modules-dir=auto',
35-
'mcp-run-python/src/main.ts' if local_code else f'jsr:@pydantic/mcp-run-python@{MCP_RUN_PYTHON_VERSION}',
38+
'src/main.ts' if local_code else f'jsr:@pydantic/mcp-run-python@{MCP_RUN_PYTHON_VERSION}',
3639
mode,
3740
]
3841

0 commit comments

Comments
 (0)