Connect an MCP server

SDK platic.tools.mcp.create()

Save an MCP server connection. Platica also tests it to discover its tools when all credentials are ready:

  • The server is public (auth.type: "none"), or
  • you sent in secrets the secret for each slot.

If a credential is missing, the connection is saved and nextStep says what comes next.

Example

await platic.tools.mcp.create({ name: "Docs", url: "https://mcp.example.com/mcp" });

Request body

FieldTypeDescriptionRequired
namestringName of the server inside Platica, 1 to 120 characters✓
urlstringURL of the MCP server✓
descriptionstringUp to 500 characters—
authobjectHow it authenticates, without the credential. See authentication. Defaults to { "type": "none" }—
headersobjectFixed headers, as name: value pairs. A header that carries a credential goes with an empty value and is bound as header:<name>—
secretsobjectMap of slot to secret id, to bind in this same call—
toolsstring[]Original names of the tools to install as soon as the connection is verified. Up to 100. If you omit it, none is installed—
{
  "name": "Linear",
  "description": "Support team issues",
  "url": "https://mcp.linear.app/mcp",
  "auth": { "type": "bearer" },
  "secrets": {
    "auth.token": "5d0c7a1e9b3f4a6c8e2d1f0b7a9c3e5d6f8a0b2c4d6e8f1a3b5c7d9e0f2a4b6c"
  }
}

Authentication

authSlot it exposes
{ "type": "none" }None
{ "type": "bearer" }auth.token: the server's token
{ "type": "apikey-header", "headerName": "X-Api-Key", "headerPrefix": "" }auth.token: the key, sent in the headerName header after the headerPrefix text. headerName is required
{ "type": "oauth2", "scope": "read write", "clientId": "…" }None you have to bind: a person authorizes it. scope and clientId are optional

Response

201 Created. data has the full server, with the fields in get an MCP server.

{
  "status": "success",
  "message": "MCP server saved — see nextStep",
  "data": {
    "id": "QZPHpckDPC58JIVLQA3Z",
    "name": "Linear",
    "description": "Support team issues",
    "url": "https://mcp.linear.app/mcp",
    "transport": "streamable-http",
    "slug": "a1b2c3",
    "authType": "bearer",
    "auth": { "type": "bearer" },
    "status": "pending_config",
    "lastError": null,
    "serverInfo": { "name": "linear-mcp", "version": "1.4.0" },
    "customHeaderNames": [],
    "discoveredToolsCount": 2,
    "installedToolsCount": 0,
    "lastSyncAt": null,
    "createdAt": "2026-10-28T12:02:11.410Z",
    "updatedAt": "2026-10-28T12:02:14.900Z",
    "version": 1,
    "verified": true,
    "secrets": [
      {
        "slot": "auth.token",
        "state": "authorized",
        "secretId": "5d0c7a1e9b3f4a6c8e2d1f0b7a9c3e5d6f8a0b2c4d6e8f1a3b5c7d9e0f2a4b6c"
      }
    ],
    "discoveredTools": [
      {
        "name": "create_issue",
        "description": "Create a new issue in Linear",
        "inputSchema": {
          "type": "object",
          "properties": {
            "title": { "type": "string" },
            "teamId": { "type": "string" }
          },
          "required": ["title", "teamId"]
        },
        "installed": false
      },
      {
        "name": "search_issues",
        "description": "Search issues by text query",
        "inputSchema": {
          "type": "object",
          "properties": { "query": { "type": "string" } }
        },
        "installed": false
      }
    ],
    "installedTools": [],
    "verification": { "confirmed": true },
    "nextStep": "Verified. Choose which tools to install with POST /v1/tools/mcp/QZPHpckDPC58JIVLQA3Z/tools/sync: create_issue, search_issues."
  }
}

message is MCP server connected successfully when the call left tools installed, and MCP server saved — see nextStep in every other case.

What happens depending on what you send

You sentResult
A public server, or a complete secretsIt is saved and tested. discoveredTools has what it offers
The above, plus toolsIt also installs those tools and the server ends up connected
bearer or apikey-header without secretsIt is saved without testing. The auth.token slot stays missing
oauth2It is saved as pending_auth. Continue with start OAuth

Errors

Statusdetails.codeWhen it happens
400INVALID_REQUESTname or url is missing, or a field fails validation. details.issues has the list of problems
400SECRET_REFERENCE_REQUIREDYou sent a credential inside the connection: auth.token, auth.clientSecret, or a header with a credential name and a value. When it applies, details.slot names the slot
400INVALID_CONFIGThe name, URL, or authentication is not valid, or the headers have repeated or disallowed names
403FORBIDDENThe person behind the token does not have access to Integrations

Notes

  • Follow what nextStep says: bind a secret, start OAuth, test, or choose tools.
  • The names in tools are the ones in discoveredTools[].name. If you do not know them yet, connect without tools and choose them later.
  • After installing a tool, use connect a tool to assign it to an agent.
  • The call can take a while: the test waits for the server for up to 90 seconds.