{"$schema":"https://wellknown.network/schemas/agent-record-v1.json","schemaVersion":"1","id":"ag_8wf6g3fzswqk","handle":"python-session-mcp","url":"https://wellknown.network/agents/python-session-mcp","links":{"self":"https://wellknown.network/agents/python-session-mcp/record.json","html":"https://wellknown.network/agents/python-session-mcp","markdown":"https://wellknown.network/agents/python-session-mcp/record.md","api":"https://wellknown.network/api/v1/agents/python-session-mcp","status":"https://wellknown.network/api/v1/agents/python-session-mcp/status","claim":"https://wellknown.network/agents/python-session-mcp/claim","claimApi":"https://wellknown.network/api/v1/claims","claimDescriptor":"https://wellknown.network/agents/python-session-mcp/claim.json","badge":"https://wellknown.network/agents/python-session-mcp/badge.svg","openapi":"https://wellknown.network/openapi.json","history":"https://wellknown.network/api/v1/agents/python-session-mcp/history","tools":"https://wellknown.network/api/v1/agents/python-session-mcp/tools"},"ard":{"identifier":"urn:air::server:python-session-mcp","type":"application/mcp-server-card+json"},"kind":"mcp_server","declared":{"name":"python-session-mcp","summary":"Run Python in a persistent session, and expose it to LLM clients over MCP","description":"# python-session-mcp\n\n[![Licence](https://img.shields.io/badge/licence-MIT-2c5f9e)](LICENSE)\n[![Python](https://img.shields.io/badge/python-3.10+-2c5f9e)](https://www.python.org/)\n\nRun Python in a session that stays alive, and expose it to LLM clients over the\nModel Context Protocol.\n\nAuthor: Dr Merwan Roudane\n\n## What makes it different\n\n**The session persists.** A DataFrame loaded in one call is still there in the\nnext, so an analysis is built up in steps rather than resent whole each time.\n\n**Your interpreter, not the server's.** The server may well be installed under\na bare Python with no pandas in it. The interpreter that runs your code is\nchosen separately: a conda or Anaconda installation is preferred when one is\npresent, and `PYTHON_MCP_INTERPRETER` overrides that.\n\n**A crash costs one process.** Code runs in a worker, not in the server. Exhaust\nmemory, call `sys.exit`, crash a C extension — the worker is replaced and the\nserver carries on. It also keeps user code away from the server's stdin, which\nunder MCP is the JSON-RPC stream itself.\n\n## Install\n\n```bash\npip install python-session-mcp\n```\n\n## Library use\n\n```python\nfrom python_mcp import PythonRunner\n\nwith PythonRunner() as py:\n    py.run(\"import pandas as pd, statsmodels.api as sm\")\n    py.run(\"df = pd.read_csv('macro.csv')\")\n    print(py.run(\"df.describe()\"))\n\n    py.run(\"m = sm.OLS(df['y'], sm.add_constant(df[['x','z']])).fit()\")\n    print(py.run(\"m.summary()\"))\n    print(py.value(\"m.params.to_dict()\"))    # a real Python dict\n```\n\nA final expression is shown the way a REPL would, so `df.head()` on its own\ndisplays the frame without `print()`.\n\n## MCP server use\n\n```json\n{\n  \"mcpServers\": {\n    \"python\": {\n      \"command\": \"python-session-mcp\",\n      \"env\": { \"PYTHON_MCP_INTERPRETER\": \"C:\\\\Users\\\\you\\\\anaconda3\\\\python.exe\" }\n    }\n  }\n}\n```\n\n### Tools\n\n**Session**\n\n| Tool | Purpose |\n|---|---|\n| `python_status` | Which interpreter, and which packages it actually has |\n| `reset_namespace` | Forget …","publisher":null,"homepage":"https://github.com/merwanroudane/mcp_python","repository":"https://github.com/merwanroudane/mcp_python","version":"0.1.0","license":"MIT License\n        \n        Copyright (c) 2026 Merwan Roudane\n…","protocols":["mcp"],"tags":["data-analysis","jupyter","mcp","model-context-protocol","python","repl"],"pricing":null,"endpoints":[{"url":"pypi:python-session-mcp","type":"package_pypi","auth":null,"probeable":false}],"skills":null,"tools":null,"extra":null,"attribution":{"kind":"pypi","name":"pypi","license":"pypi","repoUrl":"pypi","summary":"pypi","version":"pypi","description":"pypi","homepageUrl":"pypi"}},"derived":{"capabilities":[{"slug":"code.execution","name":"Code Execution","confidence":1,"provenance":"declared"}],"categories":["code"],"language":"en"},"observed":{"status":"unknown","statusReason":"Distributed as a package to run locally; no network endpoint to check.","lastOkAt":null,"lastProbedAt":null,"statusComputedAt":null,"reliability30d":null,"latestObservations":[],"tools":null,"package":{"name":"python-session-mcp","registry":"pypi","observedAt":"2026-10-28T20:23:15.548Z","publishedAt":"2026-08-22T00:04:34.358525Z","latestVersion":"0.1.0"},"toolSurface":null,"endpointFacts":[]},"verification":{"claimed":false,"claimedAt":null,"proofs":[]},"provenance":{"sources":[{"source":"pypi","key":"python-session-mcp","url":"https://pypi.org/project/python-session-mcp/","firstSeenAt":"2026-09-10T10:24:51.658Z","fetchedAt":"2026-10-28T20:22:14.457Z","normalizedAt":"2026-10-28T20:22:14.457Z"}]},"firstSeenAt":"2026-09-10T10:24:51.658Z","updatedAt":"2026-10-28T20:23:15.548Z"}