Skip to main content
Glama
claude-openrouter-delegate-mcp

claude-openrouter-delegate-mcp

by histonedev

claude-openrouter-delegate-mcp

npm node license

Delega tareas de una sesión de Claude Code respaldada por Anthropic a sesiones de Claude Code respaldadas por OpenRouter, sin que ambas compartan variables de entorno.

Apuntar Claude Code a OpenRouter implica exportar variables ANTHROPIC_* a tu shell. Esas variables son a nivel de proceso, así que un shell es o "Anthropic" o "OpenRouter", nunca ambos — y un ANTHROPIC_AUTH_TOKEN exportado con tu clave de OpenRouter está a un subproceso descuidado de filtrarse.

Este servidor MCP lanza cada sesión delegada como un proceso hijo con un entorno construido explícitamente. Tu sesión Opus conserva sus propias credenciales; el delegado recibe las de OpenRouter. Se ejecutan lado a lado en la misma terminal.

┌────────────────────────────┐
│  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

Este es un hermano de claude-ollama-delegate-mcp, que hace lo mismo para un servidor Ollama local. La diferencia que lo condiciona todo aquí: OpenRouter cuesta dinero real y ofrece más de 400 modelos, así que este paquete añade una ruta de clave de API, un catálogo de modelos con precios y un informe de coste por trabajo.


Inicio rápido

# 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

Luego pide la delegación en lenguaje natural:

delega esto a openrouter: resume cada símbolo exportado en src/

Por defecto el servidor solo delega cuando lo pides explícitamente. Para que el orquestador decida por sí mismo, consulta Modos de delegación.


Related MCP server: opencode-delegate

Contenido


Cómo funciona

OpenRouter expone un endpoint POST /v1/messages compatible con Anthropic junto al suyo con forma de OpenAI, así que Claude Code habla con él sin modificaciones cuando se apunta a la URL base correcta. Cada tarea delegada se ejecuta como claude -p en su propio proceso con:

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>

La URL base termina en /api porque Claude Code añade /v1/messages por su cuenta. Se usa ANTHROPIC_AUTH_TOKEN en lugar de ANTHROPIC_API_KEY porque se envía como Authorization: Bearer <key>, que es el esquema que OpenRouter espera.

El entorno hijo se construye a partir de una pequeña lista de permitidos por plataforma. Cualquier cosa que coincida con ANTHROPIC_*, CLAUDE_*, AWS_*, GOOGLE_*, AZURE_*, OPENAI_*, BEDROCK_*, VERTEX_* u OPENROUTER_* se descarta antes de aplicar los valores de OpenRouter. Ese último prefijo es deliberado: el delegado necesita la clave solo como ANTHROPIC_AUTH_TOKEN, así que nunca recibe una segunda copia bajo un nombre que otras herramientas que ejecute podrían captar.

Los delegados también arrancan con --strict-mcp-config y sin configuración MCP, lo que mantiene su arranque rápido y evita que llamen recursivamente a este servidor.

Dos detalles que no son opcionales

Limitación de tokens de salida. Claude Code pide max_tokens: 32000 en cada petición. Muchos modelos de OpenRouter tienen un tope inferior — amazon/nova-micro-v1 permite 5120 — y rechazan la petición directamente. El servidor lee top_provider.max_completion_tokens del catálogo y fija CLAUDE_CODE_MAX_OUTPUT_TOKENS a lo que el modelo elegido acepta realmente.

La llamada a herramientas es obligatoria. Claude Code envía un cuerpo de ~110 KB con un esquema completo de herramientas en cada petición. Un modelo que no puede llamar a herramientas falla en el primer turno, después de que hayas pagado por él. El servidor rechaza esos modelos de antemano usando el supported_parameters del catálogo.


Requisitos previos

Requisito

Notas

Node.js 20+

node --version. Construido y probado en la 22.

Una cuenta de OpenRouter

openrouter.ai/keys. Los créditos deben estar recargados.

CLI de Claude Code

claude.com/code. claude --version.

node --version
claude --version
curl -s -H "Authorization: Bearer $OPENROUTER_API_KEY" \
  https://openrouter.ai/api/v1/credits      # {"data":{"total_credits":…}}

