Connect an MCP server
Connect an MCP server so your agent can use its tools. With Linear, for example, you can give it tools to search and create issues.
To manage Platica from an assistant such as Claude, use the Platica MCP server.
Before you start
You need an agent, its id in AGENT_ID and the MCP server's URL.
- If the server needs no credentials, start at step 2.
- If it uses OAuth, follow If the server uses OAuth.
- If it uses a token, store it as a secret in step 1.
To use the platform, see Connect an MCP server.
Store the credential as a secret
Send the token when you create the secret. Later reads don't return its value. (Create a secret)
curl https://api.platic.ai/v1/secrets \ -H "Authorization: Bearer $PLATIC_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "Linear · token", "kind": "bearer", "value": "<Linear token>" }'import { Platic } from "platic-sdk"; const platic = new Platic({ apiKey: process.env.PLATIC_API_KEY! }); const agentId = process.env.AGENT_ID!; const secret = await platic.secrets.create({ name: "Linear · token", kind: "bearer", value: process.env.LINEAR_TOKEN!, });Store the Linear token as a secret.
Tool:
create_secret. To keep the token out of the chat, store it yourself in Integrations → Functions → Secrets and ask it to use that one.Keep the secret's
idinSECRET_ID.Connect the server
Platica tests it in the same call and tells you which tools it offers. (Connect an MCP server)
curl https://api.platic.ai/v1/tools/mcp \ -H "Authorization: Bearer $PLATIC_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "name": "Linear", "url": "https://mcp.linear.app/mcp", "auth": { "type": "bearer" }, "secrets": { "auth.token": "'$SECRET_ID'" } }'const server = await platic.tools.mcp.create({ name: "Linear", url: "https://mcp.linear.app/mcp", auth: { type: "bearer" }, secrets: { "auth.token": secret.id }, });Connect the Linear MCP server, https://mcp.linear.app/mcp, with the Linear token secret, and tell me which tools it offers.
Tool:
connect_mcp_server.Save the server's
idinMCP_ID. CheckdiscoveredToolsto choose the tools you need. Ifverifiedisfalse, follownextStep.Choose which tools to install
Select the tools the agent needs. This example installs
search_issuesandcreate_issue. (Choose tools)curl 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_issues", "create_issue"] }'const synced = await platic.tools.mcp.syncTools(server.id, { tools: ["search_issues", "create_issue"], });From the Linear server, install only search_issues and create_issue.
Tool:
sync_mcp_server_tools.Send the complete list of tools you want to keep. Omitted tools are uninstalled. The response includes their ids in
installedTools, in each tool'sidfield.Connect them to the agent
Each tool is connected separately, with its
id. It applies right away, without publishing the agent. (Connect a tool)curl -X PUT https://api.platic.ai/v1/agents/$AGENT_ID/tools/$TOOL_ID \ -H "Authorization: Bearer $PLATIC_API_KEY"Repeat the call with the
idof each tool.for (const tool of synced.installedTools) { await platic.agents.tools.connect(agentId, tool.id); }Give the Support agent the Linear tools you installed.
Tool:
connect_agent_tool, once per tool.
Check it worked
Use List the agent's tools to check that both Linear tools are assigned. Ask the agent to find a known issue and check the result.
If you change the connection later, the server goes back to pending_config: bind the secret again, test it and choose the tools again. The connections to your agents are kept. See Update an MCP server.
If the server uses OAuth
Some servers don't accept a fixed token: a person has to sign in and authorize. Skip step 1 and, in step 2, connect the server with "auth": { "type": "oauth2" } and no secrets. Then ask for the authorization page. (Start OAuth)
curl -X POST https://api.platic.ai/v1/tools/mcp/$MCP_ID/oauth/start \
-H "Authorization: Bearer $PLATIC_API_KEY"
# When the person authorizes:
curl -X POST https://api.platic.ai/v1/tools/mcp/$MCP_ID/test \
-H "Authorization: Bearer $PLATIC_API_KEY" const { authorizeIn } = await platic.tools.mcp.startOAuth(server.id);
// When the person authorizes:
await platic.tools.mcp.test(server.id); Give me the link to authorize the Linear server.
Tool: start_mcp_server_oauth. When you authorize, ask it to test the server: it uses test_mcp_server.
Open authorizeIn with an account that has access to the workspace and complete authorization. You don't need to send or receive OAuth tokens through the API. Then continue with step 3.
Next steps
- Give it files so it knows your business.
- Test it before you publish: a scenario can require the agent to use one of these tools.
- MCP servers: secrets, states and connection changes.