Skip to main content
Glama
BigJai
by BigJai

CodeMunch Pro

智能代码索引 MCP 服务器。15 个工具,10 种语言,tree-sitter AST 提取,混合搜索(FTS5 + 向量),调用图,远程仓库索引,增量索引。

节省 99% 的 token — 通过字节偏移定位直接获取精确的函数源码,无需读取整个文件。

安装

pip install codemunch-pro

Related MCP server: RTFM

快速开始

Claude Desktop / Cline

添加到您的 MCP 客户端配置:

{
  "mcpServers": {
    "codemunch-pro": {
      "command": "codemunch-pro"
    }
  }
}

HTTP 服务器

codemunch-pro --transport streamable-http --port 5002

15 个 MCP 工具

工具

描述

index_folder

索引本地目录(增量,基于 SHA-256)

index_repo

索引 GitHub/GitLab 仓库(tarball 下载,无需 git)

list_repos

列出所有已索引的仓库及统计信息

invalidate_cache

强制重新索引仓库

file_tree

获取目录树及文件计数

file_outline

列出单个文件中的符号

repo_outline

列出仓库中的所有符号(摘要)

get_symbol

获取单个符号的完整源码(O(1) 字节定位)

get_symbols

批量获取多个符号

search_symbols

混合搜索(FTS5 + 向量 RRF)

search_text

在文件内容中进行全文搜索

get_callees

此函数调用了什么?

get_callers

谁调用了此函数?

diff_symbols

自上次索引以来发生了什么变化?(PR 审查)

dependency_map

此文件依赖什么?什么依赖它?

10 种语言

Python、JavaScript、TypeScript、Go、Rust、Java、C、C++、C#、Ruby

全部通过 tree-sitter-language-pack — 零编译,预构建二进制。

主要特性

O(1) 符号检索

每个符号存储其字节偏移和长度。get_symbol 直接定位到函数源码 — 无需读取整个文件。从 40KB 文件中获取 200 字节的函数 = 节省 99.5% 的 token

增量索引

文件经过哈希(SHA-256)。仅重新解析更改的文件。更改一个文件后重新索引包含 10K 文件的仓库只需毫秒级时间。

混合搜索(FTS5 + 向量)

使用倒数排名融合(RRF)结合 BM25 关键词匹配与语义向量相似度。搜索“authentication middleware”可找到 auth_middlewareverify_tokenlogin_handler

调用图

通过 AST 追踪函数调用。get_callees("main") 显示 main 调用了什么。get_callers("authenticate") 显示谁调用了 authenticate。支持深度遍历。

远程仓库索引(v1.1)

通过 URL 索引任何公共 GitHub 或 GitLab 仓库 — 无需 git 二进制。通过 API 下载 tarball,解压并索引。本地缓存,基于 SHA 的新鲜度检查。支持带认证令牌的私有仓库和稀疏路径。

全文内容搜索

搜索原始文件内容 — 字符串字面量、TODO 注释、配置值、错误消息。不仅仅是符号名称。

工作原理

  1. 解析 — tree-sitter 为每个源文件构建 AST

  2. 提取 — 遍历 AST 以查找函数、类、方法、类型、接口

  3. 存储 — 每个仓库一个 SQLite 数据库,包含 FTS5 虚拟表

  4. 嵌入 — FastEmbed(ONNX,仅 CPU)生成 384 维向量用于语义搜索

  5. — 从函数体中提取调用表达式,存储并解析边

  6. 服务 — FastMCP 通过 stdio 或 HTTP 暴露 13 个工具

架构

~/.codemunch-pro/
├── myproject_a1b2c3d4e5f6.db    # Per-repo SQLite database
├── otherproject_7890abcdef.db
└── ...

Each DB contains:
├── files          # Indexed files with SHA-256 hashes
├── symbols        # Functions, classes, methods, types
├── symbols_fts    # FTS5 full-text search index
├── symbols_vec    # sqlite-vec 384-dim vector index
├── call_edges     # Call graph (caller → callee)
└── file_content_fts  # Raw file content search

使用场景

  • AI 编码代理:让您的代理以精准的方式访问代码库,而不消耗上下文

  • 代码审查:在更改函数签名之前找到所有调用者

  • 入职培训:语义搜索符号 — “错误处理在哪里?” 找到相关代码

  • 重构:在模块间移动函数之前绘制调用图

  • 文档:提取所有公共 API 及其签名和文档字符串

许可证

MIT

A
license - permissive license
Not graded
quality - not tested
F
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    A
    quality
    A
    maintenance
    A local-first codebase intelligence tool that enables AI assistants to research codebases using semantic search, multi-hop relationship discovery, and structural parsing. It allows users to extract architectural patterns and institutional knowledge across 30+ programming languages through an MCP-compatible interface.
    2
    1,415
    MIT
  • A
    license
    Not graded
    quality
    B
    maintenance
    The open retrieval layer for AI agents. Index your entire project — code, docs, legal, research, data — and serve surgical context via MCP. FTS5 full-text search, optional semantic search (FastEmbed/ONNX), 10 built-in parsers, incremental auto-sync.
    22
    MIT
  • A
    license
    Not graded
    quality
    A
    maintenance
    Provides code intelligence for AI coding agents by indexing repositories into a hybrid knowledge graph, enabling agents to query dependencies, impact, and context through 28 MCP tools.
    3
    Apache 2.0

View all related MCP servers

Related MCP Connectors

  • Code intelligence for coding agents: semantic, AST, graph, and full-text search. 279+ languages.

  • Provide your AI coding tools with token-efficient access to up-to-date technical documentation for…

  • Give your AI agent a persistent map of your project's structure, dependencies, and bugs.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/BigJai/codemunch-pro'

If you have feedback or need assistance with the MCP directory API, please join our Discord server