Instalación

Desde npm (recomendado)

claude mcp add openrouter --scope user \
  --env OPENROUTER_API_KEY=sk-or-v1-... \
  -- npx -y claude-openrouter-delegate-mcp

O instálalo globalmente, lo que también pone el CLI de ajustes en tu 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

Desde el código fuente

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"

Ejecuta el CLI de ajustes como node dist/cli.js …, o usa npm link para tener openrouter-mcp-config en tu PATH.

Confirmación

claude mcp list        # openrouter: ... - ✔ Connected

Luego reinicia tu sesión de Claude Code — la lista de herramientas se lee al arrancar.


La clave de API

Se resuelve de la primera de estas que esté definida:

  1. OPENROUTER_API_KEY (la más alta — el nombre que usa el resto del ecosistema)

  2. OPENROUTER_MCP_API_KEY

  3. apiKeyFile en un archivo de configuración — una ruta a un archivo que contiene la clave

  4. apiKey en un archivo de configuración

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

La clave nunca se expone a través de una herramienta MCP. openrouter_models la reporta como sk-or-v1-a...7f2e, el CLI imprime la misma forma enmascarada y el archivo de configuración se escribe con permisos 0600. Una clave pasada con --api-key --scope project se redirige a la configuración de usuario, porque las configuraciones de proyecto se acaban commitando.

Si prefieres no tener ninguna clave en disco, fíjala en el registro MCP con --env OPENROUTER_API_KEY=… y omite el archivo de configuración.


Configuración

Los ajustes se resuelven desde cuatro capas, ganando las posteriores sobre las anteriores:

  1. valores por defecto integrados

  2. configuración de usuario — ~/.openrouter-mcp/config.json (anulable con $OPENROUTER_MCP_CONFIG)

  3. configuración de proyecto — ./openrouter-mcp.config.json en el directorio de trabajo del servidor

  4. variables de entorno

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

Ajuste

Variable de entorno

Valor por defecto

Significado

delegationMode

OPENROUTER_MCP_DELEGATION_MODE

ondemand

Con qué entusiasmo se usa la delegación

apiKey

OPENROUTER_API_KEY

—

Tu clave de OpenRouter

defaultModel

OPENROUTER_MCP_DEFAULT_MODEL

deepseek/deepseek-v4-flash-0731

Modelo cuando una llamada no indica uno

smallModel

OPENROUTER_MCP_SMALL_MODEL

igual que defaultModel

Modelo para el slot de fondo/utilidad del delegado

allowedModels

OPENROUTER_MCP_ALLOWED_MODELS (separados por comas)

[] (todos)

Modelos que la delegación puede usar

defaultPermissionMode

OPENROUTER_MCP_PERMISSION_MODE

auto

Modo de permisos para los delegados

maxOutputTokens

OPENROUTER_MCP_MAX_OUTPUT_TOKENS

16000

Tope, limitado de nuevo por modelo

requireToolSupport

OPENROUTER_MCP_REQUIRE_TOOL_SUPPORT

true

Rechazar modelos que no pueden llamar a herramientas

baseUrl

OPENROUTER_MCP_BASE_URL

https://openrouter.ai/api

Endpoint (apunta a un proxy si tienes uno)

referer / title

OPENROUTER_MCP_REFERER / _TITLE

este repositorio

Atribución HTTP-Referer / X-Title

claudeBin

OPENROUTER_MCP_CLAUDE_BIN

claude

Ruta al CLI de Claude Code

stateDir

OPENROUTER_MCP_STATE_DIR

~/.openrouter-mcp/jobs

Prompts, transcripciones, resultados

jobTimeoutMs

OPENROUTER_MCP_JOB_TIMEOUT_MS

1800000

Terminación forzosa para un turno

maxInlineChars

OPENROUTER_MCP_MAX_INLINE_CHARS

60000

La salida por encima de esto se trunca; texto completo en disco

Cambiar los ajustes

Los ajustes se cambian desde una terminal, nunca por el modelo:

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

