能力标签
cs MCP工具
🔌
MCP工具

cs MCP工具

基于 Go · 让 AI 助手直接操作你的系统与工具
英文名:cs
⭐ 982 Stars 🍴 18 Forks 💻 Go 📄 MIT 🏷 AI 8.2分
8.2AI 综合评分
代码搜索CLI工具结构感知TUI界面MCP协议
✦ AI Skill Hub 推荐

cs MCP工具 是 AI Skill Hub 本期精选MCP工具之一。综合评分 8.2 分,整体质量较高。我们强烈推荐将其纳入你的 AI 工具库,帮助提升工作效率。

📚 深度解析

cs MCP工具 是一款基于 MCP(Model Context Protocol)标准协议的 AI 工具扩展。MCP 协议由 Anthropic 开发并开源,旨在建立 AI 模型与外部工具之间的标准化通信接口,目前已被 Claude Desktop、Claude Code、Cursor 等主流 AI 工具采纳。

通过安装 cs MCP工具,你的 AI 助手将获得额外的工具调用能力,可以用自然语言直接操控该工具的功能,无需学习复杂的命令行语法。MCP 工具的核心价值在于"一次配置,永久增强"——配置完成后,每次与 AI 对话时都可以无缝调用这些工具。

在技术实现上,MCP 工具通过标准的 JSON-RPC 协议与 AI 客户端通信,工具的功能以"工具列表"的形式暴露给 AI 模型,AI 可以按需调用。cs MCP工具 提供了结构化的工具调用接口,使 AI 模型能够精确地理解和使用每个功能点,显著降低 AI 在工具使用上的错误率。

与传统的 API 集成相比,MCP 工具的优势在于无需编写代码——用户只需在配置文件中添加几行 JSON,即可让 AI 获得全新能力。AI Skill Hub 将 cs MCP工具 评为 AI 评分 8.2 分,属于同类工具中的优质选择。

📋 工具概览

CodeSpelunker是开源MCP工具,提供CLI代码搜索功能,能理解代码结构并智能排序搜索结果。支持TUI交互界面,适合开发者快速定位和探索代码库中的相关代码片段。

cs MCP工具 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。

GitHub Stars
⭐ 982
开发语言
Go
支持平台
Windows / macOS / Linux(跨平台)
维护状态
正常维护,社区驱动
开源协议
MIT
AI 综合评分
8.2 分
工具类型
MCP工具
Forks
18

📖 中文文档

以下内容由 AI Skill Hub 根据项目信息自动整理,如需查看完整原始文档请访问底部「原始来源」。

CodeSpelunker是开源MCP工具,提供CLI代码搜索功能,能理解代码结构并智能排序搜索结果。支持TUI交互界面,适合开发者快速定位和探索代码库中的相关代码片段。

cs MCP工具 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。

📌 核心特色
  • 通过标准 MCP 协议与 Claude、Cursor 等主流 AI 客户端深度集成
  • 提供结构化工具调用接口,显著降低 AI 集成复杂度
  • 支持 Claude Desktop 和 Claude Code 无缝接入,开箱即用
  • 可与其他 MCP 工具组合叠加,构建完整 AI 工作站
  • 轻量无侵入设计,不影响现有系统架构
🎯 主要使用场景
  • 在 Claude Desktop 对话中直接调用本地工具,实现 AI 与系统的深度联动
  • 通过自然语言驱动复杂的多步骤自动化任务,代替繁琐手动操作
  • 将多个 MCP 工具组合使用,构建个人专属 AI 工作站
以下安装命令基于项目开发语言和类型自动生成,实际以官方 README 为准。
安装命令
# 方式一:通过 Claude Code CLI 一键安装
claude skill install https://github.com/boyter/cs

# 方式二:手动配置 claude_desktop_config.json
{
  "mcpServers": {
    "cs-mcp--": {
      "command": "npx",
      "args": ["-y", "cs"]
    }
  }
}

