claude-openrouter-delegate-mcp
claude-openrouter-delegate-mcp
Anthropic 기반 Claude Code 세션에서 OpenRouter 기반 Claude Code 세션으로 작업을 위임하세요 — 두 세션이 환경 변수를 공유하지 않아도 됩니다.
Claude Code를 OpenRouter에 연결하려면 ANTHROPIC_* 변수를 셸에 내보내야 합니다. 이러한 변수는 프로세스 전체에 적용되므로 하나의 셸은 "Anthropic" 또는 "OpenRouter" 중 하나만 될 수 있으며, 둘 다는 불가능합니다. 그리고 OpenRouter 키를 담은 내보낸 ANTHROPIC_AUTH_TOKEN은 잘못된 하위 프로세스 하나로 누출될 수 있습니다.
이 MCP 서버는 각 위임 세션을 명시적으로 구성된 환경을 가진 하위 프로세스로 생성합니다. Opus 세션은 자체 자격 증명을 유지하고, 위임 세션은 OpenRouter의 자격 증명을 받습니다. 두 세션은 같은 터미널에서 나란히 실행됩니다.
┌────────────────────────────┐
│ Claude Code (Opus) │ your session, Anthropic credentials
│ │
│ └─ mcp: openrouter ──────┼──▶ spawn: claude -p (fresh env)
└────────────────────────────┘ ANTHROPIC_BASE_URL=https://openrouter.ai/api
ANTHROPIC_AUTH_TOKEN=sk-or-v1-…
→ deepseek/deepseek-v4-flash-0731이것은 claude-ollama-delegate-mcp의 형제 프로젝트로, 로컬 Ollama 서버에 대해 동일한 작업을 수행합니다. 여기서 모든 것을 결정짓는 차이점은 다음과 같습니다: OpenRouter는 실제 비용이 들고 400개 이상의 모델을 제공하므로, 이 패키지는 API 키 경로, 가격이 포함된 모델 카탈로그, 작업별 비용 보고를 추가합니다.
빠른 시작
# 1. an OpenRouter API key: https://openrouter.ai/keys
export OPENROUTER_API_KEY=sk-or-v1-...
# 2. register the server
claude mcp add openrouter --scope user -- npx -y claude-openrouter-delegate-mcp
# 3. restart your Claude Code session그런 다음 평범한 언어로 위임을 요청하세요:
이걸 openrouter로 위임해: src/에 있는 모든 내보낸 심볼 요약해줘
기본적으로 서버는 명시적으로 요청할 때만 위임합니다. 오케스트레이터가 스스로 결정하도록 하려면 위임 모드를 참조하세요.
Related MCP server: opencode-delegate
목차
작동 방식
OpenRouter는 OpenAI 형태의 엔드포인트와 함께 Anthropic 호환 POST /v1/messages 엔드포인트도 제공하므로, Claude Code는 올바른 기본 URL을 가리키면 수정 없이 통신할 수 있습니다. 각 위임 작업은 자체 프로세스에서 claude -p로 실행되며 다음을 포함합니다:
ANTHROPIC_BASE_URL=https://openrouter.ai/api
ANTHROPIC_AUTH_TOKEN=<your OpenRouter key>
ANTHROPIC_DEFAULT_OPUS_MODEL=<model>
ANTHROPIC_DEFAULT_SONNET_MODEL=<model>
ANTHROPIC_DEFAULT_HAIKU_MODEL=<small model>
ANTHROPIC_SMALL_FAST_MODEL=<small model>
CLAUDE_CODE_SUBAGENT_MODEL=<model>
ANTHROPIC_CUSTOM_HEADERS=HTTP-Referer: …⏎X-Title: …
CLAUDE_CODE_MAX_OUTPUT_TOKENS=<clamped per model>기본 URL이 /api에서 끝나는 이유는 Claude Code가 /v1/messages를 자체적으로 추가하기 때문입니다. ANTHROPIC_API_KEY 대신 ANTHROPIC_AUTH_TOKEN이 사용되는 이유는 Authorization: Bearer <key>로 전송되며, 이는 OpenRouter가 기대하는 방식이기 때문입니다.
하위 프로세스 환경은 작은 플랫폼별 허용 목록에서 구성됩니다. ANTHROPIC_*, CLAUDE_*, AWS_*, GOOGLE_*, AZURE_*, OPENAI_*, BEDROCK_*, VERTEX_* 또는 OPENROUTER_*와 일치하는 모든 항목은 OpenRouter 값이 적용되기 전에 제거됩니다. 마지막 접두사는 의도적입니다: 위임 세션은 키를 ANTHROPIC_AUTH_TOKEN으로만 필요로 하므로, 실행 중인 다른 도구가 가져갈 수 있는 이름으로 두 번째 복사본을 받지 않습니다.
위임 세션은 또한 --strict-mcp-config와 MCP 구성 없이 시작되어 시작 속도를 빠르게 유지하고 이 서버를 재귀적으로 호출하는 것을 방지합니다.
선택 사항이 아닌 두 가지 세부 사항
출력 토큰 제한. Claude Code는 모든 요청에서 max_tokens: 32000을 요청합니다. 많은 OpenRouter 모델이 더 낮은 상한을 가지며 — amazon/nova-micro-v1은 5120 허용 — 요청을 완전히 거부합니다. 서버는 카탈로그에서 top_provider.max_completion_tokens을 읽고 CLAUDE_CODE_MAX_OUTPUT_TOKENS을 선택한 모델이 실제로 허용하는 값으로 고정합니다.
도구 호출은 필수입니다. Claude Code는 모든 요청에서 전체 도구 스키마가 포함된 약 110KB 본문을 보냅니다. 도구를 호출할 수 없는 모델은 비용을 지불한 후 첫 턴에서 실패합니다. 서버는 카탈로그의 supported_parameters를 사용하여 이러한 모델을 사전에 거부합니다.
사전 요구 사항
요구 사항 | 참고 사항 |
Node.js 20+ |
|
OpenRouter 계정 | openrouter.ai/keys. 크레딧이 충전되어 있어야 합니다. |
Claude Code CLI | claude.com/code. |
node --version
claude --version
curl -s -H "Authorization: Bearer $OPENROUTER_API_KEY" \
https://openrouter.ai/api/v1/credits # {"data":{"total_credits":…}}설치
npm에서 (권장)
claude mcp add openrouter --scope user \
--env OPENROUTER_API_KEY=sk-or-v1-... \
-- npx -y claude-openrouter-delegate-mcp또는 전역으로 설치하면 설정 CLI도 PATH에 추가됩니다:
npm install -g claude-openrouter-delegate-mcp
openrouter-mcp-config --api-key sk-or-v1-...
claude mcp add openrouter --scope user -- claude-openrouter-delegate-mcp소스에서
git clone https://github.com/histonedev/claude-openrouter-delegate-mcp.git
cd claude-openrouter-delegate-mcp
npm install # builds automatically via the prepare script
claude mcp add openrouter --scope user -- node "$(pwd)/dist/index.js"설정 CLI를 node dist/cli.js …로 실행하거나, npm link로 openrouter-mcp-config를 PATH에 추가하세요.
확인
claude mcp list # openrouter: ... - ✔ Connected그런 다음 Claude Code 세션을 다시 시작하세요 — 도구 목록은 시작 시 읽힙니다.
API 키
다음 중 먼저 설정된 것에서 해석됩니다:
OPENROUTER_API_KEY(최우선 — 나머지 생태계가 사용하는 이름)OPENROUTER_MCP_API_KEY구성 파일의
apiKeyFile— 키가 포함된 파일의 경로구성 파일의
apiKey
openrouter-mcp-config --api-key sk-or-v1-... # writes ~/.openrouter-mcp/config.json, mode 0600
openrouter-mcp-config --api-key-file ~/.secrets/or # or keep it somewhere else entirely키는 MCP 도구를 통해 노출되지 않습니다. openrouter_models는 sk-or-v1-a...7f2e로 보고하고, CLI는 동일한 마스킹된 형태를 출력하며, 구성 파일은 0600 권한으로 작성됩니다. --api-key --scope project로 전달된 키는 사용자 구성으로 리디렉션됩니다. 프로젝트 구성은 커밋되기 때문입니다.
디스크에 키를 전혀 두지 않으려면 MCP 등록 시 --env OPENROUTER_API_KEY=…로 고정하고 구성 파일을 건너뛰세요.
구성
설정은 네 계층에서 해석되며, 나중 것이 먼저 것을 덮어씁니다:
기본 제공 기본값
사용자 구성 —
~/.openrouter-mcp/config.json($OPENROUTER_MCP_CONFIG로 재정의)프로젝트 구성 — 서버 작업 디렉토리의
./openrouter-mcp.config.json환경 변수
{
"delegationMode": "ondemand",
"defaultModel": "deepseek/deepseek-v4-flash-0731",
"smallModel": "google/gemini-3.7-flash",
"allowedModels": ["deepseek/deepseek-v4-flash-0731", "qwen/qwen3.7-flash"],
"defaultPermissionMode": "auto",
"maxOutputTokens": 16000,
"requireToolSupport": true
}설정 | 환경 변수 | 기본값 | 의미 |
|
|
| 위임이 얼마나 적극적으로 사용되는지 |
|
| — | OpenRouter 키 |
|
|
| 호출에서 모델을 생략할 때의 모델 |
|
|
| 위임 세션의 백그라운드/유틸리티 슬롯용 모델 |
|
|
| 위임에 사용할 수 있는 모델 |
|
|
| 위임 세션의 권한 모드 |
|
|
| 상한, 모델별로 다시 제한됨 |
|
|
| 도구를 호출할 수 없는 모델 거부 |
|
|
| 엔드포인트 (프록시가 있으면 가리키세요) |
|
| 이 저장소 |
|
|
|
| Claude Code CLI 경로 |
|
|
| 프롬프트, 대화 기록, 결과 |
|
|
| 한 턴의 하드 종료 |
|
|
| 이 이상의 출력은 잘림; 전체 텍스트는 디스크에 |
설정 변경
설정은 모델이 아닌 터미널에서 변경됩니다:
openrouter-mcp-config # show current settings + active layers
openrouter-mcp-config --mode auto # off | ondemand | auto
openrouter-mcp-config --default-model qwen/qwen3.7-flash
openrouter-mcp-config --small-model google/gemini-3.7-flash
openrouter-mcp-config --allow deepseek/deepseek-v4-flash-0731,qwen/qwen3.7-flash
openrouter-mcp-config --permission-mode acceptEdits
openrouter-mcp-config --scope project # write ./openrouter-mcp.config.json그런 다음 Claude Code 세션을 다시 시작하세요 — 서버가 구성을 다시 읽도록.
의도적으로 이에 대한 MCP 도구는 없습니다. 보안 모델을 참조하세요.
위임 모드
이것은 오케스트레이터가 위임을 얼마나 적극적으로 사용하는지를 제어하며, 모델이 실제로 읽는 도구 설명을 다시 작성합니다. 변경하려면 세션 재시작이 필요합니다. 설계상 그렇습니다.
모드 | 효과 |
|
|
| 명시적으로 요청할 때만 위임 — "이거 위임해", "openrouter 사용해", "deepseek에게 물어봐". |
| 오케스트레이터가 스스로 결정하며, 설명에 내장된 기준을 사용합니다. |
두 모드 모두 명시적 비용 경고를 포함합니다. 로컬 모델과 달리 모든 위임 턴이 청구되고 모든 요청이 수만 개의 입력 토큰을 전달하기 때문입니다.
모델 선택
OpenRouter는 400개 이상의 모델을 제공합니다. openrouter_models는 도구 호출 가능 모델로 필터링하고 기본적으로 잘라냅니다. 전체 카탈로그를 오케스트레이터의 컨텍스트에 덤프하는 것 자체가 비용이 들기 때문입니다.
openrouter_models({ filter: "gemini", limit: 10 })
openrouter_models({ free_only: true })기본값은 deepseek/deepseek-v4-flash-0731입니다: 도구 호출 가능, 1.3M 컨텍스트, 저렴함. allowedModels를 설정하여 신뢰하는 짧은 목록으로 위임을 고정하세요 — 허용된 집합은 delegate_start 설명에 포함되어 오케스트레이터가 추가 호출 없이 메뉴를 알 수 있으며, 다른 모델은 조용히 대체되지 않고 이름으로 거부됩니다.
모델 품질은 다양하며, 이는 관리해야 할 문제입니다
이것들은 Claude 모델이 아니며, Claude Code는 채팅 UI보다 모델에 더 많이 의존합니다. 이 패키지를 빌드하는 동안 실제 실행에서 관찰된 것:
모델이 도구를 올바르게 호출한 다음 최종 텍스트를 반환하지 않을 수 있습니다. 작업은 수행되었지만 마무리 메시지가 없었습니다. 서버는 이를 감지하고 빈 결과 대신 기록된 활동 추적을 반환합니다.
모델이 자체 네이티브 도구 호출 마크업을 일반 텍스트로 출력할 수 있습니다 — DeepSeek가 추론 블록 내부에서
<|DSML|tool_calls>를 생성 — 구조화된 도구 호출 대신. 아무것도 실행되지 않고 토큰은 여전히 청구됩니다. 더 길고 복잡한 프롬프트는 이 문제를 더 가능하게 만듭니다.완료된 작업의
tool calls: 0주석은 고전적인 실패를 위한 것입니다: 도구 호출로 뒷받침되지 않는 저장소에 대한 자신 있는 답변.
약한 모델에는 짧고 단일 목적의 프롬프트를 선호하고, max_turns로 작업을 제한하며, 주장이 중요할 때 delegate_status를 확인하세요.
비용
모든 완료된 작업은 비용을 보고하며, 라벨은 얼마나 신뢰할 수 있는지 알려줍니다:
cost: $0.00045 (billed by OpenRouter, 1 generation(s))
cost: >=$0.00045 (billed so far -- 1 of 2 generations recorded)
cost: $0.00924 (rough list-price estimate; actual routing may differ several-fold)OpenRouter는 생성 ID를 Anthropic 메시지 ID로 반환하므로, 서버는 이를 수집하여 각 요청의 실제 비용을 /v1/generation에 조회합니다. 그것이 권위 있는 숫자입니다. 청구 기록은 생성이 끝난 직후에 기록되므로, 작업이 잠시 부분 합계를 보고할 수 있습니다 — >=로 표시되며, 최종 수치로는 절대 표시되지 않습니다. 비용 표시가 틀리면 안 되는 방향은 아래쪽이기 때문입니다.
추정치는 레코드를 가져올 수 없을 때의 폴백입니다. 그것은 단지 규모(오더 오브 매그니튜드)로만 취급하세요: 테스트에서 동일 모델의 동일 토큰 수가 공급자 라우팅과 캐시 히트에 따라 열 배 차이로 청구되었고, 목록 가격 산술은 한 실행에서 20배 높게 나왔습니다.
토큰 수에 대해 알아둘 만한 두 가지:
Claude Code는 프롬프트의 거의 전체를
input_tokens가 아닌cache_creation_input_tokens로 보고합니다.tokens: in …줄은 모든 입력 클래스를 합산합니다. "12 input tokens"처럼 보이는 작업은 실제로 ~42,000입니다.OpenRouter는 캐시를 존중하지 않는 공급자로 라우팅하는 경우가 많으므로(
native_tokens_cached: 0), 재개된 대화는 캐시 읽기 수치가 시사하는 것만큼 저렴하지 않습니다.
비용 절감. smallModel이 가장 큰 레버입니다: Claude Code의 haiku 슬롯은 백그라운드 유틸리티 호출을 처리하며, 메인 모델은 유능하게 유지하면서 저렴한 모델을 가리키는 것은 품질 면에서 거의 손해가 없습니다. 그 다음으로: max_turns는 에이전틱 루프를 제한하고, allowed_tools는 델리게이트가 작업에 필요한 것보다 더 많은 저장소를 탐색하는 것을 막습니다.
도구 참조
도구 | 용도 |
| 가격과 컨텍스트 창이 포함된 모델 목록, 설정 및 크레딧 잔액 조회(읽기 전용) |
| 작업 시작; |
| 동일 세션에 다른 메시지 전송 |
| 상태 폴링 및 델리게이트의 도구 호출 꼬리 부분 |
| 최종 출력 수집 |
| 실행 중인 델리게이트와 그것이 시작한 모든 것을 종료 |
| 대화별로 그룹화된 작업 목록, 총 지출 포함 |
delegate_start
매개변수 | 유형 | 참고 |
| string | 작업. |
| string | 프롬프트를 담은 파일 경로. 길 때 선호됩니다. |
| string | OpenRouter ID, 예: |
| string | 이 호출에 대한 백그라운드/유틸리티 모델 재정의. |
| string | 델리게이트의 작업 디렉터리. |
| enum |
|
| string[] | 예: |
| string[] | 예: |
| string | 델리게이트를 위한 추가 지시사항 |
| number | 델리게이트의 에이전틱 턴 수 제한 — 비용 상한이기도 함 |
| string[] | 추가로 접근 가능한 디렉터리 |
| number | 최대 N초 동안 블록(0–600). 기본값 0 = 즉시 반환. |
delegate_followup은 job_id 또는 session_id를 받으며, 동일한 prompt/prompt_file 쌍과 선택적 permission_mode, max_turns, wait_seconds를 받습니다.
운영 방법
기본적으로 비동기
delegate_start는 밀리초 단위로 job_id를 반환하며, 델리게이트는 백그라운드에서 계속 실행됩니다. 이렇게 하면 긴 작업이 세션을 지연시키거나 MCP 클라이언트 타임아웃에 걸리는 것을 방지합니다 — 대부분의 클라이언트는 단일 요청을 60초 후에 포기하는데, 이는 많은 위임 작업이 걸리는 시간보다 짧습니다.
delegate_start({ prompt: "Audit src/ for unused exports" })
→ job_id A, session_id S, turn 1, state: running
delegate_status({ job_id: "A" })
→ recent activity:
[tool] Grep: export
[tool] Read: /repo/src/index.ts
delegate_result({ job_id: "A" })
→ the final text이 중 아무 것이나 wait_seconds를 전달하면 대신 블록합니다 — 짧은 작업에 유용하지만, 클라이언트의 요청 타임아웃보다 낮게 유지하세요.
양방향 대화
모든 작업에는 session_id가 있습니다. job_id를 delegate_followup에 전달하면 전체 기록으로 세션을 재개합니다. session_id는 턴을 거쳐도 안정적으로 유지되며, 각 턴은 새로운 job_id를 받습니다.
delegate_start({ prompt: "Summarise the auth flow in this repo" })
→ job A, session S, turn 1
delegate_followup({ job_id: "A", prompt: "Now list every place it can fail" })
→ job B, session S, turn 2 (delegate still remembers turn 1)재개는 대화를 입력 토큰으로 재생하므로, 긴 스레드는 새 스레드보다 턴당 비용이 더 듭니다 — 하지만 동일한 컨텍스트를 다시 구축하는 것보다는 훨씬 저렴합니다.
긴 프롬프트
모든 프롬프트 매개변수에는 prompt_file 대응이 있습니다. 내부적으로 프롬프트는 항상 디스크에 기록되고 stdin을 통해 CLI에 전달됩니다 — argv 항목으로도, 셸을 통해서도 절대 전달되지 않습니다. 백틱, $(...), 따옴표, 줄바꿈 및 glob 문자는 그대로 전달되며, argv 길이 제한도 없습니다.
권한
// read-only review
delegate_start({ prompt: "...", disallowed_tools: ["Write", "Edit", "NotebookEdit"] })
// tightly scoped
delegate_start({ prompt: "...", allowed_tools: ["Read", "Grep", "Glob"] })취소
delegate_cancel({ job_id: "A" })델리게이트 및 그것이 시작한 모든 것을 종료하고, 더 이상 크레딧을 소비하지 않게 합니다. 서버는 또한 종료 시 실행 중인 델리게이트를 종료합니다.
작업 아티팩트
각 작업은 ~/.openrouter-mcp/jobs/<job_id>/에 기록합니다:
파일 | 내용 |
| 전송된 정확한 내용 |
| 모든 도구 호출과 도구 결과를 포함한 전체 |
| 메타데이터: 상태, 모델, 토큰, 비용, 생성 ID, 타이밍, 종료 코드 |
| 최종 출력 텍스트 |
델리게이트의 요약이 설득력 없을 때 stream.jsonl을 보세요: 모델의 설명이 아닌 실제 도구 결과가 들어 있습니다. 자동으로 정리되는 것은 없습니다 — 원할 때 언제든지 디렉터리를 삭제하세요.
문제 해결
No OpenRouter API key configured
OPENROUTER_API_KEY를 설정하거나 openrouter-mcp-config --api-key sk-or-v1-...를 실행한 후 세션을 다시 시작하세요.
OpenRouter rejected the API key (HTTP 401)
openrouter.ai/keys에서 확인하세요. 키는 서버 시작 시 읽히므로, 새 키는 세션 재시작이 필요합니다.
Model "x" does not support tool calling
의도된 동작입니다 — Claude Code는 모든 요청에 도구 스키마를 보냅니다. 다른 모델을 선택하거나, 그래도 시도하려면 requireToolSupport: false를 설정하세요.
Model "x" is not in the allowed list
의도된 동작입니다. openrouter-mcp-config --allow <models>를 실행한 후 다시 시작하세요.
델리게이트가 텍스트를 반환하지 않거나 도구 호출이 아무것도 하지 않음
연결 문제가 아닌 모델 품질 문제입니다 — 모델 품질은 다양하며 그것은 당신이 관리할 문제입니다를 참조하세요. 더 짧은 프롬프트나 더 강력한 모델을 시도하고, stream.jsonl을 읽어 실제로 무슨 일이 있었는지 확인하세요.
MCP 클라이언트에서 Request timed out
wait_seconds가 클라이언트의 요청별 타임아웃(종종 60초)을 초과했습니다. 그것을 제거하고 대신 delegate_status로 폴링하세요 — 그것이 비동기 설계의 목적입니다.
max_tokens에 관한 HTTP 400
모델의 출력 상한이 요청된 값보다 낮습니다. 서버는 카탈로그의 값으로 자동으로 클램프합니다. 카탈로그가 잘못된 경우 maxOutputTokens를 낮추세요.
도구가 Claude Code에 나타나지 않음
도구 목록은 세션 시작 시 읽힙니다. 다시 시작하거나 claude mcp list를 확인하세요.
델리게이트가 시작 오류로 즉시 실패
CLI를 찾을 수 없습니다. OPENROUTER_MCP_CLAUDE_BIN을 claude의 절대 경로로 설정하세요.
플랫폼 지원
플랫폼 | 상태 |
Windows | 종단 간 테스트 완료 |
macOS | 지원됨; Linux와 동일한 POSIX 코드 경로 |
Linux | 지원됨 |
플랫폼 차이는 src/platform.ts에 격리되어 있습니다:
바이너리 해석. POSIX에서 spawn은 PATH를 검색합니다. Windows에서 네이티브 설치 시 claude.exe가 제공되고 npm 설치 시 claude.cmd가 제공되는데, CreateProcess는 이를 직접 실행할 수 없습니다 — 따라서 서버는 PATH × PATHEXT를 탐색하여 .exe를 우선하고, .cmd 셤을 cmd.exe를 통해 라우팅하는 폴백을 사용합니다.
인자 이스케이프. 해당 폴백은 두 계층을 적용합니다: MSVCRT argv 따옴표 처리, 그 다음 cmd 자체 메타문자(& | < > ^ " ( ) % !)에 대한 캐럿 이스케이프. 두 번째 계층을 건너뛰는 것이 고전적인 .cmd 명령 주입 구멍입니다. 프롬프트는 이 경로를 거치지 않습니다 — stdin으로 전달됩니다. 한 가지 제한: 여러 줄 append_system_prompt는 cmd.exe 명령줄을 넘을 수 없으므로, 서버는 조용히 망가뜨리는 대신 OPENROUTER_MCP_CLAUDE_BIN을 가리키는 명확한 오류를 발생시킵니다.
환경 허용 목록. Windows는 POSIX보다 훨씬 큰 집합을 보존합니다. SystemRoot와 windir은 선택 사항이 아닙니다 — 이를 제거하면 Winsock이 초기화에 실패하여 자식 프로세스가 소켓을 전혀 열 수 없습니다.
취소. POSIX 자식 프로세스는 프로세스 그룹 리더로 detached 생성되고 process.kill(-pid)로 취소됩니다. Windows는 taskkill /T /F를 사용합니다.
보안 모델
자격 증명 격리가 핵심입니다. 자식 환경은 상속이 아닌 처음부터 구성되며, OpenRouter 값이 적용되기 전에 공급자 변수가 제거됩니다. test/env-unit.mjs는 키가 정확히 하나의 변수로 자식에게 도달하고 부모 비밀이 생존하지 않음을 단언합니다. test/e2e.mjs는 부모를 가짜 ANTHROPIC_API_KEY와 실제 ANTHROPIC_BASE_URL=https://api.anthropic.com으로 오염시키고 델리게이트가 둘 다 보지 못함을 확인합니다.
키는 도구를 통해 절대 읽을 수 없습니다. 모든 진단 경로가 이를 마스킹하며, test/readonly.mjs는 어떤 도구 출력과 어떤 CLI 출력에도 키가 포함되지 않음을 단언합니다. 이는 토큰이 리터럴 문자열 ollama인 Ollama 형제 프로젝트보다 여기서 더 중요합니다.
위임 정책은 모델이 수정할 수 없습니다. delegationMode, allowedModels 또는 API 키를 변경할 수 있는 MCP 도구가 없습니다. ondemand가 불편하다고 판단한 모델은 스스로 auto로 전환하여 지출을 시작할 수 없습니다. 설정은 시작 시 한 번 로드되며 런타임에 절대 변경되지 않고, 도구 설명에는 정책이 모델이 변경할 수 있는 것이 아님을 명시합니다.
이것은 가드레일이지 보안 경계가 아닙니다. 셸 접근 권한이 있는 에이전트는 여전히 구성 파일을 편집할 수 있습니다. 도구를 제거함으로써 얻는 것은 그러한 변경이 작업 중간의 조용한 도구 호출 한 번이 아니라 다음 재시작 시에만 적용되는 눈에 보이는 파일 편집이 된다는 것입니다. 완벽하게 하려면 MCP 등록 시 --env로 값을 고정하세요. 이는 구성 파일을 재정의합니다:
claude mcp add openrouter --scope user \
--env OPENROUTER_API_KEY=sk-or-v1-... \
--env OPENROUTER_MCP_DELEGATION_MODE=ondemand \
--env OPENROUTER_MCP_ALLOWED_MODELS=deepseek/deepseek-v4-flash-0731 \
-- node /path/to/claude-openrouter-delegate-mcp/dist/index.js지출은 실제입니다. auto 모드 오케스트레이터가 통제 불능이 되면 당신의 인내심이 아니라 크레딧을 소비합니다. 이 서버에 제공하는 키에 OpenRouter 키 한도를 설정하세요 — 그것은 모델이 반박할 수 없는 상한입니다.
델리게이트는 당신의 파일시스템을 상속합니다. 델리게이트는 당신이 제공한 cwd에서 당신의 사용자로, defaultPermissionMode로 실행됩니다. 위임된 세션은 다른 Claude Code 세션처럼 취급하세요 — 덜 신뢰하는 모델에 작업을 맡길 때 disallowed_tools 또는 읽기 전용 권한 모드를 사용하세요.
개발
npm install # installs and builds
npm run build # tsc
npm run dev # tsc --watch테스트
node test/env-unit.mjs # env isolation, key handling, model slot wiring
node test/pricing-unit.mjs # cost arithmetic, catalog filtering, URL normalisation
node test/quoting.mjs # Windows argv/cmd escaping, incl. an injection probe
node test/killtree-unit.mjs # process-tree termination (cross-platform)
OPENROUTER_API_KEY=... node test/e2e.mjs # full MCP round trip (costs ~$0.01)
OPENROUTER_API_KEY=... node test/async.mjs # async polling, prompt_file, cancel
CFG_PATH=/tmp/c.json CFG_CWD=/tmp node test/readonly.mjs # config is read-only to the modelnpm test는 네트워크가 필요 없는 네 가지 테스트를 실행합니다. 이 테스트는 Windows와 POSIX 모두에서 통과합니다. 프로세스 트리 테스트는 셸 내장 명령이 아닌 node 프로세스로 트리를 구성하므로 POSIX 전용이 아닙니다.
릴리스 게시
npm login # interactive, once per machine
npm version patch # or minor / major -- tags and bumps
npm publish # prepare script builds first
git push --follow-tagsnpm publish는 스크립트나 비대화형 셸이 아닌 실제 터미널에서 실행하세요. WebAuthn/보안 키 2FA를 사용하면 CLI가 브라우저를 열어 챌린지를 완료합니다. TTY가 없으면 그렇게 할 수 없으며, 보안 키가 생성할 수 없는 TOTP 코드를 요구하는 방식으로 대체됩니다(npm error code EOTP). CI에서는 대신 Bypass 2FA 권한이 있는 세분화된 액세스 토큰을 사용하세요.
패키지에는 dist/, README.md, LICENSE만 포함됩니다. publishConfig.access는 public이며, prepare는 패킹 전에 tsc를 실행하므로 오래된 dist/가 게시될 수 없습니다.
구조
파일 | 담당 |
| MCP 서버, 도구 등록 및 핸들러 |
| 계층형 설정 로드, API 키 해석, 마스킹 |
| 시작 시 해석되는 설정 싱글턴 |
| 모드별 도구 설명, 비용 경고 |
| 하위 환경 구성 및 공급자 변수 블록리스트 |
| Windows/POSIX spawn, 인수 이스케이프, 프로세스 트리 종료 |
| 작업 수명 주기, |
| 카탈로그, 가격 책정, 도구 지원 강제, 청구 조회 |
|
|
라이선스
MIT — LICENSE 참조.
Available Tools
7 toolsdelegate_cancelCancel a delegated taskA
Terminate a running delegated session and everything it started. Also stops it spending any more of the user's OpenRouter credits.
| Name | Required | Description | Default |
|---|---|---|---|
| job_id | Yes | The job_id to cancel. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It discloses that the tool terminates 'everything it started' and stops spending credits, which are important behavioral consequences. However, it doesn't mention whether the cancellation is reversible or what happens to already-completed results.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences, front-loaded with the primary action, and includes a key secondary effect (credit spending). No wasted words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (one parameter, no output schema, no annotations), the description is fairly complete. It covers the main action and a critical side effect. It could mention that the job must be running, but that's implied by 'running delegated session'.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema description coverage is 100% for the single parameter 'job_id', which is self-explanatory. The description adds no extra meaning beyond the schema, but since the schema already fully documents the parameter, a baseline of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'Terminate a running delegated session and everything it started.' It uses a specific verb ('Terminate') and resource ('running delegated session'), and distinguishes it from siblings like delegate_start and delegate_status by focusing on cancellation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies when to use it (when a delegated session is running and needs to be stopped), but does not explicitly mention alternatives or when not to use it. It also doesn't clarify that it's for running sessions only, which could be inferred but not stated.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
delegate_followupContinue a delegated conversationA
Send another message to an existing delegated session, resuming its full conversation history. Identify it by job_id (any turn) or session_id. Returns a new job_id for this turn while keeping the same session_id, so you can go back and forth with the delegate.
Note that resuming replays the whole conversation as input tokens, so a long thread costs more per turn than a fresh one -- but still far less than re-establishing the same context from scratch.
Only continue conversations the user asked you to start.
| Name | Required | Description | Default |
|---|---|---|---|
| job_id | No | A job_id from any earlier turn of the conversation. | |
| prompt | No | The next message. Use prompt_file for long prompts. | |
| max_turns | No | Cap the delegate's agentic turns for this turn. | |
| session_id | No | The Claude Code session id, as an alternative to job_id. | |
| prompt_file | No | Path to a file holding the next message. | |
| wait_seconds | No | Block up to this many seconds before returning. | |
| permission_mode | No | Override the permission mode for this turn. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Without annotations, the description carries the burden. It discloses that resuming replays the whole conversation as input tokens and notes cost implications, and clearly states that a new job_id is returned while session_id stays constant. This is transparent behavioral info beyond the basic function.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise: a few sentences, front-loaded with the main purpose and identification methods. Every sentence adds value (usage guidance, cost note, return behavior). No fluff.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool has 7 params, no required, no output schema, no annotations. The description covers the key behaviors (return values, cost, when to use). It doesn't describe error cases or all parameter nuances, but it handles the most important aspects. Slightly better than average for a delegation tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so baseline is 3. The description adds value by explaining how job_id vs session_id identify the session (any turn or session_id), and advises using prompt_file for long prompts讷. It also implies that wait_seconds and permission_mode are per-turn overrides, though not explicit. Slightly above baseline.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: 'Send another message to an existing delegated session, resuming its full conversation history.' It uses a specific verb (send) and resource (delegated session), and differentiates from siblings like delegate_start by focusing on continuation rather than initiation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly states when to use it: 'Send another message to an existing delegated session' and 'Only continue conversations the user asked you to start,' which sets a clear usage boundary. It also explains the alternative of starting fresh (and cost trade-offs), and mentions using prompt_file for long prompts, giving practical guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
delegate_listList delegated tasksA
Show delegated jobs from this server's lifetime, newest first, grouped by conversation, with the estimated total spend.
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum jobs to list. Default 20. | |
| state | No | Filter by state. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden of behavioral disclosure. It transparently mentions key behaviors: shows jobs from the server's lifetime (all historical jobs), orders newest first, groups by conversation, and includes estimated total spend. This goes beyond a generic 'list' by specifying output structure and a calculated metric, providing useful expectations for the agent.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Single, information-dense sentence that covers purpose, ordering, grouping, and an output summary metric. No wasted words; it front-loads the primary function and key behavioral details.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool is a simple list operation with two optional parameters well-described in the schema. The description adds value by specifying sort order, grouping, and the spend estimate, which are not in the schema. It lacks information about pagination or default limits, but the schema covers the limit parameter. Overall, sufficient for the tool's simplicity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema has 100% coverage with descriptions for both `limit` and `state`. The description itself does not add meaning beyond what the schema provides; the mention of filtering by state is implied by the parameter but not elaborated. Since coverage is complete, the baseline is 3.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose: to show delegated jobs from the server's lifetime, with specific ordering (newest first), grouping (by conversation), and a summary metric (estimated total spend). It uses an action verb ('show') and a resource ('delegated jobs'), and the scope is well-defined, distinguishing it from action-oriented siblings like delegate_start or delegate_cancel.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description conveys that this is a list operation for delegated jobs, which differentiates it from the action-oriented siblings (start, followup, status, result, cancel). However, it does not explicitly state when to use this tool instead of others, such as delegate_status for checking a single job's status, or mention any preconditions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
delegate_resultGet a delegated task's outputA
Return the final text produced by a delegated session, with its token usage, estimated cost and session_id for follow-ups. Blocks until the job finishes if you pass wait_seconds.
| Name | Required | Description | Default |
|---|---|---|---|
| job_id | Yes | The job_id to collect. | |
| wait_seconds | No | Block up to this many seconds for the job to finish. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It explicitly discloses the blocking behavior with wait_seconds and details what is returned (text, token usage, cost, session_id). However, it does not state whether the operation is read-only or what happens if the job is not finished when wait_seconds is not passed, leaving minor behavioral gaps.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two short, dense sentences. The first states the core functionality and return fields, and the second provides the critical blocking behavior. No waste, information is front-loaded, and it is easy to scan.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple two-parameter tool without an output schema, the description covers the essentials: what it returns, the optional blocking behavior, and follow-up information. It does not address failure scenarios or the result when the job is incomplete without wait_seconds, but these are minor gaps given the tool's simplicity.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the schema already fully documents job_id and wait_seconds. The description does not add any extra meaning to the parameters beyond what the schema provides, so the baseline 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly specifies that the tool returns the final text of a delegated session along with token usage, cost, and session ID. It distinguishes itself from siblings like delegate_status (status checks) and delegate_followup (continuations) by focusing on retrieving the completed output, making its purpose unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies when to use it (when you need the final output) and mentions blocking with wait_seconds, but does not explicitly contrast it with alternatives like delegate_status or delegate_followup, nor does it state when not to use it. This is clear context without exclusions.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
delegate_startDelegate a task to an OpenRouter modelA
Start a headless Claude Code session backed by an OpenRouter model and return immediately with a job_id. It runs in its own process with its own environment, so your Anthropic credentials and model settings are untouched. Poll with delegate_status, collect with delegate_result, and continue the conversation with delegate_followup. Pass prompt_file for long prompts.
Default: deepseek/deepseek-v4-flash-0731.
WHEN TO USE -- ON EXPLICIT REQUEST ONLY. Delegation mode is "ondemand". Call this only when the user actually asks for it: "delegate this", "use openrouter", "ask gemini", "run this on a cheaper model", or when they name an OpenRouter model. If the user has not asked for delegation, do the work yourself and do not offer this tool unprompted.
COSTS REAL MONEY. Each delegated turn is billed to the user's OpenRouter credits, and every request carries Claude Code's full system prompt and tool schema (tens of thousands of input tokens), so even a short task is not free. Do not delegate speculatively, do not retry a failed delegation repeatedly without changing something, and prefer one well-specified task over several exploratory ones. Reported costs are estimates from list prices; the authoritative figure is on openrouter.ai/activity.
This policy is set by the user and is not yours to change. If it is getting in the way, say so and let the user run openrouter-mcp-config; do not edit config files to widen it.
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Working directory for the delegated session. Defaults to the server's cwd. | |
| model | No | OpenRouter model id, e.g. "google/gemini-2.5-flash". Must be in the allowed list. | |
| prompt | No | The task for the delegated session. Use prompt_file for long prompts. | |
| add_dirs | No | Additional directories the delegate may access. | |
| max_turns | No | Cap the delegate's agentic turns. Each turn is billed, so this is also a cost cap. | |
| prompt_file | No | Path to a file holding the prompt. Preferred for long or special-character-heavy prompts. | |
| small_model | No | Model for the delegate's background/small-model slot. Defaults to the configured one. | |
| wait_seconds | No | Block up to this many seconds for completion. Default 0. | |
| allowed_tools | No | Tool allowlist, e.g. ['Read','Grep','Bash(git *)']. | |
| permission_mode | No | Permission mode for the delegate. Defaults to the configured default. | |
| disallowed_tools | No | Tool denylist, e.g. ['Write','Edit']. | |
| append_system_prompt | No | Extra instructions appended to the delegate's system prompt. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Although no annotations are provided, the description discloses that it runs in its own process, doesn't touch Anthropic credentials, and prominently warns 'COSTS REAL MONEY' with billing details and token usage. It also notes the async nature (return immediately).
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Well-structured with clear sections (purpose, behavior, when-to-use, cost, policy). Though somewhat verbose, each sentence adds value—warnings about cost and usage are important.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Covers async behavior, cost implications, policy, and references sibling tools (delegate_status, delegate_result). Given the complexity of delegation (cost, permissions, background process), this description is complete enough for an agent to act.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema covers all 12 parameters with descriptions (100% coverage). The description adds minimal extra beyond schema, e.g., 'Pass `prompt_file` for long prompts' which is already implied. Baseline of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Clearly states 'Start a headless Claude Code session backed by an OpenRouter model and return immediately with a job_id.' It distinguishes from sibling tools by outlining the delegation flow (status, result, followup).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly specifies when to use: 'ON EXPLICIT REQUEST ONLY' with concrete examples. Also states 'If the user has not asked for delegation, do the work yourself and do not offer this tool unprompted.' Provides clear alternatives and cost warnings.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
delegate_statusCheck a delegated taskA
Report whether a delegated job is still running, plus a tail of what the session has been doing -- its actual tool calls and partial text. Optionally block until it finishes. Use the tool-call trace to check that a delegate really did the work it claims.
| Name | Required | Description | Default |
|---|---|---|---|
| job_id | Yes | The job_id returned by delegate_start or delegate_followup. | |
| wait_seconds | No | Block up to this many seconds waiting for completion. | |
| progress_limit | No | How many recent activity lines to show. Default 15. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It discloses the reporting behavior (status, tail, blocking) and a verification use case. However, it doesn't state whether checking status has side effects (e.g., marks job as read), how errors are handled, or the return format. It adds useful context but is not exhaustive.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is two sentences, front-loaded with the primary purpose, and contains no redundant or vague wording. It efficiently communicates the tool's function and a key use case.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a status tool with 3 parameters and no output schema, the description covers the essential aspects: status reporting, activity tail, optional blocking, and verification usage. It doesn't detail the return structure, but the description's 'report whether... plus a tail' gives a sufficient mental model. The lack of an explicit non-destructive note is a minor gap.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the baseline is 3. The description's references to blocking and tail map to wait_seconds and progress_limit, but the schema already describes these parameters clearly. No additional meaning is added beyond the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool reports whether a delegated job is still running, provides a tail of tool calls and partial text, and optionally blocks. This distinguishes it from siblings like delegate_result (fetching final result) and delegate_start/delegate_followup/delegate_cancel/delegate_list. Specific verb+resource with unique features.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives a concrete use case: 'Use the tool-call trace to check that a delegate really did the work it claims.' This implies when to use this tool (status/trace verification) and communicates its value over siblings. It doesn't explicitly exclude alternatives or state when not to use, but provides clear context.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
openrouter_modelsList OpenRouter modelsA
List OpenRouter models available for delegation with their prices and context windows, plus the current delegation policy, credit balance, and the environment a delegated session receives. OpenRouter serves several hundred models, so results are filtered to tool-capable ones and truncated -- pass filter to search by name and limit to see more. Use this to pick a model, to check the balance before delegating, or to report the configuration when the user asks about it.
These settings are user-controlled. There is no tool to change them: if the user wants a different delegation mode, model policy, or API key, tell them to run openrouter-mcp-config in a terminal and restart the session. Do not edit the config files yourself.
Default: deepseek/deepseek-v4-flash-0731.
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum models to list. Default 30. | |
| filter | No | Case-insensitive substring match on model id or name, e.g. "gemini" or "qwen". | |
| free_only | No | Only models that cost nothing. | |
| tools_only | No | Only models that support tool calling. Default true; Claude Code needs it. |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden and does so well. It discloses that results are 'filtered to tool-capable ones and truncated,' that filtering is by default active (tools_only), the default model value, and that these settings are user-controlled with no tool to change them, including a 'do not edit config files' safety instruction.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three compact paragraphs, each earning its place: purpose/result orientation, usage guidance with alternatives, and the default model. Front-loaded with the core listing purpose, with no fluff or repetition of schema content.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Despite having no output schema, the description explicitly states what the response contains (prices, context windows, delegation policy, credit balance, environment). It also covers filtering/truncation behavior, parameter hints, defaults, and the limitation that settings cannot be changed via this tool. This is complete for a listing tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the baseline is 3. The description adds value beyond the schema by explaining parameter intent: 'pass `filter` to search by name and `limit` to see more,' and clarifies the default filtering behavior relevant to tools_only. free_only is not mentioned in the description, but the schema already documents it fully.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Description opens with a specific verb+resource: 'List OpenRouter models available for delegation with their prices and context windows, plus the current delegation policy, credit balance, and the environment a delegated session receives.' It goes beyond a simple name by defining scope (delegation) and the exact data returned. It also clearly distinguishes itself from the sibling delegate_* tools as a read-only listing tool.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicit usage guidance is provided: 'Use this to pick a `model`, to check the balance before delegating, or to report the configuration when the user asks about it.' It also gives when-not-to-use and an alternative action: if the user wants config changes, 'tell them to run `openrouter-mcp-config` in a terminal and restart the session. Do not edit the config files yourself.'
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
7 tool updates
v1.0.0- First observed
delegate_cancel - First observed
delegate_followup - First observed
delegate_list - First observed
delegate_result - First observed
delegate_start - First observed
delegate_status - First observed
openrouter_models
TDQS
Scored across 7 tools
Each tool maps to a distinct stage or aspect of the delegation lifecycle: models/config discovery, start, follow-up, status, final result, cancel, and list. The only superficially similar pair (delegate_status vs delegate_result) is clearly separated by monitoring vs collecting final output.
Six of seven tools share the clean delegate_ prefix with a readable action, making the lifecycle easy to scan. Minor deviation: delegate_status, delegate_result, and delegate_followup use nouns rather than verbs, and openrouter_models breaks the prefix pattern.
Seven tools is well-scoped for a delegation server: one discovery/config tool plus six lifecycle operations. Each tool covers a necessary step without redundancy or bloat.
The delegation workflow is fully covered: inspect models/config, start, monitor, collect, resume, cancel, and list jobs. Deliberately missing config-editing tools are documented as user-controlled via a separate CLI, so there are no dead ends for the stated purpose.
Maintenance
Related MCP Connectors
The OpenRouter MCP server plugs OpenRouter into the AI tools you already use. Once connected, your assistant can pull live OpenRouter data (models, prices, your credits, rankings, and docs) and send quick test messages, all without leaving your editor.
Launch your clients' products on up to 100 directories each from Claude, ChatGPT, Cursor or VS Code.
Work on your own computers from Claude or ChatGPT: run commands, edit and search files.
AI routing, memory, guardrails, and governance. Routes across Claude, GPT, Gemini.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables Claude Code to delegate tasks to free OpenRouter models as callable tools while keeping the Anthropic endpoint for the orchestrator, with optional sandboxed file and shell access.MIT
- AlicenseNot gradedqualityCmaintenanceEnables Claude Code and Claude Desktop to delegate coding tasks to any model available in OpenCode while Claude remains the orchestrator, planning work, reviewing diffs, and running tests. Supports synchronous and async delegation, model selection, session continuation, and permission-aware execution.6MIT
- AlicenseAqualityBmaintenanceEnables Claude Code to offload bulk tasks to cheap OpenRouter worker models via tiered model selection, parallel batch execution, daily budget caps, and cost logging.3MIT
- AlicenseBqualityCmaintenanceEnables multi-model inference, model discovery, credit monitoring, and API key management through OpenRouter, integrating with Claude Desktop, Cursor, Antigravity, and Windsurf.4MIT