Pi Durable Platformdocs
ReferenceMCP servers

Give the thread the MCP servers its user enabled in the app (replaces them; [] removes them)

PUT
/v1/agents/{agentId}/threads/{threadId}/mcp-servers

For template versions with clientMcp, on hosts the platform allows (AGENTS_CLIENT_MCP_HOSTS). Headers, such as the user's token, are stored encrypted until the server expires (default a day). The same list can be sent with a message as mcpServers.

Path Parameters

agentId*string
Formatuuid
threadId*string

Client-chosen thread ID (1-64 letters, digits, dashes or underscores)

Match^[A-Za-z0-9_-]{1,64}$

Request Body

application/json
  1. body
servers*array<>
Itemsitems <= 10

Response Body

Servers of the thread

application/json
  1. response
data*array<>
curl -X PUT 'https://agents.example.com/v1/agents/497f6eca-6276-4993-bfeb-53cbbbba6f08/threads/string/mcp-servers' \  -H 'Content-Type: application/json' \  -d '{  "servers": [    {      "name": "string",      "url": "string"    }  ]}'
{  "data": [    {      "name": "string",      "slug": "string",      "url": "string",      "expiresAt": "2019-08-24T14:15:22Z"    }  ]}