SC

sailay1996/cursor-agent-mcp

Developer tools

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기

21 stars 7 forks 품질 59 트렌드 0

Cursor-agent MCP: 비용 효율적인 재포 분석 및 Claude Code 내부 편집.

개요

Minimal, 경화 모델 Context Protocol (MCP) 서버는 커서 시약 CLI를 감싸고 채팅, 저장소 분석, 코드 검색, 계획 등을 위한 Claude-friendly 도구를 노출시킵니다. 핵심 구현: 커서 시약 mcp/server.js 테스트 하네스: 커서 시약 mcp/test client.mjs 꾸러미: 커서 시약 mcp/package.json 이 MCP는 cursor-agent CLI에 호스트 (e.g., Claude Code)에서 "Thinking"및 repo-aware 작업을 오프로드 할 수 있습니다. CLI 핸들 분석/계획/연구를 집중적으로 분석하여, 신속한 기반 지침을 제공합니다. - 전체 작업 공간 스트리밍 대신 필요한 파일/경로만 작업합니다. - 환경 (또는 전화 당)을 통해 비용 효율적인 모델을 선택하고 호스트의 컨텍스트를 작게 유지합니다. - output format ("text" | "markdown" | "json") 및 tailored prompt를 통한 응답 동등. - 일반 채팅보다 타겟 출력을 생성하는 전문 도구 (analyze, search, plan, edit)를 사용합니다.

개요(AI 번역)

Minimal, 경화 된 모델 Context Protocol (MCP) 서버는 cursor-agent] CLI를 감싸고 채팅, 저장소 분석, 코드 검색, 계획 등을 위해 여러 가지 Claude-friendly 도구를 노출합니다.

핵심 구현: 커서 시약 mcp/server.js 테스트 하네스: 커서 시약 mcp/test client.mjs 꾸러미: 커서 시약 mcp/package.json

목적: 토큰 사용량을 줄이고 Claude Code의 비용 절감

이 MCP는 호스트 (예 : Claude Code)에서 cursor-agent CLI에 무거운 "Thinking"및 repo-aware 작업을 오프로드 할 수 있습니다. CLI 핸들 분석/계획/연구를 집중적으로 분석하여, 신속한 기반 지침을 제공합니다.

  • 전체 작업 공간 스트리밍 대신 필요한 파일/경로만 작업합니다.
  • 환경 (또는 전화 당)을 통해 비용 효율적인 모델을 선택하고 호스트의 컨텍스트를 작게 유지합니다.
  • output_format (“text” | “markdown” | “json”) 및 tailored prompt를 통해 응답 동등.
  • 전문 도구 (analyze], search], plan], edit]]]) 일반 채팅보다 대상 출력을 생성한다.

비용 제어 팁

  • 정확한 범위:
  • include]/exclude] cursor_agent_search_repo]]와 paths]을 cursor_agent_analyze_files]에 대입한다.

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.

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/exclude globs with cursor_agent_search_repo and curated paths for cursor_agent_analyze_files.
  • Pick output formats intentionally:
    • Use "text" or "markdown" for concise answers. Reserve "json" only when you truly need structured output (it’s usually larger).
  • Select a model that matches the task:
    • Set CURSOR_AGENT_MODEL to a cost‑effective default; override per tool call only when necessary.
  • Avoid unnecessary echo/debug:
    • CURSOR_AGENT_ECHO_PROMPT=1 is helpful during setup, but disables it later to save tokens in host logs.
    • Keep DEBUG_CURSOR_MCP off 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 with CURSOR_AGENT_TIMEOUT_MS and focused prompts.
  • Use cursor_agent_raw thoughtfully:
    • It’s powerful and can stream detailed sessions; for cheapest usage, prefer the focused tools with concise prompts and "text" output.

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-agent CLI in your PATH or at an explicit location
  • Provider credentials configured for your chosen model (e.g., via the CLI’s own mechanism)

Installation

  1. Clone or download this repository.

  2. Install dependencies for the MCP server:

cd ./cursor-agent-mcp
npm ci        # or: npm install
GitHub에서 전체 README 보기

설치

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" } } } }