# 配置文件位置
# macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
# Windows: %APPDATA%/Claude/claude_desktop_config.json
📋 安装步骤说明
  1. 确认已安装 Node.js(v18 或以上版本)
  2. 打开 Claude Desktop 或 Claude Code 的 MCP 配置文件
  3. 按「交给 Agent 安装 → Claude Desktop」标签中的 JSON 配置填入 mcpServers 字段
  4. 保存配置文件并重启 Claude 客户端
  5. 重启后,在对话中即可使用本工具
以下用法示例由 AI Skill Hub 整理,涵盖最常见的使用场景。
常用命令 / 代码示例
# 安装后在 Claude 对话中直接使用
# 示例:
用户: 请帮我用 cs MCP工具 执行以下任务...
Claude: [自动调用 cs MCP工具 MCP 工具处理请求]

# 查看可用工具列表
# 在 Claude 中输入:"列出所有可用的 MCP 工具"
以下配置示例基于典型使用场景生成,具体参数请参照官方文档调整。
配置示例
// claude_desktop_config.json 配置示例
{
  "mcpServers": {
    "cs_mcp__": {
      "command": "npx",
      "args": ["-y", "cs"],
      "env": {
        // "API_KEY": "your-api-key-here"
      }
    }
  }
}

// 保存后重启 Claude Desktop 生效
📑 README 深度解析 真实文档 完整度 64/100 查看 GitHub 原文 →
以下内容由系统直接从 GitHub README 解析整理,保留代码块、表格与列表结构。

codespelunker (cs)

cs powers searchcode.com — structured code intelligence over any repo, built for AI agents.

Key Features

Structural Filtering

Stop grepping through false positives.

cs "database" --only-code        # Ignore matches in comments/docs
cs "FIXME" --only-comments       # Ignore matches in code/strings
cs "error" --only-strings        # Find where error messages are defined
cs "handleRequest" --only-declarations  # Jump to where it's defined (func, class, def, etc.)
cs "handleRequest" --only-usages        # Every call site, skipping the definition

These are mutually exclusive with --only-code, --only-comments, and --only-strings.

The structural ranker also uses declaration detection to boost matches that appear on declaration lines (e.g. func, class, def) over plain usages. This currently works for the following languages:

Go, Python, JavaScript, TypeScript, TSX, Rust, Java, C, C++, C#, Ruby, PHP, Kotlin, Swift, Shell, Lua, Scala, Elixir, Haskell, Perl, Zig, Dart, Julia, Clojure, Erlang, Groovy, OCaml, MATLAB, Powershell, Nim, Crystal, V

For unsupported languages, all matches are treated as usages and ranked by text relevance only. Structural filtering (--only-code, --only-comments, --only-strings) still works for any language recognised by scc.

Complexity Gravity

Find where the work happens.

cs "login" --gravity=brain       # Boosts complex files (the implementation)
cs "login" --gravity=low         # Boosts simple files (configs/interfaces)

Ranking Profiles

Preset ranking strategies that tune multiple parameters at once.

cs "authenticate" --profile=precise   # Short, focused source files
cs "authenticate" --profile=broad     # Cast a wide net, include tests
cs "authenticate"                     # Balanced (default, same as always)
ProfileBest forWhat it does
balancedGeneral use (default)Standard BM25 tuning, moderate complexity boost, test files dampened
precise"Find the one file that matters"Saturates quickly on term frequency, penalises long files, aggressively filters noise and test files
broad"Show me everything relevant"Rewards repeated matches, boosts long files slightly, includes test files at full weight

When --profile is set it overrides --gravity, --noise, and --test-penalty.

Git Sync

Keep your search targets up to date automatically. When running in a long-lived mode (TUI, HTTP, or MCP), --git-sync periodically runs git pull on repositories found in the search directory.

```shell

Install

If you want to create a package to install, please make it. Let me know, and I will ensure I add it here.

Go Get

If you have Go >= 1.25.2 installed

go install github.com/boyter/cs/v3@latest

Nixos

nix-shell -p codespelunker

<https://github.com/NixOS/nixpkgs/pull/236073>

Manual

Binaries for Windows, GNU/Linux, and macOS are available from the releases page.

Usage

Command line usage of cs is designed to be as simple as possible. Full details can be found in cs --help or cs -h. Note that the below reflects the state of master not a release, as such features listed below may be missing from your installation.

$ cs -h
code spelunker (cs) code search.
Version 3.1.0
Ben Boyter <ben@boyter.org>

cs recursively searches the current directory using some boolean logic
optionally combined with regular expressions.

Works via command line where passed in arguments are the search terms
or in a TUI mode with no arguments. Can also run in HTTP mode with
the -d or --http-server flag.

Searches by default use AND boolean syntax for all terms
 - exact match using quotes "find this"
 - fuzzy match within 1 or 2 distance fuzzy~1 fuzzy~2
 - negate using NOT such as pride NOT prejudice
 - OR syntax such as catch OR throw
 - group with parentheses (cat OR dog) NOT fish
 - note: NOT binds to next term, use () with OR
 - regex with toothpick syntax /pr[e-i]de/

Searches can filter which files are searched by adding
the following syntax
 - file:test              (substring match on filename)
 - filename:.go           (substring match on filename)
 - path:pkg/search        (substring match on full file path)

Example search that uses all current functionality
 - darcy NOT collins wickham~1 "ten thousand a year" /pr[e-i]de/ file:test path:pkg

The default input field in tui mode supports some nano commands
- CTRL+a move to the beginning of the input
- CTRL+e move to the end of the input
- CTRL+k to clear from the cursor location forward

- F1 cycle ranker (simple/tfidf/bm25/structural)
- F2 cycle code filter (default/only-code/only-comments/only-strings/only-declarations/only-usages)
- F3 cycle gravity (off/low/default/logic/brain)
- F4 cycle noise (silence/quiet/default/loud/raw)

Usage:
  cs [flags]

Flags:
      --address string               address and port to listen on (default ":8080")
  -A, --after-context int            lines of context after each match (grep mode)
  -B, --before-context int           lines of context before each match (grep mode)
      --binary                       set to disable binary file detection and search binary files
  -c, --case-sensitive               make the search case sensitive
      --color string                 color output mode [auto, always, never] (default "auto")
  -C, --context int                  lines of context before and after each match (grep mode)
      --cpu-profile string           write CPU profile to file (for use with go tool pprof or PGO)
      --dedup                        collapse byte-identical search matches, keeping the highest-scored representative
      --dir string                   directory to search, if not set defaults to current working directory
      --exclude-dir strings          directories to exclude (default [.git,.hg,.svn])
  -x, --exclude-pattern strings      file and directory locations matching case sensitive patterns will be ignored [comma separated list: e.g. vendor,_test.go]
  -r, --find-root                    attempts to find the root of this repository by traversing in reverse looking for .git or .hg
  -f, --format string                set output format [text, json, vimgrep] (default "text")
      --git-sync                     periodically git pull repositories found in the search directory (TUI/HTTP/MCP only)
      --git-sync-interval duration   interval between git sync pulls (e.g. 5m, 30s, 1h) (default 5m0s)
      --git-sync-workers int         number of concurrent git pull workers (default 1)
      --gravity string               complexity gravity intent: brain (2.5), logic (1.5), default (1.0), low (0.2), off (0.0) (default "default")
  -h, --help                         help for cs
      --hidden                       include hidden files
  -d, --http-server                  start the HTTP server
  -i, --include-ext strings          limit to file extensions (N.B. case sensitive) [comma separated list: e.g. go,java,js,C,cpp]
      --line-limit int               max matching lines per file in grep mode (-1 = unlimited) (default -1)
      --max-read-size-bytes int      number of bytes to read into a file with the remaining content ignored (default 1000000)
      --mcp                          start as an MCP (Model Context Protocol) server over stdio
      --min                          include minified files
      --min-line-length int          number of bytes per average line for file to be considered minified (default 255)
      --no-gitignore                 disables .gitignore file logic
      --no-ignore                    disables .ignore file logic
      --no-syntax                    disable syntax highlighting in output
      --noise string                 noise penalty intent: silence (0.1), quiet (0.5), default (1.0), loud (2.0), raw (off) (default "default")
      --only-code                    only rank matches in code (auto-selects structural ranker)
      --only-comments                only rank matches in comments (auto-selects structural ranker)
      --only-declarations            only show matches on declaration lines (func, type, var, const, class, def, etc.)
      --only-strings                 only rank matches in string literals (auto-selects structural ranker)
      --only-usages                  only show matches on usage lines (excludes declarations)
  -o, --output string                output filename (default stdout)
      --profile string               ranking profile [balanced, precise, broad] — overrides --gravity, --noise, and --test-penalty when set
      --ranker string                set ranking algorithm [simple, tfidf, bm25, structural] (default "structural")
      --result-limit int             maximum number of results to return (-1 for unlimited) (default -1)
      --reverse                      reverse the result order
  -s, --snippet-count int            number of snippets to display (default 1)
  -n, --snippet-length int           size of the snippet to display (default 300)
      --snippet-mode string          snippet extraction mode: auto, snippet, lines, or grep (default "auto")
      --template-display string      path to a custom display template
      --template-search string       path to a custom search template
      --template-style string        built-in theme for the HTTP server UI [dark, light, bare] (default "dark")
      --test-penalty float           score multiplier for test files when query has no test intent (0.0-1.0, 1.0=disabled) (default 0.4)
  -t, --type strings                 limit to language types [comma separated list: e.g. Go,Java,Python]
  -v, --version                      version for cs
      --weight-code float            structural ranker: weight for matches in code (default 1.0) (default 1)
      --weight-comment float         structural ranker: weight for matches in comments (default 0.2) (default 0.2)
      --weight-string float          structural ranker: weight for matches in strings (default 0.5) (default 0.5)

Searches work on single or multiple words with a logical AND applied between them. You can negate with NOT before a term. You can combine terms with OR and use parentheses to control grouping. You can do an exact match with quotes and do regular expressions using toothpicks.

Example searches,

cs t NOT something test~1 "ten thousand a year" "/pr[e-i]de/" file:test
cs (cat OR dog) AND NOT bird
cs path:vendor main           # search only under vendor/
cs "func main" path:cmd       # find main functions under cmd/
cs handler lang:go            # search only Go files
cs TODO lang:go,python        # search Go and Python files
cs NOT lang:go test           # search all languages except Go
cs handler complexity:>=50    # find complex files containing "handler"
cs "json" --only-code         # find "json" in code, ignoring string literals
cs "hack" --only-comments     # find "hack" in comments only
cs "func main" --only-declarations      # find main function declarations
cs "logger" --only-usages               # find where logger is called, not defined
cs "Copyright" --dedup                   # collapse identical copyright headers

You can use it in a similar manner to fzf in TUI mode if you like, since cs will return the matching document path if you hit the enter key one you have highlighted a result.

cat `cs`  # cat out the matching file
vi `cs`   # edit the selected file

CLI code search tool that understands code structure and ranks results by relevance. No indexing required

Ever searched for authenticate and gotten 200 results from config files, comments, and test stubs before finding the actual implementation? cs fixes that.

It combines the speed of CLI tools with the relevance ranking usually reserved for heavy indexed search engines like Sourcegraph or Zoekt, but without needing to maintain an index.

cs "authenticate" --gravity=brain           # Find the complex implementation, not the interface
cs "FIXME OR TODO OR HACK" --only-comments  # Search only in comments, not code or strings
cs "error" --only-strings                   # Find where error messages are defined
cs "handleRequest" --only-declarations      # Jump straight to where it's defined
cs "handleRequest" --only-usages            # Find every call site, skip the definition
cs "error" --dedup                          # Collapse duplicated matches into one result

Licensed under MIT.

Go Report Card Coverage Status Cs Count Badge

[//]: # ([![asciicast]&#40;https://asciinema.org/a/589640.svg&#41;]&#40;https://asciinema.org/a/589640&#41;)

cs TUI demo

<https://github.com/user-attachments/assets/3b7f4bb2-d542-406d-9c53-29c0430dd60a>

FAQ

Is this as fast as

No.

You didn't let me finish, I was going to ask if it's as fast as

The answer is probably no. It's not directly comparable. No other tool I know of works like this outside of full indexing tools such as hound, searchcode, sourcegraph etc... None work on the fly like this does.

As far as I know what cs does is unique for a command line tool.

cs runs a full lexical analysis and complexity calculation from scc on every matching file. This is expensive compared to the raw byte-scanning of ripgrep, but probably not as slow as you may think.

On a modern machine (such as Apple Silicon M1), it can search and rank the entire Linux kernel source in ~3 seconds. Using a 9950x3D it can search the kernel in ~400 milliseconds.

Does it work on normal documents?

So long as they are text. I wrote it to search code, but it works just as well on full-text documents. The snippet extraction, for example, was tested on Pride and Prejudice, a text I know more about than I probably should considering I'm male.

Where is the index?

There is none. Everything is brute force calculated on the fly. There is some caching to speed things up, but should in practice never affect the results.

How does the ranking work?

cs uses a weighted BM25 algorithm.

Standard BM25 weights matches based on "fields" (so title, body, category). cs generates fields dynamically by parsing the code syntax.

  • A match in code gets full weight (1.0).
  • A match in a string gets partial weight (0.5).
  • A match in a comment gets lower weight (0.2).

This means a file where your search term appears in the logic will rank higher than a file where the term only appears in the documentation, even if the word count is the same.

You can tweak the values as needed via the CLI, or on the fly change what fields cs searches.

What is complexity gravity?

Complexity gravity is a ranking boost that uses each file's cyclomatic complexity to influence result ordering.

In code search, the best result is usually where the logic is implemented. These files usually have higher algorithmic density (branches, loops, conditions). cs uses this so implementation files generally outrank data/config/interface files all things being equal.

The --gravity flag accepts named intent:

IntentStrengthPurpose
brain2.5Aggressively surface complex core logic
logic1.5Standard boost toward complex code
default1.0Balanced (applied when flag not set)
low0.2Flatten gravity, find simple boilerplate
off0.0Pure text relevance, no complexity boost
cs --gravity=brain "search term"   # find complex implementations
cs --gravity=off "search term"     # pure text relevance

How do you get the snippets?

It's not fun... see <https://github.com/boyter/cs/blob/master/pkg/snippet/snippet.go> and <https://github.com/boyter/cs/blob/master/pkg/snippet/snippet_lines.go>

It works by passing the document content to extract the snippet from and all the match locations for each term. It then looks through each location for each word, and checks on either side looking for terms close to it. It then ranks on the term frequency for the term we are checking around and rewards rarer terms. It also rewards more matches, closer matches, exact case matches, and matches that are whole words.

For more info read the "Snippet Extraction AKA I am PHP developer" section of this blog post <https://boyter.org/posts/abusing-aws-to-make-a-search-engine/>

What does HTTP mode look like?

It's a little brutalist.

<img alt="cs http" src="https://github.com/boyter/cs/raw/master/cs_http.png">

You can change its look and feel using --template-style for built-in themes (dark, light, bare), or provide custom templates with --template-display and --template-search. See <https://github.com/boyter/cs/tree/master/asset/templates> for example templates you can use to modify the look and feel.

cs -d --template-style light
cs -d --template-display ./asset/templates/display.tmpl --template-search ./asset/templates/search.tmpl
🎯 aiskill88 AI 点评 A 级 2026-05-20

活跃的Go项目,结合MCP协议和代码结构感知的创新搜索工具。设计优雅,社区认可度高,适合AI编程增强场景。

📚 实用指南(长尾问题)
适合谁
  • 需要让 Claude / Cursor 操作本地工具的 AI 工程师
最佳实践
  • 配置 MCP 服务器时建议使用 stdio 传输 + JSON-RPC,避免暴露公网
常见错误
  • API key 直接提交到 git 仓库(请用 .env 并加入 .gitignore)
  • MCP 配置路径拼错或权限不足,重启 Claude Desktop 才生效
部署方案
  • CLI:直接 npm install -g / pip install,命令行调用
  • 云端托管:可放在 Vercel / Railway / Fly.io 等 PaaS 平台
相关搜索
cs 中文教程cs 安装报错怎么办cs MCP 配置cs 与同类工具对比cs 最佳实践cs 适合谁用

⚡ 核心功能

👥 适合谁
  • 需要让 Claude / Cursor 操作本地工具的 AI 工程师
⭐ 最佳实践
  • 配置 MCP 服务器时建议使用 stdio 传输 + JSON-RPC,避免暴露公网
⚠️ 常见错误
  • API key 直接提交到 git 仓库(请用 .env 并加入 .gitignore)
  • MCP 配置路径拼错或权限不足,重启 Claude Desktop 才生效

👥 适合人群

Claude Desktop / Claude Code 用户AI 工具开发者需要扩展 AI 能力的专业人士自动化工程师

🎯 使用场景

  • 在 Claude Desktop 对话中直接调用本地工具,实现 AI 与系统的深度联动
  • 通过自然语言驱动复杂的多步骤自动化任务,代替繁琐手动操作
  • 将多个 MCP 工具组合使用,构建个人专属 AI 工作站

⚖️ 优点与不足

✅ 优点
  • +MIT 协议,可免费商用
  • +标准化 MCP 协议,生态互联性强
  • +与 Claude 官方生态无缝对接
  • +即插即用,配置简单快捷
⚠️ 不足
  • 依赖 Claude 客户端,非 Claude 用户无法使用
  • MCP 协议仍在持续演进,接口可能变更
  • 需要一定的配置步骤
⚠️ 使用须知

AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。

建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。

📄 License 说明

✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。

🔗 相关工具推荐

📚 相关教程推荐
📰 相关 AI 新闻
🍿 AI 圈相关吃瓜
🗺️ 相关解决方案
🧩 你可能还需要
基于当前 Skill 的能力图谱,自动补全的工具组合

❓ 常见问题 FAQ

支持主流编程语言,通过AST解析理解代码结构,提供更精准的搜索排序。
💡 AI Skill Hub 点评

经综合评估,cs MCP工具 在MCP工具赛道中表现稳健,质量优秀。如果你已有明确的使用需求,可以直接上手体验;如果还在评估阶段,建议对比同类工具后再做决策。

⬇️ 获取与下载
⬇ 下载源码 ZIP

✅ MIT 协议 · 可免费商用 · 直接从 aiskill88 服务器下载,无需跳转 GitHub

📚 深入学习 cs MCP工具
查看分步骤安装教程和完整使用指南,快速上手这款工具
🌐 原始信息
原始名称 cs
原始描述 开源MCP工具:codespelunker - CLI code search tool that understands code structure and ranks r。⭐982 · Go
Topics 代码搜索CLI工具结构感知TUI界面MCP协议
GitHub https://github.com/boyter/cs
License MIT
语言 Go
🔗 原始来源
🐙 GitHub 仓库  https://github.com/boyter/cs

收录时间:2026-05-19 · 更新时间:2026-05-19 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。

📺 订阅 AI Skill Hub Daily Telegram 频道
每天 8 条精选 AI Skill、MCP、Agent 与自动化工具推送
加入频道 →