Home / MCP / Code2Flow MCP Server
Provides a MCP server that wraps code2flow to generate and access code call graphs for multiple languages.
Configuration
View docs{
"mcpServers": {
"code2flow": {
"command": "python",
"args": [
"server.py"
]
}
}
}Code2Flow MCP Server wraps the code2flow command-line tool as an MCP (Model Context Protocol) server. It lets you generate and access code call graphs through a standardized MCP interface, enabling easy integration with AI applications and automated workflows.
Connect your MCP client to the Code2Flow MCP Server and start creating or querying code call graphs. You can create a session, request a call graph for your codebase, and retrieve the resulting image or metadata. You can also run checks and analyses provided by the server to verify the tool version or assess code complexity.
Prerequisites. Ensure you have Python 3.7 or newer and a compatible operating system (Windows 11 or other supported OS). You also need a command-line terminal (PowerShell or similar) and the code2flow CLI installed.
Step-by-step installation and setup you can run locally.
git clone https://github.com/kursk-ye/code2flow-mcp-server.git
cd code2flow-mcp-server
# (Recommended) create and activate a Python virtual environment
python -m venv venv
.\\venv\\Scripts\\Activate.ps1 # In PowerShell on Windows
# Install dependencies
pip install -r requirements.txt
# Install the code2flow CLI tool
pip install code2flow
# Start the MCP server directly with Python
python server.pyThe server exposes MCP tools and resources to analyze and generate call graphs. You can customize how you analyze code with the following options when generating a call graph.
Configuration options for generating call graphs include:
Run the server in a trusted environment and manage access to the MCP endpoints as you would with any other service. Keep the code2flow CLI up to date to benefit from any improvements to graph generation and language support.
If the server does not start, verify you have Python 3.7+ installed and that the required Python packages are installed. Check that the command to start the server is correct for your environment (for Windows, you may prefer launching via a PowerShell command; on other OSes you can run python server.py directly). Review any error messages for missing dependencies or permission issues.
Generates a code call graph from the provided source paths and language, returning the graphic image or a reference to the image.
Checks the installed code2flow CLI version to ensure compatibility with the MCP server features.
Analyzes the code complexity for given source paths and language and returns a complexity assessment.