Using create_mcp
How to format a create_mcp call correctly — http/stdio, where the API key goes, examples.
How to format a create_mcp call correctly — http/stdio, where the API key goes, examples.
Slug: tool-create-mcp
Agent-internal: loaded on demand via skill_view (hidden from the dashboard library, not user-assigned).
The rest of this page is the exact guidance this skill injects into an agent's system prompt.
Using create_mcp
Provision an MCP server so its tools become available in this workspace. The call is VERIFIED by actually connecting before anything is saved, so a wrong format fails loudly — get it right the first time.
Fields
- name: human-readable label.
- slug: lowercase-with-hyphens, unique in the workspace. It prefixes the server's tool names.
- transport:
"http"(remote server) or"stdio"(local subprocess).
transport "http":
- url: the endpoint, WITHOUT the key in it.
- apiKey: the key/token — it goes HERE, never inside the url.
- authScheme: how the key is sent —
"header"(default),"query", or"bearer". - authParamName: the header name or query-param name that carries the key (omit only for bearer).
transport "stdio": command, args, env.
#1 mistake: the key inside the URL
If you are given a URL like https://host/api/mcp?api_key=cog_ABC, do NOT pass that whole string as url. Split it:
- url →
https://host/api/mcp - apiKey →
cog_ABC - authScheme →
query - authParamName →
api_key
The tool re-attaches the key correctly. Passing the key inside url (with apiKey empty) fails with: transport "http" requires an apiKey.
Worked example — key as a query param
{
"name": "Cogni Cortex",
"slug": "cogni-cortex",
"transport": "http",
"url": "https://cogni-web-psi.vercel.app/api/mcp",
"apiKey": "cog_ABC123",
"authScheme": "query",
"authParamName": "api_key"
}Worked example — Bearer token
{ "name": "Acme", "slug": "acme", "transport": "http", "url": "https://api.acme.com/mcp", "apiKey": "sk-live-...", "authScheme": "bearer" }Making it usable: attach it to an agent
Creating the server does NOT make any agent able to use it. To give its tools to an agent, pass attachToAgentSlug in the same call — e.g. add "attachToAgentSlug": "my-agent". (Or attach later with attach_mcp.) If you skip this, no agent can call the MCP's tools.
Common mistakes
- ❌ creating the MCP then delegating, without attaching → the agent reports "I don't have that tool". Pass
attachToAgentSlugor callattach_mcp. - ❌ key inside
url→ ✅ key inapiKey+ the matchingauthScheme/authParamName. - ❌ omitting
authParamNamefor header/query schemes → it is required (onlybeareromits it). - ❌ reusing a slug already in the workspace → choose a unique one.