🧠 MCP本机开发人员智能套件
一个基于 模型上下文协议(MCP) 弥合LLM和当地开发环境之间的差距。具有深入的Git历史分析、通过AST解析的自动代码审计以及使用模块化、状态管理的跨项目文档综合功能 LangGraph 建筑。
______________________________________________________________________
🏗️ 建筑
该系统被清晰地分为两层:
┌─────────────────────────────────────────────────────┐
│ Intelligence Layer │
│ (LangGraph State Machine) │
│ │
│ ┌─────────┐ ┌────────────┐ ┌──────────────┐ │
│ │ Scout │──▶│ Historian │──▶│ Synthesizer │ │
│ │ (Files) │ │ (Git) │ │ (Report) │ │
│ └─────────┘ └────────────┘ └──────────────┘ │
└────────────────────────┬────────────────────────────┘
│ calls
┌────────────────────────▼────────────────────────────┐
│ Protocol Layer │
│ (MCP Server — stdio transport) │
│ │
│ ┌──────────────────┐ ┌───────────────────────┐ │
│ │ get_git_history │ │ analyze_code_structure│ │
│ └──────────────────┘ └───────────────────────┘ │
└─────────────────────────────────────────────────────┘为什么是两层?
- 协议层 (
mcp_server/):一个独立的MCP服务器,可用于 *任何* MCP主机——克劳德桌面、自定义CLI或第三方集成。 - 智能层 (
agents/):一个LangGraph状态机,协调多步分析,与协议解耦。
______________________________________________________________________
📂 项目结构
MCP-Native-Developer-Intelligence-Suite/
├── mcp_server/ # Protocol Layer
│ ├── __init__.py
│ ├── main.py # Entry point (stdio runner)
│ └── server.py # MCP Server + tool registration
├── agents/ # Intelligence Layer
│ ├── __init__.py
│ ├── state.py # TypedDict state definition
│ └── graph.py # LangGraph nodes + edges
├── tools/ # Concrete Developer Tools
│ ├── __init__.py
│ ├── git_analyzer.py # Git CLI wrapper (subprocess)
│ ├── code_auditor.py # AST-based static analysis
│ └── doc_generator.py # Markdown synthesis
├── tests/
│ ├── __init__.py
│ └── test_tools.py # Unit tests
├── .env.example # Environment template
├── .gitignore
├── pyproject.toml # Dependencies + metadata
└── README.md______________________________________________________________________
🚀 快速开始
先决条件
- Python 3.11+
- Git已安装并位于PATH中
安装
# Clone the repository
git clone https://github.com/ayushchhipa1509/MCP-Native-Developer-Intelligence-Suite.git
cd MCP-Native-Developer-Intelligence-Suite
# Create virtual environment
python -m venv .venv
.venv\Scripts\activate # Windows
# source .venv/bin/activate # macOS/Linux
# Install dependencies
pip install -e ".[dev]"
# Set up environment
copy .env.example .env # Then fill in your API keys运行MCP服务器(stdio)
python -m mcp_server.main运行情报管道
from agents.graph import run_intelligence_report
report = run_intelligence_report("C:/path/to/your/project")
print(report)运行测试
pytest tests/ -v______________________________________________________________________
🔧 MCP工具
get_git_history
提取带有完整元数据的最后N个提交。
| 参数 | 类型 | 默认值 | 说明 |
|---|---|---|---|
repo_path | string | *必需的* | Git仓库的绝对路径 |
num_commits | integer | 10 | 提交次数(1-500) |
退货: 带有commits数组和贡献者统计信息的JSON。
analyze_code_structure
对Python代码库执行基于AST的静态分析。
| 参数 | 类型 | 默认值 | 说明 |
|---|---|---|---|
directory_path | string | *必需的* | 分析路径 |
file_extensions | string[] | [".py"] | 扩展包括 |
退货: 带有类层次结构、函数签名、导入映射和度量的JSON。
______________________________________________________________________
🤖 LangGraph代理管道
状态机通过三个顺序节点处理项目:
| 节点 | 角色 | 输出 |
|---|---|---|
| 侦察兵 | 文件发现+AST分析 | discovered_files, analysis_results |
| 历史学家 | Git历史提取 | git_context |
| 合成器 | 报告生成 | final_report (Markdown) |
国家通过 TypedDict 它跨节点累积数据:
class AgentState(TypedDict, total=False):
project_path: str
discovered_files: list[dict[str, Any]]
git_context: dict[str, Any]
analysis_results: dict[str, Any]
final_report: str
errors: list[str]______________________________________________________________________
🔌 Claude桌面集成
添加到您的 claude_desktop_config.json:
{
"mcpServers": {
"developer-intel-suite": {
"command": "python",
"args": ["-m", "mcp_server.main"],
"cwd": "C:/path/to/MCP-Native-Developer-Intelligence-Suite"
}
}
}______________________________________________________________________
📜 许可证
麻省理工学院
______________________________________________________________________
*使用模型上下文协议(MCP)和LangGraph构建。*
