
archmcp
by dejo1307·★ 30·综合分 44
archmcp 是一个 MCP 服务器,为代码库生成紧凑的架构快照,帮助 AI 代理了解项目结构。
概述
archmcp 是一个本地 MCP 服务器,在 AI 代理开始探索代码之前创建代码库的架构快照。它将预生成的架构摘要作为 MCP 资源暴露,并提供按需生成和查询快照的工具。服务器通过一个管道处理代码:遍历文件,基于语言特定的解析器提取事实,将它们存储在图索引中,并渲染为 LLM 友好的上下文。目前支持 Go、Kotlin、Python、TypeScript、Swift、Ruby 和 OpenAPI 规范,并对 Next.js、Android、FastAPI、Rails 等框架具有特定语言感知能力。
试试问 AI
装完之后,这里有 5 个你可以让 AI 做的事:
什么时候选它
当你处理不同语言的多个代码库,并希望 AI 编码助手在探索代码前理解架构关系时,选择 archmcp。
什么时候不要选它
如果你只处理单个小型项目或需要实时代码分析,不要选择 archmcp,因为它是为 upfront 架构分析而非连续监控设计的。
此 server 暴露的工具
从 README 抽取出 12 个工具generate_snapshotGenerate an architectural snapshot of a repository
query_factsQuery architectural facts with optional filters
analyze_architectureAnalyze architectural patterns and potential issues
get_insightsRetrieve architectural insights and recommendations
append_snapshotAppend another repository to the current architectural snapshot
get_dependenciesGet dependency information for a specific module or symbol
get_symbolsRetrieve all symbols (classes, functions, etc.) in the codebase
impact_analysisAnalyze the impact of changing a specific module or symbol
get_routesGet all API routes and their handlers
get_call_chainGet the call chain between two symbols
get_storageGet database/storage models and their relationships
get_layer_violationsCheck for architectural layer violations
可对比工具
安装
前置要求
- Go 1.22+
- C 编译器(用于 tree-sitter CGo 绑定)
构建
go build -o archmcp ./cmd/archmcp或全局安装:
go install ./cmd/archmcp连接到您的 MCP 客户端
添加到您的 MCP 客户端配置中。例如,在 Cursor 的 mcp.json 中:
{
"mcpServers": {
"archmcp": {
"command": "/path/to/archmcp",
"args": ["/path/to/mcp-arch.yaml"]
}
}
}如果通过 go install 安装:
{
"mcpServers": {
"archmcp": {
"command": "archmcp"
}
}
}FAQ
- archmcp 是什么?
- archmcp 是一个 MCP 服务器,为代码库生成架构快照,在 AI 代理开始探索代码之前为其提供模块、符号、依赖和模式的结构化概览。
- archmcp 会取代传统的代码探索工具吗?
- 不会,archmcp 设计为在传统工具之前运行。它提供前置的结构化上下文,使像 grep、文件搜索和代码阅读等工具更有效,帮助 AI 知道在哪里查看。
archmcp 对比
最后更新于 · 由 README + GitHub 公开数据自动生成。