kursk-ye_code2flow-mcp-server

kursk-ye_code2flow-mcp-server

0

Code2Flow MCP Server integrates the code2flow tool into an MCP server, enabling AI applications to generate and access call graphs. It supports multiple languages and offers code complexity analysis and version checking.

Code2Flow MCP Server

This project wraps the code2flow command-line tool as an MCP (Model Context Protocol) server, allowing AI applications to generate and access code call graphs through a standardized MCP protocol.

Features

  • Analyzes source code and generates call graphs
  • Supports multiple programming languages (Python, JavaScript, Ruby, PHP)
  • Provides service through the MCP protocol for easy integration with AI applications
  • Outputs images in PNG format
  • Offers version checking and code complexity analysis features

Installation Requirements

  • Python 3.7+
  • Windows 11 or other supported OS
  • PowerShell or other command-line terminal
  • Code2Flow command-line tool installed

Usage

Direct Execution via Python

  1. Start the MCP server

Via MCP Tool

  1. Use MCP Inspector Tool
  2. Install on Claude Desktop
  3. Add to Cursor MCP configuration

Available Tools

  • generate_call_graph - Generates code call graphs
  • check_code2flow_version - Checks the code2flow version
  • analyze_code_complexity - Analyzes code complexity

Available Resources

  • help://code2flow - Help documentation
  • languages://supported - List of supported languages
  • call-graph://imageID - Generated call graph images

Configuration Options

  • source_paths: Paths to source code files or directories
  • output_path: (optional) Path of the output file
  • language: (optional) Source code language (python, js, ruby, php)
  • exclude: (optional) List of file patterns to exclude
  • include: (optional) List of file patterns to include

File Structure

  • server.py - Main server code
  • mcp_client_example.py - Client example code
  • test_server.py - Test code
  • requirements.txt - Dependencies

License

MIT