Agents & MCP

One assistant as an MCP server

Looking to manage your whole account from your agent? That is the @cognitiondesk/mcp server. This page is the other one: every CognitionDesk assistant is also an MCP server (Model Context Protocol). Install it into Claude Code, Claude Desktop, Cursor, GitHub Copilot, or any MCP-compatible client, and the assistant’s granted tools become callable directly inside that environment — governed by the exact same capability grants as the chat agent.

One server per assistant

The install URL is /mcp/<assistantId>. The assistant defines which tools it exposes.

Grant-gated

A tool is reachable over MCP only if you granted its capability scope. Secrets stay encrypted server-side.

Streamable HTTP

Standard JSON-RPC 2.0 over HTTP. Authenticate with an x-api-key header.

Before you start

  • An assistant — copy its ID from the Assistants page.
  • An API key — generate one in the “Connect via MCP” dialog or under API Keys.
  • Granted capabilities — toggle the scopes the assistant may use (e.g. inventory:read). Tools without a granted scope will not appear.

The fastest path: open Assistants → your assistant → “Connect via MCP”. That dialog generates an API key scoped to the assistant, lets you grant capabilities, and produces a ready-to-paste config for each environment below.

The endpoint

HTTP
POST https://api.cognitiondesk.com/mcp/<assistantId>
Header:  x-api-key: <your-api-key>

The same URL serves a GET for discovery (returns the server info and the list of tools the assistant currently exposes).

Install per environment

Claude Code

Add the remote server from your terminal with the Claude Code CLI.

Shell
claude mcp add --transport http "mounaji-support" \
  "https://api.cognitiondesk.com/mcp/YOUR_ASSISTANT_ID" \
  --header "x-api-key: YOUR_API_KEY"

# verify
claude mcp list

Run in your terminal, then confirm with claude mcp list.

Claude Desktop

Add the server to your Claude Desktop config, then restart the app.

claude_desktop_config.json
JSON
{
  "mcpServers": {
    "mounaji-support": {
      "url": "https://api.cognitiondesk.com/mcp/YOUR_ASSISTANT_ID",
      "headers": { "x-api-key": "YOUR_API_KEY" }
    }
  }
}

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json · Windows: %APPDATA%\Claude\claude_desktop_config.json

Cursor

Add the server to Cursor’s MCP config (global or per-project).

~/.cursor/mcp.json
JSON
{
  "mcpServers": {
    "mounaji-support": {
      "url": "https://api.cognitiondesk.com/mcp/YOUR_ASSISTANT_ID",
      "headers": { "x-api-key": "YOUR_API_KEY" }
    }
  }
}

Use .cursor/mcp.json in a project to scope the server to that workspace.

VS Code / Copilot

Add the server to the workspace MCP config, then start it from the MCP view.

.vscode/mcp.json
JSON
{
  "servers": {
    "mounaji-support": {
      "type": "http",
      "url": "https://api.cognitiondesk.com/mcp/YOUR_ASSISTANT_ID",
      "headers": { "x-api-key": "YOUR_API_KEY" }
    }
  }
}

Open the Command Palette → “MCP: List Servers” → Start.

Verify the connection

List the tools the assistant exposes (no client required):

Shell
curl -X POST "https://api.cognitiondesk.com/mcp/YOUR_ASSISTANT_ID" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

A successful response returns the granted tools:

tools/list response
JSON
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "tools": [
      { "name": "inventory_list_items", "description": "List the owner's catalog items", "inputSchema": { "type": "object", "properties": { ... } } },
      { "name": "contacts_upsert", "description": "Create or update a contact", "inputSchema": { ... } }
    ]
  }
}

Call a tool directly:

Shell
curl -X POST "https://api.cognitiondesk.com/mcp/YOUR_ASSISTANT_ID" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc":"2.0","id":2,"method":"tools/call",
    "params":{"name":"inventory_list_items","arguments":{"limit":5}}
  }'

What tools appear?

The tool list is resolved per request from the assistant’s configuration: granted capability scopes, granted credential connections, and any feature settings. If a tool is missing, it is almost always because its scope was not granted. See Capabilities & Grants.

Security

MCP requests run with the assistant owner’s identity, never the model’s. Tools can only ever touch the owner’s own data, bounded by the granted scopes. External-API credentials are stored encrypted and never exposed over MCP.

Troubleshooting

401 / “API key required”

The x-api-key header is missing or the key is invalid/inactive.

403 / “not allowed for this assistant”

The key is restricted to other assistants. Generate a key for this assistant from the Connect via MCP dialog.

Empty tools list

No capabilities granted yet, or feature settings (e.g. inventory) are disabled. Grant scopes and re-list.

Tool returns { "isError": true }

The tool ran but failed (e.g. validation). The message is returned in-band so the model can react.

Assistant as MCP server — CognitionDesk Docs