code-tools-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@code-tools-mcp search for 'TODO' in all .py files"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Code Tools MCP
一个整合了文件阅读和代码搜索功能的 MCP (Model Context Protocol) 服务工具。
功能概述
本 MCP 服务注册了两个工具,供支持 MCP 协议的 AI 客户端(如 Claude Desktop、Claude Code 等)调用:
1. read_file — 文件阅读
读取指定路径的文件内容,支持按行范围分页读取。
参数:
参数 | 类型 | 必填 | 说明 |
| string | 是 | 文件的绝对或相对路径,支持跨盘符路径(如 |
| number | 否 | 起始行号(从 1 开始),配合 |
| number | 否 | 最大读取行数,配合 |
示例:
{
"file_path": "D:/projects/main.cpp",
"offset": 100,
"limit": 50
}2. search_codebase — 代码搜索
在指定目录中递归搜索匹配正则表达式的内容,基于 grep 实现。
参数:
参数 | 类型 | 必填 | 说明 |
| string | 是 | grep 兼容的搜索查询(支持正则表达式) |
| string | 否 | 搜索目录,支持绝对/相对路径,默认为当前工作目录 |
| string | 否 | 文件类型过滤(如 |
示例:
{
"query": "function\\s+loadNextLevel",
"directory": "D:/raylib/proj_1",
"include": "*.cpp"
}Related MCP server: Code Search, Read & PR Analysis
安装与配置
1. 安装依赖
cd D:/code-tools-mcp
npm install2. 配置 MCP 客户端
在 Claude Desktop 或 Claude Code 的 MCP 配置中添加:
{
"mcpServers": {
"code-tools": {
"command": "node",
"args": ["D:/code-tools-mcp/index.js"]
}
}
}3. 启动(测试)
node D:/code-tools-mcp/index.js项目结构
code-tools-mcp/
├── index.js # MCP 服务主入口,注册 read_file 和 search_codebase 两个工具
├── package.json # 项目配置文件
└── README.md # 本说明文件技术栈
运行时: Node.js
MCP SDK:
@modelcontextprotocol/sdkv1.29+参数校验: Zod v4.4+
文件读取: Node.js 内置
fs/promises代码搜索: 调用系统
grep命令
注意事项
search_codebase依赖系统安装的grep命令,Windows 用户需确保 Git Bash 或类似环境可用单次返回内容上限约为 64,000 字符,超出部分会被截断
文件读取默认使用 UTF-8 编码
Available Tools
2 toolsread_fileB
Read the contents of a file at the given path and return it as text. Supports reading specific line ranges.
Inputs: file_path (required), limit, offset.
search_codebaseA
Search the codebase using grep. Pass a regex-compatible query string and an optional directory path (absolute or relative) to search recursively. Defaults to the current working directory.
Inputs: query (required), include, directory.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
read_file and search_codebase target completely different operations: retrieving file contents versus locating matches across a codebase. There is no plausible scenario where an agent would confuse the two.
Both names follow a clean verb_noun snake_case pattern (read_file, search_codebase). The convention is consistent and immediately readable.
Two tools is quite thin for a server billed as general 'code-tools'; the surface is borderline minimal. It covers the two most essential read operations but leaves little room for a full workflow.
Read and search are covered, but there is no way to list directories, write/edit files, or inspect metadata, so agents hit dead ends for any mutation or discovery task. This is a notable but not fatal gap for a read-only browsing server.
Maintenance
Related MCP Connectors
Code intelligence for LLMs. Analyze, search, and retrieve code from any public git repository.
Code intelligence for coding agents: semantic, AST, graph, and full-text search. 279+ languages.
Access the GitHub API, enabling file operations, repository management, search functionality, and…
Securely search and manage workspace context files for AI agents and teams.
Related MCP Servers
- AlicenseAqualityDmaintenanceProvides LLM-optimized filesystem access with intelligent file pagination for large files, lightning-fast ripgrep-powered code search with regex support, and security sandboxing to safely explore and search codebases.71MIT
- FlicenseBqualityDmaintenanceEnables LLMs to search and read files in local and GitHub repositories, analyze pull request diffs, and grep code content with built-in security protections.6-
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to explore, search, and read codebase repositories and API specifications efficiently, with support for file searching, content search via ripgrep, and reading API specs.ISC
- AlicenseAqualityCmaintenanceEnables AI agents to search and read source code indexed by an OpenGrok instance using its REST search and raw file APIs. Supports full-text, definition, symbol, path, and history searches with paging, plus file lookup and line-numbered reads.4GPL 3.0