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 (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 to auth.token), headers that carry credentials (header:<name>), or oauth2 (authorize with start OAuth; with your own client use auth.clientSecret). Sending credentials directly answers 400 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), and error (lastError).
  • Editing resets verification: when you update the server, it goes back to pending_config, its tools leave the catalog, and its secrets become needs_authorization. Bind again, test, and choose tools (connections to agents are recovered when you reinstall the tools).
  • Security: public URLs only (https is required to use secrets). Installing a tool in the catalog does not connect it to any agent automatically.

Endpoints

MethodEndpointWhat it does
GET / POST/v1/tools/mcpList, or connect, an MCP server
GET / PATCH / DELETE/v1/tools/mcp/{mcpId}Get, update, or delete
POST/v1/tools/mcp/{mcpId}/secretsBind a secret to a slot
POST/v1/tools/mcp/{mcpId}/oauth/startGet the OAuth authorization URL
POST/v1/tools/mcp/{mcpId}/testTest the connection and discover tools
POST/v1/tools/mcp/{mcpId}/tools/syncChoose 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.

Statusdetails.codeWhen it happens
400INVALID_REQUESTThe body or parameters fail validation, or the credential covers several workspaces and workspace is missing. details.issues has the list of problems
401UNAUTHENTICATEDThe credential is missing, revoked, or expired
400INVALID_CONFIGThe name, URL, authentication, or headers are not valid
400SECRET_REFERENCE_REQUIREDYou sent a credential inside the connection. When it applies, details.slot names the slot
400SECRET_SLOT_INVALIDThat slot does not exist in the server's current connection
400SECRET_DESTINATION_INVALIDThe server URL is not https or is not valid
400TOOLS_REQUIREDThe list of tools to choose is not valid
403FORBIDDENThe person behind the token does not have access to Integrations
404NOT_FOUNDThe server does not exist in this workspace
404SECRET_NOT_FOUNDThe secret does not exist in this workspace
409RESOURCE_CHANGEDexpectedVersion does not match, or the server changed while it was being saved. Get it again and retry
409NAME_CONFLICTA tool would produce a name another tool in the workspace already uses
409VERIFICATION_REQUIREDThere is no current test. Test and retry
409AUTHORIZATION_REQUIREDA credential is missing: a slot without a secret, or an OAuth server that is not authorized
409MCP_REAUTH_REQUIREDThe server needs to be authorized again from Platica
409MCP_CONNECTION_CHANGEDThe server changed during the test. Repeat the call
409NOT_OAUTHYou asked to start OAuth on a server that does not use it
409UNKNOWN_TOOLA name is not among the tools the server offered in the last test
409TOO_MANY_TOOLS, INVALID_CAPABILITY or CAPABILITY_TOO_LARGEThe server offers too many tools, repeated or invalid names, or a list that is too large
409SECRET_USE_REVOKEDThe secret is revoked or expired
409SECRET_CHANGEDThe secret changed while it was being bound. Repeat the call
409SECRET_BINDING_LIMITThe server already has the maximum number of bound secrets
409DELETION_IN_PROGRESSThe deletion is already in progress. Repeat the call to continue it
410PREVIEW_REMOVEDPOST /v1/tools/mcp/preview no longer exists: connect the server and test it
503OPERATION_UNCONFIRMEDThe test could not be completed, for example because the server did not respond. Get the server before retrying

Slot states are in Secrets and AI tools in Tools MCP.