python-mcp
If you are the rightful owner of python-mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
This MCP server provides tools for extracting and analyzing Python code structures, focusing on import/export relationships between files.
The Python MCP Server for Code Graph Extraction is a lightweight implementation designed to analyze and extract Python code structures, particularly focusing on the import/export relationships between files. It is built to be easily integrated into any Python application without the need for an agent system. The server supports the Model Context Protocol (MCP) JSON-RPC standard, making it compatible with various MCP clients. It offers features like smart code extraction, directory context inclusion, and LLM-friendly formatting, ensuring that the extracted code is relevant and within token limits. The server also includes documentation files like README.md to provide comprehensive project context.
Features
- Code Relationship Discovery: Analyze import relationships between Python files
- Smart Code Extraction: Extract only the most relevant code sections to stay within token limits
- Directory Context: Include files from the same directory to provide better context
- Documentation Inclusion: Always include README.md files (or variants) to provide project documentation
- LLM-Friendly Formatting: Format code with proper metadata for language models
Tools
get_python_code
Return the code of a target Python file and related files based on import/export proximity.