Skip to content

MCP Integration

Whiskers also publishes your externally exposed agents as an MCP (Model Context Protocol) server. MCP clients such as Claude Desktop and Cursor can connect to Whiskers and call your agents as tools.

MCP endpoint (streamable-http):  https://<whiskers-host>/api/public/v1/mcp/

Tools = publicly exposed agents

The tool list an MCP client sees is derived from publicly exposed agents:

  • Tool name = the agent's slug; description = the agent's description.
  • If you defined a public input schema on the agent, that becomes the MCP tool's inputSchema; otherwise a generic single text input (input) is used.
  • The call result is the agent run's output. For long runs, if the client sent a progressToken, progress notifications stream step by step.
  • Next to the agent tools there is one fixed tool: whiskers_execution_status — takes an execution_id and returns the run's current status and output.
  • For human-approved agents the tool call closes at the approval gate with status awaiting_human and the unapproved draft; that is not the final answer (the tool description says so too). Approval is given in Whiskers or via the REST decision endpoint — there is no decision tool over MCP (so a calling model cannot approve its own output); the waiting step's name is in awaiting_gate. Ask for the result with whiskers_execution_status. If rejected, decision is "denied" and reason (gate, note, by, by_type, subject) is populated; if the run failed, error.code is populated. The fields match the REST response (Public API — Human-approved agents).

Authentication

Two paths are supported:

1) API key (machine-to-machine)

Add an Authorization: Bearer wsk_... header to MCP requests. The tool list and call authorization are bounded by the key's allowed-agents scope. Key creation: Public API guide.

2) OAuth 2.1 (on behalf of a user — Claude Desktop etc.)

MCP's standard auth flow. Whiskers provides a full OAuth Authorization Server; modern MCP clients drive the flow automatically:

  1. On an unauthenticated request the client receives 401 + a resource metadata pointer (RFC 9728 /.well-known/oauth-protected-resource).
  2. It discovers the AS metadata (RFC 8414 /.well-known/oauth-authorization-server).
  3. It registers itself (Dynamic Client Registration — /oauth/register).
  4. A Whiskers login + consent screen opens in the browser; the user grants access (PKCE required).
  5. The client obtains tokens (/oauth/token; refresh tokens rotate) and uses them on MCP requests.

A client connected via OAuth acts as that user: the tool list and call authorization match whatever agents the user can access (role + access list are freshly evaluated on every request). Quota/metering are attributed to that user.

Claude Desktop example

Claude Desktop → Settings → Connectors → Add custom connector:

{
  "name": "Whiskers",
  "url": "https://<whiskers-host>/api/public/v1/mcp/"
}

Once added, Claude starts the OAuth flow (Whiskers login + consent in the browser). Your exposed agents then appear in Claude's tool list; on requests like "have the marketing assistant in Whiskers summarize this text", Claude calls the tool.

For clients connecting with an API key (no user), pin the Authorization header in the connector configuration.

Session

The server establishes a stateful MCP session (SSE response stream + event replay): a dropped connection can resume from the last event.

Troubleshooting

Symptom Likely cause
Empty tool list No agent is publicly exposed; or outside the key/user scope
401 loop The OAuth client got stuck at registration/redirect — update the client, check clock sync
Connection dropped, the app asks for consent again Expected cases: your account was disabled or your password changed (all your MCP connections are closed then), or 90 days have passed since the original consent (consent does not last forever). Reconnect in the app and consent again
Registration returns 400 invalid_redirect_uri The client's redirect address is not accepted. Accepted: https://…, http://… only for localhost/127.0.0.1, and app schemes (cursor://…, vscode://…). Schemes that run scripts or open local content (javascript:, data:, file: …) and addresses containing whitespace are refused for security
Call returns 403 Agent is exposed but the user's access list doesn't cover it (the OAuth path runs with user authorization)
Silence on long jobs The client isn't sending a progressToken — progress notifications only flow when requested
Silence on long jobs while sending a progressToken The client may be connected in JSON response mode: progress notifications travel over the streaming (SSE) channel, and JSON mode has no channel to carry them — the result still returns, only the interim notifications do not