Luego reinicia tu sesión de Claude Code para que el servidor relea su configuración.

Deliberadamente no hay ninguna herramienta MCP para esto. Consulta el Modelo de seguridad.


Modos de delegación

Esto controla con qué entusiasmo el orquestador recurre a la delegación, reescribiendo las descripciones de herramientas que el modelo lee realmente. Cambiarlo requiere reiniciar la sesión, por diseño.

Modo

Efecto

off

Las herramientas delegate_* quedan ocultas por completo. openrouter_models permanece para que el modelo pueda seguir informando de la configuración.

ondemand (por defecto)

Delega solo cuando lo pides explícitamente — "delega esto", "usa openrouter", "pregunta a deepseek".

auto

El orquestador decide por sí mismo, usando criterios integrados en la descripción.

Ambos modos llevan una advertencia de coste explícita, porque a diferencia de un modelo local cada turno delegado se factura y cada petición lleva decenas de miles de tokens de entrada.


Elegir un modelo

OpenRouter sirve más de 400 modelos. openrouter_models filtra a los capaces de usar herramientas y trunca por defecto, ya que volcar todo el catálogo en el contexto del orquestador es caro en sí mismo.

openrouter_models({ filter: "gemini", limit: 10 })
openrouter_models({ free_only: true })

El valor por defecto es deepseek/deepseek-v4-flash-0731: capaz de usar herramientas, 1,3M de contexto y barato. Define allowedModels para fijar la delegación a una lista corta de tu confianza — el conjunto permitido está incrustado en la descripción de delegate_start, así que el orquestador conoce el menú sin una llamada extra, y cualquier otro modelo se rechaza por nombre en lugar de sustituirse silenciosamente.

La calidad de los modelos varía, y eso es problema tuyo

No son modelos Claude, y Claude Code se apoya en el modelo más que una interfaz de chat. Observado mientras se construía este paquete, en ejecuciones reales:

  • Un modelo puede llamar a sus herramientas correctamente y luego no devolver ningún texto final. El trabajo ocurrió; el mensaje de cierre no. El servidor lo detecta y devuelve el rastro de actividad registrado en lugar de un resultado vacío.

  • Un modelo puede emitir su propio marcado nativo de llamada a herramientas como texto plano — DeepSeek produciendo <|DSML|tool_calls> dentro de un bloque de razonamiento — en lugar de una llamada a herramienta estructurada. Nada se ejecuta y los tokens se facturan igualmente. Los prompts más largos y enrevesados hacen esto más probable.

  • La anotación tool calls: 0 en un trabajo terminado está ahí para el fallo clásico: una respuesta segura sobre tu repositorio que ninguna llamada a herramienta respalda.

Prefiere prompts cortos y de un solo propósito para modelos más débiles, limita el trabajo con max_turns y comprueba delegate_status cuando una afirmación importe.


Costes

Cada trabajo terminado reporta un coste, y la etiqueta te dice cuánto puedes fiarte de él:

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 devuelve su id de generación como el id de mensaje de Anthropic, así que el servidor los recopila y pregunta a /v1/generation cuánto costó realmente cada solicitud. Ese es el número autoritativo. Los registros de facturación llegan un momento después de que la generación termina, así que un trabajo puede informar brevemente una suma parcial — mostrada como >=, nunca como cifra final, porque la única dirección en la que una visualización de coste no debe equivocarse es hacia abajo.

La estimación es el recurso de respaldo cuando no se puede obtener un registro. Trátala solo como un orden de magnitud: en las pruebas, recuentos de tokens idénticos en el mismo modelo se facturaron diez veces diferentes según el enrutamiento del proveedor y los aciertos de caché, y la aritmética del precio de lista salió 20× alta en una ejecución.

Dos cosas que vale la pena saber sobre los recuentos de tokens:

  • Claude Code informa casi todo el prompt como cache_creation_input_tokens, no como input_tokens. La línea tokens: in … suma todas las clases de entrada. Un trabajo que parece "12 tokens de entrada" en realidad son ~42.000.

  • OpenRouter enruta a proveedores que a menudo no respetan la caché (native_tokens_cached: 0), así que una conversación reanudada no es tan barata como sugieren las cifras de lectura de caché.

