Model Context Protocol Connectors, Remote MCP Servers, and Agent API Tools
How Perplexity Agent API connectors and MCP tools work, and how to connect hosted MCP servers in editors and agents.
This page summarizes Perplexity documentation on extending the Agent API and MCP-compatible clients with external tools. Most of the material is about connectors (MCP saved on a Project) versus the per-request mcp tool, plus Perplexity’s hosted remote MCP endpoints for assistants such as Cursor and Claude Code. Peripheral cluster notes (local stdio servers, third-party routers) follow the same MCP configuration patterns described in Perplexity MCP Server.
Agent API tools: built-in tools, connectors, MCP, and custom functions
Section titled “Agent API tools: built-in tools, connectors, MCP, and custom functions”The Agent API exposes four tool kinds. They differ in who configures the integration, where credentials live, and whether execution stays inside Perplexity’s loop or pauses back to your app.
| Kind | What it is | Where the model runs it |
|---|---|---|
| Built-in tools | Perplexity-hosted capabilities, enabled by type. |
Inside the loop; Perplexity runs it and returns results inline. |
| Connectors | Managed services or your own MCP server, configured once for a Project and selected with type: "connector" and id. |
Inside the loop; calls run without approval by default. |
| MCP servers | Your own remote MCP server, connected with type: "mcp". |
Inside the loop; calls run without approval by default. |
| Custom functions | Functions you control, declared with a JSON Schema. | Paused back to you; you run the call and return the result. |
Kind — What it is — Where the model runs it
Built-in tools — Perplexity-hosted capabilities, enabled by type. — Inside the loop; Perplexity runs it and returns results inline.
Connectors — Managed services or your own MCP server, configured once for a Project and selected with type: “connector” and id. — Inside the loop; calls run without approval by default. Use approvals to review calls before they run.
MCP servers — Your own remote MCP server, connected with type: “mcp”. — Inside the loop; calls run without approval by default. Use approvals to review calls before they run.
Custom functions — Functions you control, declared with a JSON Schema. — Paused back to you; you run the call and return the result.— Perplexity, Tools overview
Common conclusion: Use connectors when the same MCP server and credentials should be shared across every API key in a Project without your app storing tokens. Use type: "mcp" when you pass server_url and authorization on each request (Streamable HTTP required). Use custom functions when you must execute logic on your own infrastructure.
Connectors: managed catalog, custom MCP, and connector in requests
Section titled “Connectors: managed catalog, custom MCP, and connector in requests”Connectors are one-time Project configuration. Perplexity stores connection settings and credentials; your application only references a connector ID.
Connectors are integrations that you configure once on your Project connectors page. Choose a managed connector from the catalog, or add a custom connector for your own remote Model Context Protocol (MCP) server. Perplexity stores the connection settings and credentials for your Project. Your application references the connector by ID, so it does not need to store or send the MCP server’s token with each request. You still use your Perplexity API key to authenticate Agent API requests.
— Perplexity, Connectors
Managed connectors: GitHub, Slack, and catalog IDs
Section titled “Managed connectors: GitHub, Slack, and catalog IDs”Managed connectors ship with fixed IDs (for example connector_slack, connector_github). Any API key in the same Project can use them. Some managed connectors also expose credentials to Sandbox commands so an agent can combine service access with local code changes.
| Service | Connector ID |
|---|---|
| GitHub | connector_github |
| Slack | connector_slack |
| Google Drive | connector_googledrive |
| Datadog | connector_datadog |
| Linear | connector_linear |
| Notion | connector_notion |
Custom connectors: register remote MCP once per Project
Section titled “Custom connectors: register remote MCP once per Project”A Project administrator registers your server on the Project connectors page: name, MCP URL, authentication (API Key or None), and transport (Streamable HTTP or SSE). Perplexity stores the credential when you choose API Key authentication.
Register your remote MCP server once and let Perplexity store its API key. Your application only needs the connector ID to use the saved connection, with no separate MCP credential to manage in your application.
— Perplexity, Connectors — Add a custom connector
The September 2026 changelog states the same pattern: register once, use type: "connector" with the generated connector ID, with API-key or no authentication and Streamable HTTP or SSE transport.
Use a connector in Agent API requests
Section titled “Use a connector in Agent API requests”Add an entry to the tools array with type: "connector", id, and server_label. Authenticate the HTTP request with your Perplexity API key as usual.
Connector tools use deferred discovery by default: the model searches the tool catalog before calling. Set max_steps high enough for discovery plus execution. Set require_approval if you want human review before each connector call (same flow as MCP approvals; approval payloads include connector_id).
The response output array typically includes mcp_list_tools, tool_search_output, mcp_call, and a final message — see the Slack example in Connectors — Use a connector.
MCP tool: per-request remote servers vs saved connectors
Section titled “MCP tool: per-request remote servers vs saved connectors”The mcp tool attaches a user-supplied remote MCP server to a single Agent API request. Discovery runs at request start; tools are invoked like native tools during the run.
Beyond the function tools you define yourself, you can give a model new capabilities by connecting it to a remote Model Context Protocol (MCP) server. The model calls that server’s tools to reach and control external services when it needs them to answer a prompt.
— Perplexity, MCP
You can connect your own server in two ways:
type: "mcp"— provideserver_urland authentication on each request (requires Streamable HTTP).type: "connector"— use a connector ID from the API Console after saving the server once.
Custom connectors and the mcp tool do not provide Sandbox credential integration; some managed connectors (such as GitHub) do.
Authentication on the mcp tool
Section titled “Authentication on the mcp tool”For servers that require auth, pass an OAuth access token or other bearer material in the authorization field. Restrict exposure with allowed_tools when the model only needs a subset of server tools. The GitHub MCP example in MCP — Authentication uses GITHUB_MCP_TOKEN and allowed_tools.
defer_loading: when MCP schemas overwhelm context
Section titled “defer_loading: when MCP schemas overwhelm context”By default, every MCP tool definition enters the model’s initial context. Set defer_loading: true per server when catalogs are large or you attach several servers.
By default, every MCP tool definition the request exposes enters the model’s initial context. Set defer_loading to true when a server has many tools or large schemas, or when you connect several servers at once.
— Perplexity, MCP — Defer tool definitions
Deferred loading costs extra turns before the first tool call. Raise max_steps so the model can search the catalog and still call tools; otherwise a run may stop after search without calling anything. Connectors are deferred by default, so the same max_steps guidance applies to Connectors.
Approvals, trust, and allowed_tools
Section titled “Approvals, trust, and allowed_tools”Remote MCP servers are third-party services Perplexity has not verified. They can read, send, receive, and act in connected services under their own terms.
Connect only servers you trust. Calls run without approval by default. For tools that write data or take actions, set require_approval so you can review each call before it runs. Use allowed_tools to limit which server tools the model can call.
— Perplexity, MCP — Risks and safety
Hosted Perplexity MCP servers for clients (Cursor, Claude Code, VS Code)
Section titled “Hosted Perplexity MCP servers for clients (Cursor, Claude Code, VS Code)”Separate from Agent API request fields, Perplexity runs remote MCP servers that MCP clients attach in editor or assistant configuration.
API MCP Server: search and reasoning tools
Section titled “API MCP Server: search and reasoning tools”The Perplexity API MCP Server is hosted at https://api.perplexity.ai/mcp over Streamable HTTP.
The Perplexity MCP Server enables AI assistants to access Perplexity’s powerful search and reasoning capabilities directly within their workflows.
— Perplexity, Perplexity API MCP Server
Remote (recommended): no local install; connect with OAuth or an API key bearer token. Local: stdio via @perplexity-ai/mcp-server when the client only supports stdio or you must pin a version.
OAuth for the hosted server is documented in the changelog: add https://api.perplexity.ai/mcp to OAuth-capable clients (for example Claude Code, Cursor, VS Code) and sign in with your Perplexity account instead of pasting an API key; API keys remain for clients without OAuth.
Example remote configuration patterns from the same guide:
- Cursor — add to
~/.cursor/mcp.json, then connect under Settings → Tools & MCP (Perplexity MCP Server — Cursor). - Claude Code —
claude mcp add --transport http perplexity https://api.perplexity.ai/mcp(Claude Code). - VS Code —
.vscode/mcp.jsonwithtype: "http"and the same URL (VS Code). - Google Antigravity — global
~/.gemini/config/mcp_config.jsonwithserverUrlandAuthorization: Bearerheader (Antigravity integration).
Docs MCP Server: read-only documentation lookup
Section titled “Docs MCP Server: read-only documentation lookup”For in-editor answers grounded in current docs (no API key), Perplexity hosts a Docs MCP at https://docs.perplexity.ai/mcp. Perplexity with Cursor and Perplexity with Claude Code recommend combining application SDK usage with this server for documentation lookup — distinct from perplexity_search / perplexity_ask on the API MCP Server.
Computer MCP Server (separate product)
Section titled “Computer MCP Server (separate product)”Perplexity Computer MCP Server delegates multi-step real-world tasks to Perplexity Computer at https://www.perplexity.ai/rest/computer/mcp, with OAuth billing to your Perplexity account (not the same as API-key MCP search tools). Use it when you need long-running agent work, threading via thread_id, and interactive events — not when you only need Agent API connector / mcp fields.
Error handling: connector calls vs MCP discovery failures
Section titled “Error handling: connector calls vs MCP discovery failures”Behavior differs between connector tool calls and mcp discovery.
Connector mcp_call errors (run continues)
Section titled “Connector mcp_call errors (run continues)”A failed connector tool call sets error on the mcp_call item but does not fail the HTTP request; the model receives the error in-band.
A connector tool call can fail as an mcp_call item with an error field. This does not fail the request: the run continues and the error is passed to the model in-band, so the model still answers — it just cannot use that connector.
— Perplexity, Connectors — Error handling
| Value | Meaning | Suggested handling |
|---|---|---|
AUTH_REQUIRED |
Authorization lapsed or revoked | Reconnect on the Project connectors page |
INVALID_ARGUMENTS |
Tool rejected arguments | Model may retry |
POLICY_DENIED |
Policy blocked the call | Do not retry |
CONNECTOR_UNAVAILABLE |
Service unreachable | Retry later |
CONNECTOR_INTERNAL_ERROR |
Unusable response | Retry later |
TOOL_ERROR |
Other tool failure | Treat as tool failure |
Watch for connectors that list no tools ("tools": []) without an error — that also signals a broken connection. Log mcp_call errors in your harness; AUTH_REQUIRED is easy to miss because the overall request still returns 200.
MCP discovery failures (run may fail entirely)
Section titled “MCP discovery failures (run may fail entirely)”If tools cannot be listed at request start, discovery fails before the model runs.
| Case | What you see |
|---|---|
| Discovery failure | external_connector_error; without stream/background, HTTP 424 Failed Dependency and no output array |
| Tool-call failure | mcp_call with error set; request continues |
| Unresolved approval | invalid_request unless each pending approval gets a decision; HTTP 400 without stream/background |
A discovery failure happens when a server cannot be reached or returns an unusable response as its tools are listed at the start of the run. Because discovery runs before the model, the whole run fails with external_connector_error.
— Perplexity, MCP — Error handling
With stream: true or background: true, failures may still return HTTP 200 and end in response.failed.
Common mistakes when wiring MCP and connectors
Section titled “Common mistakes when wiring MCP and connectors”- Storing MCP tokens in application code while a Project connector already exists — use
type: "connector"and the saved ID from Connectors. max_stepstoo low with deferred connectors ordefer_loading: true— the model discovers tools but never calls them (MCP — Defer tool definitions).- Ignoring
AUTH_REQUIREDon connector calls because the API response “succeeded” (Connectors — Error handling). - Confusing Docs MCP with API MCP — docs lookup is
https://docs.perplexity.ai/mcp; search/ask tools usehttps://api.perplexity.ai/mcp(Cursor integration). - Expecting Sandbox credentials from custom connectors — only some managed connectors expose Sandbox integration (MCP — Overview).
- Pointing chat-only BYOK overrides at Agent API — Cursor’s OpenAI-compatible override targets Chat Completions, while Agent API uses Responses (Perplexity with Cursor); use SDK/MCP paths instead.
Testing your own remote MCP in Cursor
Section titled “Testing your own remote MCP in Cursor”For a server you deploy (for example on Cloudflare Workers), remote HTTP MCP in Cursor matches the pattern in Test a Remote MCP Server: add "url": "https://…/mcp" under mcpServers in .cursor/mcp.json or ~/.cursor/mcp.json.
How to check this on your site
Section titled “How to check this on your site”- In the Perplexity API Console, confirm managed or custom connectors show connected status and copy the connector ID you use in Agent API
tools. - Send a minimal Agent API request with
type: "connector"ortype: "mcp"and inspectoutputformcp_list_toolsand successfulmcp_callitems per Connectors and MCP. - In Cursor, open Settings → Tools & MCP and verify hosted servers from Perplexity MCP Server show ready status; for Claude Code run
claude mcp listper Perplexity with Claude Code. - Deliberately revoke or expire a connector auth, rerun a call, and confirm your logs catch
AUTH_REQUIREDonmcp_callitems as described in Connectors — Error handling. - You can check automatically in Answerwell (our tool): https://answerwell.org/workspace
Report an error or ask a question
Section titled “Report an error or ask a question”If something on this page is wrong or unclear, email yimasynthetic@gmail.com with the page URL and the exact statement you are asking about so it can be corrected or explained.