python-mcp
This project is an MCP server for analyzing Python code relationships, focusing on import/export structures between files. It supports the MCP protocol and provides standardized tools for code extraction, making it suitable for applications integrating Python code analysis.
Python MCP Server for Code Graph Extraction
This Model Context Protocol (MCP) server is designed to facilitate the extraction and analysis of Python code structures, emphasizing the relationships between imports and exports across files. Key features include:
- Code relationship discovery between Python files
- Smart extraction of relevant code sections, maintaining token limits
- Contextual support by including related directory files
- Inclusion of documentation via README files
- MCP protocol support compatible with the JSON-RPC standard
Installation
Clone the repository and set up a virtual environment to install dependencies. Configure environment variables as necessary.
Usage
Configure the MCP server for compatible clients by adjusting MCP client configuration files. Use advanced functions like get_python_code
for analyzing Python file structures and relationships efficiently.
Testing
Run unit tests to verify the functionality of the server.