Used for cloning the repository to install the server
Hosts the repository for the code2flow-mcp-server project
One of the supported programming languages for generating call graphs from source code
One of the supported programming languages for generating call graphs from source code
One of the supported programming languages for generating call graphs from source code
One of the supported programming languages for generating call graphs from source code
Code2Flow MCP 服务器
这是一个将 code2flow 命令行工具包装为 MCP (Model Context Protocol) 服务器的项目。它允许 AI 应用程序通过标准化的 MCP 协议生成和访问代码调用图。
功能特点
- 分析源代码并生成调用图
- 支持多种编程语言(Python、JavaScript、Ruby、PHP)
- 通过 MCP 协议提供服务,易于与 AI 应用集成
- 图像以 PNG 格式输出
- 提供版本检查和代码复杂度分析功能
安装要求
- Python 3.7+
- Windows 11 或其他支持的操作系统
- PowerShell 或其他命令行终端
- 已安装 code2flow 命令行工具
安装步骤
- 克隆此仓库
- 创建并激活虚拟环境(推荐)
- 安装依赖项
- 安装 code2flow 命令行工具
使用方法
直接使用 Python 运行
- 启动 MCP 服务器
使用 MCP 工具运行
- 使用 MCP Inspector 工具
- 安装到 Claude Desktop
- 添加到 Cursor MCP 配置
可用工具
服务器提供以下 MCP 工具:
generate_call_graph
- 生成代码调用图check_code2flow_version
- 检查 code2flow 版本analyze_code_complexity
- 分析代码复杂度
可用资源
服务器提供以下 MCP 资源:
help://code2flow
- 帮助文档languages://supported
- 支持的语言列表call-graph://图像ID
- 生成的调用图图像
示例(使用 Python MCP 客户端)
配置选项
生成调用图时支持以下参数:
source_paths
:要分析的源代码文件或目录的路径列表output_path
:(可选)输出文件的路径language
:(可选)源代码语言(python、js、ruby、php)exclude
:(可选)要排除的文件模式列表include
:(可选)要包含的文件模式列表
文件结构
server.py
- 主服务器代码mcp_client_example.py
- 客户端示例代码test_server.py
- 测试代码requirements.txt
- 依赖文件
许可证
MIT
This server cannot be installed
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
A server that wraps the code2flow command-line tool as an MCP service, allowing AI applications to generate and access code call graphs through a standardized protocol.
Related MCP Servers
- AsecurityAlicenseAqualityThis project aims to build a Claude Code MCP server and implement its associated tools (explain\_code, review\_code, fix\_code, edit\_code, test\_code, simulate\_command, your\_own\_query). The server is implemented using Node.js and the MCP SDK. It receives tool requests from clients via Stdio, dynamicallyLast updated -77714JavaScriptMIT License
- -securityAlicense-qualityAn MCP server implementation that standardizes how AI applications access tools and context, providing a central hub that manages tool discovery, execution, and context management with a simplified configuration system.Last updated -9PythonMIT License
- -securityAlicense-qualityAn MCP server that implements Claude Code-like functionality, allowing the AI to analyze codebases, modify files, execute commands, and manage projects through direct file system interactions.Last updated -163PythonMIT License
- -securityAlicense-qualityAn MCP server that analyzes codebases and generates contextual prompts, making it easier for AI assistants to understand and work with code repositories.Last updated -10PythonMIT License