Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions mcp_run_python/deno/deno.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
"format": "deno fmt"
},
"imports": {
"@modelcontextprotocol/sdk": "npm:@modelcontextprotocol/sdk@^1.15.1",
"@modelcontextprotocol/sdk": "npm:@modelcontextprotocol/sdk@^1.17.5",
"@std/cli": "jsr:@std/cli@^1.0.15",
"@std/path": "jsr:@std/path@^1.0.8",
// do NOT upgrade above this version until there is a workaround for https://github.com/pyodide/pyodide/pull/5621
"pyodide": "npm:pyodide@0.27.6",
"zod": "npm:zod@^3.24.2"
"zod": "npm:zod@^3.24.4"
},
"fmt": {
"lineWidth": 120,
Expand Down
16 changes: 8 additions & 8 deletions mcp_run_python/deno/deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 9 additions & 6 deletions mcp_run_python/deno/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,17 @@ The code will be executed with Python 3.12.
return {}
})

server.tool(
server.registerTool(
'run_python_code',
toolDescription,
{
python_code: z.string().describe('Python code to run'),
global_variables: z.record(z.string(), z.any()).default({}).describe(
'Map of global variables in context when the code is executed',
),
title: 'Run Python code',
description: toolDescription,
inputSchema: {
python_code: z.string().describe('Python code to run'),
global_variables: z.record(z.string(), z.any()).default({}).describe(
'Map of global variables in context when the code is executed',
),
},
},
async ({ python_code, global_variables }: { python_code: string; global_variables: Record<string, any> }) => {
const logPromises: Promise<void>[] = []
Expand Down