The useful part is the budget: extraction stops rather than handing a model more than it can hold, and the response reports the count so you can raise the limit deliberately. Always including the README is a small decision that pays off — a model reading extracted code usually has no idea what the project is for. One tool, Python only.
An MCP server that extracts a Python file together with the code it actually depends on. It analyses the target file's imports, pulls the definitions of the referenced classes and functions from other files, adds context from the same directory, and stops before it blows the token budget.
- A target file's complete code plus the code of every referenced object from other files, with the file path, docstring and object type for each — `get_python_code`
- Additional files from the same directory included for context
- README.md and its variants always included, so project documentation travels with the code
- A running token count reported against the limit, so you can see how close the extraction came
- Output formatted with metadata for language models rather than as raw file dumps
No account and no key — it runs locally with no agent system behind it. Clone the repository, create a virtual environment, and `pip install -r requirements.txt`. Configure the client to run `python /path/to/server.py` with `TOKEN_LIMIT` in its environment; the default is 8000. The `root_repo_path` argument is optional and defaults to the target file's directory. Package name `python-mcp` 0.1.0.
One command — mcp install server.py