Reduciendo la factura. smallModel es la palanca más potente: el hueco de haiku de Claude Code atiende llamadas de utilidad en segundo plano, y apuntarlo a algo barato mientras el modelo principal sigue siendo capaz apenas cuesta nada en calidad. Después: max_turns limita un bucle agéntico, y allowed_tools impide que un delegado explore más del repositorio de lo que la tarea necesita.


Referencia de herramientas

Herramienta

Propósito

openrouter_models

Lista modelos con precios y ventanas de contexto, informa ajustes y saldo de crédito (solo lectura)

delegate_start

Inicia una tarea; devuelve un job_id inmediatamente

delegate_followup

Envía otro mensaje a la misma sesión

delegate_status

Consulta el estado más una cola de las llamadas a herramientas del delegado

delegate_result

Recopila la salida final

delegate_cancel

Termina un delegado en ejecución y todo lo que haya iniciado

delegate_list

Lista trabajos, agrupados por conversación, con el gasto total

delegate_start

Parámetro

Tipo

Notas

prompt

string

La tarea. Mutuamente excluyente con prompt_file.

prompt_file

string

Ruta a un archivo que contiene el prompt. Preferido cuando es largo.

model

string

Id de OpenRouter, p. ej. google/gemini-3.7-flash. Debe estar en la lista permitida.

small_model

string

Sobrescribe el modelo de fondo/utilidad para esta llamada.

cwd

string

Directorio de trabajo para el delegado.

permission_mode

enum

auto, acceptEdits, bypassPermissions, manual, dontAsk, plan

allowed_tools

string[]

p. ej. ["Read","Grep","Bash(git *)"]

disallowed_tools

string[]

p. ej. ["Write","Edit"]

append_system_prompt

string

Instrucciones adicionales para el delegado

max_turns

number

Limita los turnos agénticos del delegado — también es un límite de coste

add_dirs

string[]

Directorios adicionales accesibles

wait_seconds

number

Bloquea hasta N segundos (0–600). Por defecto 0 = devuelve inmediatamente.

delegate_followup acepta job_id o session_id, además del mismo par prompt/prompt_file y permission_mode, max_turns, wait_seconds opcionales.


Cómo operarlo

Asíncrono por defecto

delegate_start devuelve un job_id en milisegundos; el delegado sigue ejecutándose en segundo plano. Esto evita que una tarea larga bloquee tu sesión o haga saltar el tiempo de espera de un cliente MCP — la mayoría de los clientes abandonan una única solicitud después de 60 segundos, que es menos de lo que tardan muchas tareas delegadas.

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

Pasa wait_seconds en cualquiera de esas para bloquear en su lugar — útil para tareas cortas, pero mantenlo por debajo del tiempo de espera de solicitud de tu cliente.

Conversaciones bidireccionales

Cada trabajo lleva un session_id. Pasar su job_id a delegate_followup reanuda la sesión con el historial completo; el session_id permanece estable entre turnos mientras que cada turno recibe un job_id nuevo.

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)

Reanudar reproduce la conversación como tokens de entrada, así que un hilo largo cuesta más por turno que uno nuevo — pero sigue siendo mucho menos que reconstruir el mismo contexto.

Prompts largos

Cada parámetro de prompt tiene su contraparte prompt_file. Internamente el prompt siempre se escribe en disco y se alimenta a la CLI a través de stdin — nunca como entrada de argv y nunca a través de un shell. Las comillas invertidas, $(...), las comillas, los saltos de línea y los caracteres glob pasan tal cual, y no hay límite de longitud de argv.

Permisos

// read-only review
delegate_start({ prompt: "...", disallowed_tools: ["Write", "Edit", "NotebookEdit"] })

// tightly scoped
delegate_start({ prompt: "...", allowed_tools: ["Read", "Grep", "Glob"] })

Cancelación

delegate_cancel({ job_id: "A" })

Mata al delegado y todo lo que haya iniciado, y detiene que gaste más créditos. El servidor también mata a los delegados en ejecución cuando se apaga.


