cursor-relay-mcp
cursor-relay-mcp
公式の @cursor/sdk 上に構築されたローカル MCP サーバーです。MCP クライアントが、明示的に選択した Cursor モデルに制限付きタスクを委任できるようにし、永続的で再起動しても安全な実行状態を維持します。
@cursor/sdk はパブリックベータです。このパッケージは正確に 1.0.28 に固定され、SDK エクスポート契約テストを含みます。完全なガイドは README.zh-CN.md を参照してください。
Windows でのテスト済み Codex Desktop インストールワークフロー(個人用マーケットプレイスのレイアウト、CLI フォールバック、サンドボックス互換性、キャッシュ更新、Grok 4.6 スモークテストを含む)については、CODEX_INSTALL.zh-CN.md を参照してください。
クイックスタート
要件: Git、Node.js >=22.13、Cursor アカウント。推奨される認証方法は、公式の Cursor.auth.login() による保存済みログインです。
git clone https://github.com/tonytanglab/cursor-relay-mcp.git
cd cursor-relay-mcp
npm install
# Opens the system default browser and stores an official SDK login for this OS user.
node --input-type=module --eval 'import { Cursor } from "@cursor/sdk"; await Cursor.auth.login({ apiKeyName: "cursor-relay-mcp" })'
npm run build
$env:CURSOR_RELAY_WORKSPACE_ROOTS = "D:\app\git"
node .\dist\index.jsMCP サーバーを起動する各コンピューターと OS ユーザーアカウントで、ログインを一度実行してください。公式 SDK はシステムのデフォルトブラウザを開き、名前付きで有効期限付きで失効可能な API キーを発行し、公式の資格情報ストアに保存します。リレーはキー値を読み取ったり返したりすることはありません。資格情報を公開せずにログインを確認するには:
node --input-type=module --eval 'import { Cursor } from "@cursor/sdk"; console.log((await Cursor.auth.status()).status)'logged-in は、MCP プロセスが保存済みログインを使用できることを意味します。CURSOR_API_KEY は自動化のためのオプションの代替手段ですが、.mcp.json、シェル履歴、ログ、リポジトリには入れないでください。保存済みログインを使用する場合は、CURSOR_API_KEY を空文字列に設定するのではなく、完全に省略してください。
通常のツールフローは、doctor → list_models → start_run → terminal=true になるまで wait_run を繰り返す、という流れです。実行は冪等で、永続化され、合計タイムアウトで制限され、プロセス再起動後も回復可能です。
セキュリティのデフォルトはフェイルクローズです。無人実行には静的ワークスペース許可リストが必要です。ユーザーが現在の会話でワークスペースに対して Cursor Relay を明示的に承認した場合、authorize_workspace は read-only のみの 5 分間有効な単回使用の正確なタスク能力を発行できます。トークンは永続化されず、実際のパス、タスク、冪等性キー、および利用可能な場合は MCP タスク/セッションにバインドされます。それ以外の権限はデフォルトで読み取り専用になり、Cursor サンドボックスはサポートされている非 Windows ホストではデフォルトで有効になり、プロジェクト設定のみが読み込まれます。Windows では、現在のローカルランタイムがサポートされていないと報告するため、SDK サンドボックスはデフォルトでオフになります。読み取り専用ツールの許可リストは引き続き適用されます。workspace-write には依然として静的許可リストが必要です。danger-full-access には、サーバー起動時の CURSOR_RELAY_ENABLE_DANGER_FULL_ACCESS=true とリクエスト時の confirmedDangerousPermission=true の両方が必要です。通常の使用ではサーバースイッチはオフのままにしてください。
CURSOR_RELAY_READ_ONLY_SANDBOX_ENABLED は、サポートされている非 Windows ホストでサンドボックスを明示的に無効にできます。Windows では、現在の Cursor SDK ローカルランタイムがそのサンドボックスパスをサポートしていないため、この設定は常にオフに固定されます。このスイッチは read-only プリセットにのみ適用され、その公開ツール許可リストは read、grep、glob、ls に制限されたままです。workspace-write には依然として SDK サンドボックスのサポートが必要です。
CURSOR_RELAY_SETTING_SOURCES は、公開されている project、team、mdm の設定レイヤーに制限された、オプションのカンマ区切りリストです。デフォルトは project です。user、plugins、all は、環境的または再帰的な MCP 動作を避けるために意図的に拒否されます。
実行サマリーはストリーミングイベントを省略し、eventCount を報告します。イベントページには read_events を使用してください。8 KiB を超えるイベントデータは、明示的な切り捨てメタデータに置き換えられます。編集は機密フィールド名に基づいており、一般的なシークレットスキャナーではないため、プライベートな状態ディレクトリを使用し、プロンプトにシークレットを含めないでください。
リレーは、固定された SDK の公開エクスポートのみを使用します: モデル検出、Agent.create/resume/listRuns/getRun、Run.stream/wait/cancel、および公式の認証ステータス。Cursor IDE の状態やプライベートエンドポイントを検査しません。ローカル SDK 実行のために Cursor IDE を再起動する必要はありません。
Related MCP server: mcp-job-queue
検証
npm run format:check
npm run lint
npm run typecheck
npm test
npm run build
npm run test:mcp
npm run check:package
npm run test:sdk-contractデフォルトのテストは、実際の Cursor API を呼び出したり、実際のワークスペースを変更したりしません。
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- FlicenseAqualityBmaintenanceEnables MCP clients to invoke Cursor SDK's agent runtime, run coding agents, list models, and continue conversations.4
- AlicenseAqualityCmaintenanceEnables MCP clients to submit long-running jobs that are executed safely in isolated child processes with a durable SQLite queue, configurable timeouts, retries with backoff, and backpressure.5MIT
- AlicenseNot gradedqualityCmaintenanceEnables running and managing automated tasks with retry loops and machine-checkable success criteria via MCP tools.5MIT
- AlicenseDqualityCmaintenanceProvides MCP tools and hooks for agent coordination within Cursor workspaces, enabling claim-based scope management, compliance auditing, and production readiness checks.4MIT
Related MCP Connectors
Reliable async execution for agent tool calls: schema gating, retries, idempotency, audit trail.
Control plane for autonomous software labor. Agents claim objectives over MCP with audit trail.
Remote MCP for A2A failure replay MCP, structured receipts, audit logs, and reviewer-ready evidence.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/tonytanglab/cursor-relay-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server