
sailay1996/cursor-agent-mcp
Developer toolsЭта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал
Курсор-агент MCP: экономичный анализ и редактирование в Claude Code.
Обзор
Минимальный, закаленный сервер Model Context Protocol (MCP), который оборачивает CLI-агент курсора и предоставляет несколько удобных для Клода инструментов для чата, анализа репозитория, поиска кода, планирования и многого другого. Основная реализация: cursor-agent-mcp/server.js Тестовый ремень: cursor-agent-mcp/test client.mjs Манифест пакета: cursor-agent-mcp/package.json Этот MCP существует для разгрузки тяжелых «мыслящих» и репо-знающих задач от хоста (например, Claude Code) до курсора-агента CLI. Позволяя CLI обрабатывать анализ / планирование / поиск с помощью целенаправленных, оперативных инструкций, вы можете: Область работы только для необходимых файлов / путей вместо потоковой передачи всего рабочего пространства. Выберите экономически эффективную модель через среду (или по вызову) и сохраните контекст хоста небольшим. - Вербность контрольного ответа через output format ("текст" | "отметка" | "json") и настраиваемые подсказки. Используйте специализированные инструменты (анализ, поиск, планирование, редактирование), которые производят целевые результаты, а не общий чат.
Обзор (машинный перевод)
Минимальный, закаленный сервер Model Context Protocol (MCP), который обертывает CLI и предоставляет несколько удобных для Клода инструментов для чата, анализа хранилища, поиска кода, планирования и многого другого.
Основная реализация: cursor-agent-mcp/server.js Тестовый ремень: cursor-agent-mcp/test client.mjs Манифест пакета: cursor-agent-mcp/package.json
Цель: сократить использование и стоимость токенов в Claude Code
Этот MCP существует для разгрузки тяжелых «мыслящих» и репо-знающих задач от хоста (например, Claude Code) до CLI cursor-agent. Позволяя CLI обрабатывать анализ / планирование / поиск с помощью целенаправленных, оперативных инструкций, вы можете:
Область работы только для необходимых файлов / путей вместо потоковой передачи всего рабочего пространства. Выберите экономически эффективную модель через среду (или по вызову) и сохраните контекст хоста небольшим.
- Контрольный ответ verbosity через
output_format(“text” | “markdown” | “json”) и индивидуальные подсказки. Используйте специализированные инструментыanalyze,search,plan,edit, которые производят целевые результаты, а не общий чат.
Советы по контролю затрат
Предпочитают точные рамки:
Используйте include/exclude шарики с cursor_agent_search_repo и куратор paths для cursor_agent_analyze_files.
Эта страница переведена автоматически. Технические детали смотрите в оригинале.
README
Показан фрагмент оригинального README. Открыть оригинал.
Cursor Agent MCP Server
Minimal, hardened Model Context Protocol (MCP) server that wraps the cursor-agent CLI and exposes multiple, Claude‑friendly tools for chat, repository analysis, code search, planning, and more.
Core implementation: cursor-agent-mcp/server.js Test harness: cursor-agent-mcp/test_client.mjs Package manifest: cursor-agent-mcp/package.json
Purpose: reduce token usage and cost in Claude Code
This MCP exists to offload heavy “thinking” and repo‑aware tasks from the host (e.g., Claude Code) to the cursor-agent CLI. By letting the CLI handle analysis/planning/search with focused, prompt‑based instructions, you can:
- Scope work to only the needed files/paths instead of streaming the entire workspace.
- Choose a cost‑effective model via environment (or per call) and keep the host’s context small.
- Control response verbosity through
output_format(“text” | “markdown” | “json”) and tailored prompts. - Use specialized tools (
analyze,search,plan,edit) that produce targeted outputs rather than general chat.
Cost‑control tips
- Prefer precise scopes:
- Use
include/excludeglobs withcursor_agent_search_repoand curatedpathsforcursor_agent_analyze_files.
- Use
- Pick output formats intentionally:
- Use
"text"or"markdown"for concise answers. Reserve"json"only when you truly need structured output (it’s usually larger).
- Use
- Select a model that matches the task:
- Set
CURSOR_AGENT_MODELto a cost‑effective default; override per tool call only when necessary.
- Set
- Avoid unnecessary echo/debug:
CURSOR_AGENT_ECHO_PROMPT=1is helpful during setup, but disables it later to save tokens in host logs.- Keep
DEBUG_CURSOR_MCPoff in normal use; it writes diagnostics to stderr (not counted in host tokens, but noisy).
- Control runtime instead of idle‑kill:
- Keep
CURSOR_AGENT_IDLE_EXIT_MS="0"so valid runs aren’t cut mid‑generation. Bound cost/time withCURSOR_AGENT_TIMEOUT_MSand focused prompts.
- Keep
- Use
cursor_agent_rawthoughtfully:- It’s powerful and can stream detailed sessions; for cheapest usage, prefer the focused tools with concise prompts and
"text"output.
- It’s powerful and can stream detailed sessions; for cheapest usage, prefer the focused tools with concise prompts and
Features
- Multi‑tool surface modeled after “verb-centric” CLIs
- Works well in Claude Code and other MCP hosts
- Safe process spawn (no shell), robust timeout handling
- Optional prompt echoing for easy debugging inside hosts
- Configurable defaults via environment variables (model, force, timeouts, executable path)
- Backward‑compatible legacy tool for single‑shot chat
Requirements
- Node.js 18+ (tested up to Node 22)
- A working
cursor-agentCLI in your PATH or at an explicit location - Provider credentials configured for your chosen model (e.g., via the CLI’s own mechanism)
Installation
-
Clone or download this repository.
-
Install dependencies for the MCP server:
cd ./cursor-agent-mcp
npm ci # or: npm install
Установка
This server does not publish a one-line install command.
Open the repository installation guide Новичок в MCP? Начните с руководства на mcpskill.org →Конфигурация
{
"mcpServers": {
"cursor-agent": {
"command": "node",
"args": ["/abs/path/to/cursor-agent-mcp/server.js"],
"env": {
"CURSOR_AGENT_ECHO_PROMPT": "1",
"CURSOR_AGENT_FORCE": "true",
"CURSOR_AGENT_PATH": "/home/you/.local/bin/cursor-agent",
"CURSOR_AGENT_MODEL": "gpt-5",
"CURSOR_AGENT_IDLE_EXIT_MS": "0",
"CURSOR_AGENT_TIMEOUT_MS": "60000"
}
}
}
}