Artefactos del trabajo

Cada trabajo escribe en ~/.openrouter-mcp/jobs/<job_id>/:

Archivo

Contenido

prompt.txt

Exactamente lo que se envió

stream.jsonl

Transcripción completa de stream-json, incluyendo cada llamada a herramienta y su resultado

result.json

Metadatos: estado, modelo, tokens, coste, ids de generación, tiempos, código de salida

result.txt

Texto de salida final

stream.jsonl es donde mirar cuando el resumen de un delegado no resulta convincente: contiene los resultados reales de las herramientas, no el relato del modelo sobre ellos. Nada se poda automáticamente — borra el directorio cuando quieras.


Solución de problemas

No OpenRouter API key configured Establece OPENROUTER_API_KEY, o openrouter-mcp-config --api-key sk-or-v1-..., y luego reinicia la sesión.

OpenRouter rejected the API key (HTTP 401) Compruébala en openrouter.ai/keys. Ten en cuenta que la clave se lee al iniciar el servidor, así que una clave nueva requiere reiniciar la sesión.

Model "x" does not support tool calling Funciona como se espera — Claude Code envía un esquema de herramientas en cada solicitud. Elige otro modelo, o establece requireToolSupport: false para intentarlo de todos modos.

Model "x" is not in the allowed list Funciona como se espera. Ejecuta openrouter-mcp-config --allow <models> y luego reinicia.

El delegado no devuelve texto, o sus llamadas a herramientas no hacen nada Es un problema de calidad del modelo, no de conexión — consulta La calidad del modelo varía. Prueba con un prompt más corto o un modelo más potente, y lee stream.jsonl para ver qué ocurrió realmente.

Request timed out desde tu cliente MCP wait_seconds superó el tiempo de espera por solicitud del cliente (a menudo 60s). Elimínalo y consulta con delegate_status en su lugar — para eso está el diseño asíncrono.

HTTP 400 sobre max_tokens El límite de salida del modelo está por debajo de lo solicitado. El servidor lo ajusta automáticamente al valor del catálogo; si el catálogo es incorrecto, baja maxOutputTokens.

Las herramientas no aparecen en Claude Code La lista de herramientas se lee al inicio de la sesión. Reinicia, o comprueba claude mcp list.

El delegado falla al instante con un error de lanzamiento No se encontró la CLI. Establece OPENROUTER_MCP_CLAUDE_BIN a la ruta absoluta de claude.


Soporte de plataformas

Plataforma

Estado

Windows

Probado de extremo a extremo

macOS

Compatible; misma ruta de código POSIX que Linux

Linux

Compatible

Las diferencias de plataforma están aisladas en src/platform.ts:

Resolución del binario. En POSIX, spawn busca en PATH. En Windows, una instalación nativa da claude.exe mientras que una instalación npm da claude.cmd, que CreateProcess no puede ejecutar directamente — así que el servidor recorre PATH × PATHEXT prefiriendo .exe, y recurre a enrutar un shim .cmd a través de cmd.exe.

