MCP servers
Connect a public MCP server to the workspace. Discover its tools and choose which ones to install in the catalog. Then connect the tools to the agents that need them.
Quick example
# 1. Connect the server (it is also tested if no credential is missing)
curl -X POST https://api.platic.ai/v1/tools/mcp \
-H "Authorization: Bearer $PLATIC_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "Internal docs", "url": "https://mcp.example.com/mcp"}'
# 2. Install the discovered tools in the catalog
curl -X POST https://api.platic.ai/v1/tools/mcp/$MCP_ID/tools/sync \
-H "Authorization: Bearer $PLATIC_API_KEY" \
-H "Content-Type: application/json" \
-d '{"tools": ["search_docs"]}' // 1. Connect the server (if it is public or comes with secrets, it is also tested on create)
const server = await platic.tools.mcp.create({
name: 'Internal docs',
url: 'https://mcp.example.com/mcp',
auth: { type: 'bearer' },
secrets: { 'auth.token': secretId }
});
// 2. Choose which tools enter the catalog and connect them to the agent
const synced = await platic.tools.mcp.syncTools(server.id, { tools: ['search_docs'] });
await platic.agents.tools.connect(agentId, synced.installedTools[0].id); What you need to know
- Authentication:
none(public),bearer/apikey-header(bind a secret toauth.token), headers that carry credentials (header:<name>), oroauth2(authorize with start OAuth; with your own client useauth.clientSecret). Sending credentials directly answers400 SECRET_REFERENCE_REQUIRED. - Statuses:
pending_config(a credential, a test, or the tool choice is missing),pending_auth(waiting for OAuth),connected(ready),needs_reauth(OAuth expired), anderror(lastError). - Editing resets verification: when you update the server, it goes back to
pending_config, its tools leave the catalog, and its secrets becomeneeds_authorization. Bind again, test, and choose tools (connections to agents are recovered when you reinstall the tools). - Security: public URLs only (
httpsis required to use secrets). Installing a tool in the catalog does not connect it to any agent automatically.
Endpoints
| Method | Endpoint | What it does |
|---|---|---|
GET / POST | /v1/tools/mcp | List, or connect, an MCP server |
GET / PATCH / DELETE | /v1/tools/mcp/{mcpId} | Get, update, or delete |
POST | /v1/tools/mcp/{mcpId}/secrets | Bind a secret to a slot |
POST | /v1/tools/mcp/{mcpId}/oauth/start | Get the OAuth authorization URL |
POST | /v1/tools/mcp/{mcpId}/test | Test the connection and discover tools |
POST | /v1/tools/mcp/{mcpId}/tools/sync | Choose which tools to install in the catalog |
Errors
Read details.code to identify the error. The response uses { code, error, details: { code, message, ... } }. See Errors.
| Status | details.code | When it happens |
|---|---|---|
400 | INVALID_REQUEST | The body or parameters fail validation, or the credential covers several workspaces and workspace is missing. details.issues has the list of problems |
401 | UNAUTHENTICATED | The credential is missing, revoked, or expired |
400 | INVALID_CONFIG | The name, URL, authentication, or headers are not valid |
400 | SECRET_REFERENCE_REQUIRED | You sent a credential inside the connection. When it applies, details.slot names the slot |
400 | SECRET_SLOT_INVALID | That slot does not exist in the server's current connection |
400 | SECRET_DESTINATION_INVALID | The server URL is not https or is not valid |
400 | TOOLS_REQUIRED | The list of tools to choose is not valid |
403 | FORBIDDEN | The person behind the token does not have access to Integrations |
404 | NOT_FOUND | The server does not exist in this workspace |
404 | SECRET_NOT_FOUND | The secret does not exist in this workspace |
409 | RESOURCE_CHANGED | expectedVersion does not match, or the server changed while it was being saved. Get it again and retry |
409 | NAME_CONFLICT | A tool would produce a name another tool in the workspace already uses |
409 | VERIFICATION_REQUIRED | There is no current test. Test and retry |
409 | AUTHORIZATION_REQUIRED | A credential is missing: a slot without a secret, or an OAuth server that is not authorized |
409 | MCP_REAUTH_REQUIRED | The server needs to be authorized again from Platica |
409 | MCP_CONNECTION_CHANGED | The server changed during the test. Repeat the call |
409 | NOT_OAUTH | You asked to start OAuth on a server that does not use it |
409 | UNKNOWN_TOOL | A name is not among the tools the server offered in the last test |
409 | TOO_MANY_TOOLS, INVALID_CAPABILITY or CAPABILITY_TOO_LARGE | The server offers too many tools, repeated or invalid names, or a list that is too large |
409 | SECRET_USE_REVOKED | The secret is revoked or expired |
409 | SECRET_CHANGED | The secret changed while it was being bound. Repeat the call |
409 | SECRET_BINDING_LIMIT | The server already has the maximum number of bound secrets |
409 | DELETION_IN_PROGRESS | The deletion is already in progress. Repeat the call to continue it |
410 | PREVIEW_REMOVED | POST /v1/tools/mcp/preview no longer exists: connect the server and test it |
503 | OPERATION_UNCONFIRMED | The test could not be completed, for example because the server did not respond. Get the server before retrying |