MCP Desktop Tools
Enables searching text across configured local workspaces using ripgrep. Provides secure text search capabilities within defined workspace boundaries through both MCP server and CLI interfaces.
README
MCP Desktop Tools
MCP Desktop Tools provides a minimal Model Context Protocol (MCP) server and a local CLI (mcp-tools) for inspecting source trees across configured workspaces using ripgrep and git.
Features (C1)
- Minimal MCP server registering
search_text,git_graph,repo_map,scaffold, andopen_recenttools, speaking JSON over stdin/stdout. - Workspace configuration via
workspaces.yamlwith environment overrides. - Security helpers to keep requests within declared workspace roots, including symlink escape detection.
- Persistent disk cache for
repo_mapand in-process TTL cache forsearch_text, with per-request opt-out (--no-cache). - Bounded filesystem concurrency with tunable worker pool (
--max-workers/MCPDT_MAX_WORKERS). - Rich metrics:
elapsed_ms,git_cmd_ms,fs_walk_count,bytes_scanned,cache_hit, and optional stage profiles (--profile). - Ripgrep and git adapters with configurable timeouts (
MCPDT_SUBPROC_TIMEOUT_MS) and warnings for truncated results. - Logging with configurable level through
MCPDT_LOGor the CLI--log-levelflag. - Scaffold and open_recent tools for generating project skeletons and listing recently modified files, with user template overrides (
MCPDT_TEMPLATES_USER_DIR). - New:
snapshottool composes git history, filesystem stats, and safe environment markers into a single JSON artifact that can optionally be logged to MLflow. - New: Minimal Python client (
mcp_desktop_tools.integrations.lab_client.LabClient) for invoking tools from *Lab agents.
Installation
See INSTALL.md for detailed instructions. In short:
pipx install . # or python -m pip install -e .[dev]
External binaries required:
Override discovery via MCPDT_RG_PATH / MCPDT_GIT_PATH if they are not on PATH.
Configuration
Workspaces are defined in workspaces.yaml. See CONFIG.md for schema details. Environment variables can override the configuration path and ripgrep binary.
CLI Usage
Search text with ripgrep:
mcp-tools --workspace demo search_text --query "main" --include "**/*.py" --before 1 --after 1 --json
Summarise a git repository:
mcp-tools --workspace demo git_graph --rel-path proj --last-commits 20 --with-files --json
Generate a repository map:
mcp-tools --workspace demo repo_map --rel-path proj --max-depth 5 --top-dirs 30 --yaml
Capture a repository snapshot and log it to MLflow:
mcp-tools --workspace demo snapshot --rel-path proj --run-name "$BUILD_TAG" --tag repo=proj --mlflow-uri "$MLFLOW_TRACKING_URI" --experiment homelab --artifact-path repo_snapshot.json --json
Scaffold a project using the built-in templates:
mcp-tools --workspace demo scaffold --target-rel demo --template-id pyproject_min --var project_name=demo --dry-run --json
List recently updated files:
mcp-tools --workspace demo open_recent --rel-path proj --count 20 --extensions .py --json
Use --yaml to emit YAML instead of tabular output. --profile prints stage timings to stderr and includes metrics.profile in structured outputs.
All cache-enabled commands accept --no-cache; filesystem-heavy commands accept --max-workers to cap concurrency.
Set MCPDT_SNAPSHOT_INCLUDE_ENV=1 to include safe environment markers (os, arch, python, tool versions) in snapshot outputs.
Server Usage
Start the server with:
python -m mcp_desktop_tools.server
The server accepts JSON lines on stdin with the following structure:
{"tool": "search_text", "input": {"workspace_id": "demo", "query": "main"}}
Responses follow the unified schemas documented in mcp_desktop_tools/schemas/*.json.
Detailed usage guides for the scaffold and open_recent tools, including template formats and GardenKeeper integration examples, are available in DOCS/SCAFFOLD.md, DOCS/OPEN_RECENT.md, and DOCS/TEMPLATES.md.
Logging
Set MCPDT_LOG (or --log-level for the CLI) to control verbosity. Logs include timing information recorded by the adapters and tool execution paths. Metrics such as elapsed_ms, git_cmd_ms, bytes_scanned, cache_hit, and trimming warnings are propagated in tool responses.
Testing
Run the quality suite with:
ruff check .
mypy mcp_desktop_tools
pytest -q --cov=mcp_desktop_tools
Integration tests expect both rg and git to be available.
See SECURITY.md, POLICY.md, CONFIG.md, PERF.md, and CONTRIBUTING.md for additional guidance. Tool-specific schemas are documented in DOCS/TOOLS.md, and MLflow/*Lab examples live in DOCS/INTEGRATIONS.md.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。