Skip to main content
Glama

cursor-agent-sync-mcp

npm GitHub Packages License: MIT

MCP-сервер, который позволяет Claude Code (или любому другому MCP-клиенту) делегировать выполнение ограниченных задач по написанию кода локальному cursor-agent CLI. Один инструмент — cursor_execute — синхронно запускает cursor-agent -p --output-format json --force, дожидается завершения и возвращает компактный отчёт: текст ответа, git diff --stat, git status --short, код возврата и sessionID.

В отличие от orchestrate-cursor-agent-mcp (spawn/check/reply/kill через файловый IPC), здесь один вызов тула блокируется до готового результата — не нужно отдельными командами проверять статус и убивать процесс. Ценой этого теряется многотуровый диалог с subagent'ом: задача должна быть полностью самодостаточной.

Требования

  • cursor-agent CLI, установленный и авторизованный (cursor-agent status).

  • Бинарь ищется в PATH; путь можно переопределить переменной CURSOR_BIN.

  • Node.js 18+.

Related MCP server: Cursor Delegate

Установка

Вариант 1 — из npm (рекомендуется)

Пакет опубликован как cursor-agent-sync-mcp — полностью публичный, ставится без авторизации:

npm install -g cursor-agent-sync-mcp

Вариант 2 — из исходников

git clone git@github.com:yuriisamohvalov-creator/cursor-mcp.git ~/tools/cursor-mcp
cd ~/tools/cursor-mcp
npm install

Вариант 3 — из GitHub Packages

Тот же пакет также зеркалирован в GitHub Packages под именем @yuriisamohvalov-creator/cursor-agent-sync-mcp. Важно: в отличие от npmjs.org, GitHub Packages требует аутентификации даже для доступа к пакету (репозиторий приватный) — понадобится .npmrc со scoped-registry и GitHub-токеном с правом read:packages:

# ~/.npmrc или в проекте
echo "@yuriisamohvalov-creator:registry=https://npm.pkg.github.com" >> ~/.npmrc
npm login --registry=https://npm.pkg.github.com --scope=@yuriisamohvalov-creator

npm install -g @yuriisamohvalov-creator/cursor-agent-sync-mcp

Подключение к Claude Code

При установке из npm (npm install -g cursor-agent-sync-mcp) бинарник уже в PATH:

claude mcp add --scope user cursor -- cursor-agent-sync-mcp

При установке из исходников:

NODE_BIN="$(which node)"
claude mcp add --scope user cursor -- "$NODE_BIN" "$HOME/tools/cursor-mcp/server.mjs"

Проверка:

claude mcp get cursor
# Status: ✔ Connected

После подключения новой сессии Claude Code (или рестарта текущей) инструмент доступен как mcp__cursor__cursor_execute.

Использование инструмента

{
  "task": "Add a slugify() helper in src/lib/slug.ts with tests. Acceptance: kebab-case, trims whitespace. Verify with `npm test -- slug`.",
  "cwd": "/absolute/path/to/project",
  "model": "gpt-5",            // опционально
  "timeoutMs": 900000            // опционально, по умолчанию 15 минут
}

Ответ:

{
  "ok": true,
  "exitCode": 0,
  "sessionID": "...",
  "text": "...финальный ответ модели...",
  "diffStat": "...git diff --stat...",
  "statusShort": "...git status --short..."
}

Ограничения

  • Одна задача — один синхронный запуск cursor-agent, без параллелизма в рамках одного вызова инструмента и без уточняющих вопросов в процессе (флаг --force заставляет агента додумывать самому, если чего-то не хватает).

  • Долгая задача блокирует вызывающую сессию на всё время выполнения — контролируйте через timeoutMs.

  • Не подменяет ревью: вызывающая сторона должна самостоятельно проверять diffStat/statusShort, а не доверять только полю ok.

Связанные пакеты

Тот же синхронный паттерн: opencode-v2-mcp, codex-cli-sync-mcp, cline-sync-mcp.

Лицензия

MIT

Available Tools

1 tool
cursor_executeB

Execute one bounded coding task through cursor-agent CLI (synchronous, blocks until done) and return a compact JSON report with diff/status context.

Inputs: cwd (required), task (required), model, resume, +2 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 1 tool

    Disambiguation5/5

    With only a single tool, there is no possibility of overlap or misselection; cursor_execute has one clearly distinct purpose.

    Naming Consistency5/5

    The lone tool follows a clean snake_case verb_noun pattern (cursor_execute), which is readable and predictable even without siblings to compare against.

    Tool Count3/5

    A single tool is thin for a server whose purpose is syncing/executing coding tasks; basic operations like status polling or cancellation are absent, making the surface feel under-scoped.

    Completeness2/5

    Only a synchronous execute operation exists, with no way to query task status, cancel a running task, or list history, so an agent hitting a long-running or stuck task has no recourse.

    Maintenance

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers