Skip to content

mcp

Expose Clanker through the Model Context Protocol.

The mcp command starts a local MCP server for the Clanker CLI. MCP clients can use it to inspect Clanker routing decisions, return the installed CLI version, and run real Clanker commands through a local transport.

Usage

bash
clanker mcp [flags]

Flags

FlagTypeDefaultDescription
--transportstringhttpMCP transport to use: http or stdio
--listenstring127.0.0.1:39393Listen address for the HTTP MCP transport

Transports

HTTP Transport

Use HTTP when you want a persistent local endpoint that multiple tools or scripts can call.

bash
clanker mcp --transport http --listen 127.0.0.1:39393

This exposes the MCP endpoint at http://127.0.0.1:39393/mcp.

Stdio Transport

Use stdio when your MCP client launches the Clanker process directly.

bash
clanker mcp --transport stdio

Available Tools

The CLI MCP server exposes a broad local tool surface. Exact schemas are available through tools/list; the main namespaces are:

NamespaceTools
Coreclanker_version, clanker_route_question, clanker_run_command
Clanker Cloud appclanker_cloud_app_status, clanker_cloud_launch_app, clanker_cloud_ask_app, clanker_cloud_call_backend_api, clanker_cloud_start_scan, clanker_cloud_plan_changes, clanker_cloud_apply_plan
Cloud providersclanker_aws_ask, clanker_aws_list, clanker_gcp_ask, clanker_gcp_list, clanker_azure_ask, clanker_azure_list, clanker_cloudflare_ask, clanker_cloudflare_list, clanker_digitalocean_ask, clanker_digitalocean_list, clanker_hetzner_ask, clanker_hetzner_list
Additional providersclanker_vercel_ask, clanker_vercel_list, clanker_flyio_ask, clanker_flyio_list, clanker_railway_ask, clanker_railway_list, clanker_verda_ask, clanker_verda_list
Catalogclanker_cloud_mcp_catalog
Tencent Cloudclanker_tencent_list, clanker_tencent_scan, clanker_tencent_metrics, clanker_tencent_expiry, clanker_tencent_cost, clanker_tencent_vouchers, clanker_tencent_topology, clanker_tencent_audit_history, clanker_tencent_maker_plan, clanker_tencent_maker_apply
Kubernetesclanker_k8s_list_clusters, clanker_k8s_get_resources, clanker_k8s_scale, clanker_k8s_restart, clanker_k8s_rollout, clanker_k8s_apply, clanker_k8s_delete_resource, clanker_k8s_exec, clanker_k8s_logs, Helm tools, and node cordon/drain tools
Sentryclanker_sentry_ask, clanker_sentry_list_issues, clanker_sentry_get_issue, clanker_sentry_resolve_issues, clanker_sentry_list_releases
LinearAsk, issue/project/cycle/team listing, issue/project create/update, comments, and label search tools
NotionAsk, search, page/block reads, database query, page creation, block append, page property update, and row creation tools

Human approval

Plan-apply tools such as clanker_cloud_apply_plan and clanker_tencent_maker_apply are mutating operations. They are designed for explicit approval workflows, not blind autonomous execution.

HTTP Examples

Start the local server:

bash
clanker mcp --transport http --listen 127.0.0.1:39393

Initialize a client session:

bash
curl -sS -X POST http://127.0.0.1:39393/mcp \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json, text/event-stream' \
  --data '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"local-cli","version":"1.0"}}}'

List available tools:

bash
curl -sS -X POST http://127.0.0.1:39393/mcp \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json, text/event-stream' \
  --data '{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}'

Return the installed Clanker version:

bash
curl -sS -X POST http://127.0.0.1:39393/mcp \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json, text/event-stream' \
  --data '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"clanker_version","arguments":{}}}'

Inspect how Clanker would route a question:

bash
curl -sS -X POST http://127.0.0.1:39393/mcp \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json, text/event-stream' \
  --data '{"jsonrpc":"2.0","id":4,"method":"tools/call","params":{"name":"clanker_route_question","arguments":{"question":"use clanker cloud mcp to show my saved settings"}}}'

Run a real Clanker command through MCP:

bash
curl -sS -X POST http://127.0.0.1:39393/mcp \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json, text/event-stream' \
  --data '{"jsonrpc":"2.0","id":5,"method":"tools/call","params":{"name":"clanker_run_command","arguments":{"args":["ask","--route-only","use clanker cloud mcp to show my saved settings"]}}}'

Running Commands Through MCP

clanker_run_command accepts the same subcommands you would normally pass to the local CLI, except mcp itself. This makes it useful for editor integrations and chat clients that want one MCP entry point for normal Clanker operations.

For example, you can run a normal ask query:

json
{
  "args": ["ask", "what lambda functions have the most errors?", "--aws"]
}

You can also pass optional command-level overrides in the MCP arguments:

FieldTypeDescription
argsstring[]Required. The Clanker subcommand and arguments to run
profilestringOptional AWS profile override
backendUrlstringOptional backend URL override for backend-aware commands
backendEnvstringOptional backend environment override
debugboolOptional debug mode override

Cloud Provider Catalog

Use clanker_cloud_mcp_catalog to discover local provider tools and upstream provider MCP servers from one tool call. The catalog includes local Clanker ask/list tools and known provider MCP endpoints such as Cloudflare API, Docs, Workers Bindings, Workers Builds, Observability, Radar, Browser Run, AI Gateway, AI Search, and GraphQL.

Provider list tools accept the same resource names documented on the provider pages. For example:

json
{
  "provider": "cloudflare",
  "resource": "ai-gateways"
}
json
{
  "provider": "digitalocean",
  "resource": "gradient-agents"
}

Clanker Cloud Routing

The CLI router also understands explicit Clanker Cloud phrasing. If you ask questions like use clanker cloud, ask clanker cloud, or clanker cloud mcp, Clanker can route those requests toward the running desktop app backend when it is available.

That means you can use CLI MCP for two related workflows:

  1. Use the standalone CLI MCP server to expose normal Clanker tools.
  2. Ask Clanker to route app-specific prompts to the local Clanker Cloud backend.

For examples of app-specific routing through clanker ask, see ask.

See Also

  • ask -- Ask questions and inspect routing decisions
  • talk -- Multi-turn conversations with Clanker agents
  • Quick Start -- Common CLI workflows, including MCP startup