Run Python in a persistent session, and expose it to LLM clients over MCP
Wellknown found it in public sources; nobody has proven control of it yet. Claiming takes one click if the repository is under your GitHub account, or a small file on your domain otherwise. Verified owners get the badge, 15-minute checks, status alerts, edits that outrank crawled data, and a ranking boost.
Agents can do it too: POST https://wellknown.network/api/v1/claims with {"agent":"python-session-mcp","method":"well_known_file"} — machine-readable steps at claim.json, guide at /docs/claim.
Everything here was measured by our prober or read from a registry. Nothing is self-reported.
Attributed to the source that supplied each field. Treated as claims, not facts.
# python-session-mcp [](LICENSE) [](https://www.python.org/) Run Python in a session that stays alive, and expose it to LLM clients over the Model Context Protocol. Author: Dr Merwan Roudane ## What makes it different **The session persists.** A DataFrame loaded in one call is still there in the next, so an analysis is built up in steps rather than resent whole each time. **Your interpreter, not the server's.** The server may well be installed under a bare Python with no pandas in it. The interpreter that runs your code is chosen separately: a conda or Anaconda installation is preferred when one is present, and `PYTHON_MCP_INTERPRETER` overrides that. **A crash costs one process.** Code runs in a worker, not in the server. Exhaust memory, call `sys.exit`, crash a C extension — the worker is replaced and the server carries on. It also keeps user code away from the server's stdin, which under MCP is the JSON-RPC stream itself. ## Install ```bash pip install python-session-mcp ``` ## Library use ```python from python_mcp import PythonRunner with PythonRunner() as py: py.run("import pandas as pd, statsmodels.api as sm") py.run("df = pd.read_csv('macro.csv')") print(py.run("df.describe()")) py.run("m = sm.OLS(df['y'], sm.add_constant(df[['x','z']])).fit()") print(py.run("m.summary()")) print(py.value("m.params.to_dict()")) # a real Python dict ``` A final expression is shown the way a REPL would, so `df.head()` on its own displays the frame without `print()`. ## MCP server use ```json { "mcpServers": { "python": { "command": "python-session-mcp", "env": { "PYTHON_MCP_INTERPRETER": "C:\\Users\\you\\anaconda3\\python.exe" } } } } ``` ### Tools **Session** | Tool | Purpose | |---|---| | `python_status` | Which interpreter, and which packages it actually has | | `reset_namespace` | Forget …
Mapped onto the structured taxonomy from declared text and observed tool names. Confidence shown for derived entries.
Every source is kept verbatim. Field changes are logged as events.