python_mcp
The python_local MCP Server offers an interactive Python REPL environment within the Model Context Protocol framework, allowing users to execute Python code in a persistent session. It provides a unique URI scheme for accessing session history and supports easy package distribution and debugging with specialized tools.
How do I access the session history?
You can access the session history using the custom 'repl://' URI scheme, which provides a text/plain resource of the session's input and output.
What arguments are required for the 'python_repl' tool?
The 'python_repl' tool requires 'code' (the Python code to execute) and 'session_id' (the session identifier) as arguments.
How can I debug the MCP server?
For debugging, use the MCP Inspector, which can be launched via npm with the command: 'npx @modelcontextprotocol/inspector uv --directory /path/to/python_local run python-local'.
What is the purpose of the 'uv' and 'uvx' commands?
The 'uv' command is used for development and unpublished server configurations, while 'uvx' is used for published server configurations.
How do I publish the package to PyPI?
To publish the package, build the distributions using 'uv build' and then publish using 'uv publish', providing PyPI credentials via environment variables or command flags.