Escapado de argumentos. Ese recurso aplica dos capas: el entrecomillado de argv de MSVCRT, y luego un escape con intercalación de los metacaracteres propios de cmd (& | < > ^ " ( ) % !). Omitir la segunda capa es el clásico agujero de inyección de comandos en .cmd. Los prompts nunca tocan esta ruta — viajan por stdin. Una limitación: un append_system_prompt multilínea no puede cruzar una línea de comandos de cmd.exe, así que el servidor lanza un error claro que apunta a OPENROUTER_MCP_CLAUDE_BIN en lugar de alterarlo silenciosamente.

Lista de permitidos del entorno. Windows conserva un conjunto mucho mayor que POSIX. SystemRoot y windir no son opcionales — si se eliminan, Winsock no consigue inicializarse, así que el hijo no puede abrir un socket en absoluto.

Cancelación. Los hijos POSIX se lanzan detached como líderes de grupo de procesos y se cancelan con process.kill(-pid); Windows usa taskkill /T /F.


Modelo de seguridad

El aislamiento de credenciales es el punto. El entorno del hijo se construye desde cero en lugar de heredarse, y las variables del proveedor se eliminan antes de aplicar los valores de OpenRouter. test/env-unit.mjs verifica que la clave llega al hijo en exactamente una variable y que ningún secreto del padre sobrevive; test/e2e.mjs envenena al padre con una ANTHROPIC_API_KEY falsa y una ANTHROPIC_BASE_URL=https://api.anthropic.com real y confirma que el delegado no ve ninguna de las dos.

La clave nunca es legible a través de una herramienta. Cada ruta de diagnóstico la enmascara, y test/readonly.mjs verifica que ninguna salida de herramienta y ninguna salida de CLI contenga la clave. Esto importa más aquí que en el hermano de Ollama, donde el token es la cadena literal ollama.

La política de delegación no es modificable por el modelo. No hay ninguna herramienta MCP para cambiar delegationMode, allowedModels o la clave de API. Un modelo que encuentre ondemand inconveniente no puede cambiarse a sí mismo a auto y empezar a gastar. Los ajustes se cargan una vez al inicio, nunca se mutan en tiempo de ejecución, y las descripciones de las herramientas indican que la política no es algo que el modelo pueda cambiar.

Esto es una barrera de protección, no un límite de seguridad. Un agente con acceso al shell aún puede editar el archivo de configuración. Lo que te aporta eliminar la herramienta es que tal cambio sea una edición de archivo visible que solo surte efecto en el siguiente reinicio, en lugar de una única llamada a herramienta silenciosa a mitad de tarea. Para hacerlo hermético, fija los valores mediante --env en el registro MCP, que sobrescribe los archivos de configuración:

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

El gasto es real. Un orquestador desbocado en modo auto gasta tus créditos, no tu paciencia. Mantén un límite de clave de OpenRouter en la clave que le des a este servidor — ese es un techo con el que el modelo no puede discutir.

Los delegados heredan tu sistema de archivos. Se ejecutan como tu usuario en el cwd que les des, con defaultPermissionMode. Trata una sesión delegada como tratarías cualquier sesión de Claude Code — usa disallowed_tools o un modo de permisos de solo lectura cuando entregues trabajo a un modelo en el que confíes menos.


Desarrollo

npm install        # installs and builds
npm run build      # tsc
npm run dev        # tsc --watch

Pruebas

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 model

npm test ejecuta las cuatro que no necesitan red. Pasan tanto en Windows como en POSIX: la prueba de árbol de procesos construye su árbol con procesos de node en lugar de elementos integrados del shell, por lo que no es exclusiva de POSIX.

Publicación de una versión

npm login                       # interactive, once per machine
npm version patch               # or minor / major -- tags and bumps
npm publish                     # prepare script builds first
git push --follow-tags

Ejecuta npm publish desde una terminal real, no desde un script ni un shell no interactivo. Con WebAuthn/llave de seguridad 2FA la CLI completa el desafío abriendo un navegador; sin un TTY no puede, y recurre a exigir un código TOTP que una llave de seguridad no puede producir (npm error code EOTP). Para CI, usa un token de acceso granular con Bypass 2FA en su lugar.

El paquete incluye solo dist/, README.md y LICENSE. publishConfig.access es public, y prepare ejecuta tsc antes del empaquetado, por lo que un dist/ obsoleto nunca puede publicarse.

Estructura

File

Responsibility

src/index.ts

Servidor MCP, registro de herramientas y manejadores

src/settings.ts

Carga de configuración por capas, resolución de claves de API, enmascaramiento

src/config.ts

Singleton de configuración resuelta al inicio

src/descriptions.ts

Descripciones de herramientas según el modo, advertencias de costo

src/env.ts

Construcción del entorno hijo y lista de bloqueo de variables de proveedor

src/platform.ts

Spawn en Windows/POSIX, escape de argumentos, finalización del árbol de procesos

src/jobs.ts

Ciclo de vida de trabajos, análisis de stream-json, contabilidad de costos, cancelación

src/models.ts

Catálogo, precios, aplicación de soporte de herramientas, consultas de facturación

src/cli.ts

CLI de configuración openrouter-mcp-config


Licencia

MIT — consulta LICENSE.

Available Tools

7 tools
delegate_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.

NameRequiredDescriptionDefault
job_idYesThe job_id to cancel.

TDQS

A4/5.0
Behavior4/5

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.

Conciseness5/5

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.

Completeness4/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines3/5

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.

NameRequiredDescriptionDefault
job_idNoA job_id from any earlier turn of the conversation.
promptNoThe next message. Use prompt_file for long prompts.
max_turnsNoCap the delegate's agentic turns for this turn.
session_idNoThe Claude Code session id, as an alternative to job_id.
prompt_fileNoPath to a file holding the next message.
wait_secondsNoBlock up to this many seconds before returning.
permission_modeNoOverride the permission mode for this turn.

TDQS

A4.6/5.0
Behavior4/5

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.

Conciseness5/5

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.

Completeness4/5

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.

Parameters4/5

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.

Purpose5/5

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.

Usage Guidelines5/5

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.

NameRequiredDescriptionDefault
limitNoMaximum jobs to list. Default 20.
stateNoFilter by state.

TDQS

A4/5.0
Behavior4/5

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.

Conciseness5/5

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.

Completeness4/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines3/5

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.

NameRequiredDescriptionDefault
job_idYesThe job_id to collect.
wait_secondsNoBlock up to this many seconds for the job to finish.

TDQS

A4.2/5.0
Behavior4/5

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.

Conciseness5/5

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.

Completeness4/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines4/5

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.

NameRequiredDescriptionDefault
cwdNoWorking directory for the delegated session. Defaults to the server's cwd.
modelNoOpenRouter model id, e.g. "google/gemini-2.5-flash". Must be in the allowed list.
promptNoThe task for the delegated session. Use prompt_file for long prompts.
add_dirsNoAdditional directories the delegate may access.
max_turnsNoCap the delegate's agentic turns. Each turn is billed, so this is also a cost cap.
prompt_fileNoPath to a file holding the prompt. Preferred for long or special-character-heavy prompts.
small_modelNoModel for the delegate's background/small-model slot. Defaults to the configured one.
wait_secondsNoBlock up to this many seconds for completion. Default 0.
allowed_toolsNoTool allowlist, e.g. ['Read','Grep','Bash(git *)'].
permission_modeNoPermission mode for the delegate. Defaults to the configured default.
disallowed_toolsNoTool denylist, e.g. ['Write','Edit'].
append_system_promptNoExtra instructions appended to the delegate's system prompt.

TDQS

A4.6/5.0
Behavior5/5

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.

Conciseness4/5

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.

Completeness5/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines5/5

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.

NameRequiredDescriptionDefault
job_idYesThe job_id returned by delegate_start or delegate_followup.
wait_secondsNoBlock up to this many seconds waiting for completion.
progress_limitNoHow many recent activity lines to show. Default 15.

TDQS

A4/5.0
Behavior3/5

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.

Conciseness5/5

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.

Completeness4/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines4/5

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.

NameRequiredDescriptionDefault
limitNoMaximum models to list. Default 30.
filterNoCase-insensitive substring match on model id or name, e.g. "gemini" or "qwen".
free_onlyNoOnly models that cost nothing.
tools_onlyNoOnly models that support tool calling. Default true; Claude Code needs it.

TDQS

A4.9/5.0
Behavior5/5

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.

Conciseness5/5

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.

Completeness5/5

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.

Parameters4/5

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.

Purpose5/5

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.

Usage Guidelines5/5

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.

  1. 7 tool updatesv1.0.0
    • First observeddelegate_cancel
    • First observeddelegate_followup
    • First observeddelegate_list
    • First observeddelegate_result
    • First observeddelegate_start
    • First observeddelegate_status
    • First observedopenrouter_models

TDQS

A4.4/5.0

Scored across 7 tools

Disambiguation5/5

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.

Naming Consistency4/5

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.

Tool Count5/5

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.

Completeness5/5

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

ActivityStale
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    B
    maintenance
    Enables 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
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables 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.
    6
    MIT