The official TypeScript library for the Perplexity API
Perplexity Ai MCP server is a locally run integration for AI assistants that speak the Model Context Protocol. The official TypeScript library for the Perplexity API.
This library provides convenient access to the Perplexity REST API from server-side TypeScript or JavaScript.
The server ships on npm as @perplexity-ai/perplexity_ai, so your MCP client can launch it on demand — there is no separate build step. Add the server block to your client's configuration, restart it, and the tools register themselves.
Once Perplexity Ai is connected, these are the calls the assistant has available:
Retries — Certain errors will be automatically retried 2 times by default, with a short exponential backoff. Connection errors (for example, due to a networkTimeouts — Requests time out after 15 minutes by default. You can configure this with a timeout option:Logging — The Logging tool exposed by this serverYou will need one environment variable: PERPLEXITY_API_KEY. The server will not start without them, which is usually why the tools fail to appear on a first run. Keep credentials in your client's env block or a secrets manager rather than in a file you might commit.
TypeScript >= 5.0 is supported.
Plenty of developer tooling servers cover similar ground. The differences that matter in practice are scope of access and how much setup stands between you and a working tool call. Perplexity Ai's toolset — Retries, Timeouts, Logging — is a fair guide to whether it matches your workflow. It is maintained by GitHub Actions; worth a glance at recent repository activity before you build anything load-bearing on it.
We check each listing at SyncDev against the project's documentation before it goes live — if something here drifts out of date, it is a bug worth reporting.
| Tool | What it does |
|---|---|
| Retries | Certain errors will be automatically retried 2 times by default, with a short exponential backoff. Connection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict, 429 Rate Limit |
| Timeouts | Requests time out after 15 minutes by default. You can configure this with a timeout option: |
| Logging | The Logging tool exposed by this server. |
{
"mcpServers": {
"perplexity-ai": {
"command": "npx",
"args": ["-y", "@perplexity-ai/perplexity_ai"],
"env": {
"PERPLEXITY_API_KEY": "your-value"
}
}
}
}Add to claude_desktop_config.json, then restart Claude Desktop.
TypeScript >= 5.0 is supported.
| Variable | Description | Required |
|---|---|---|
| PERPLEXITY_API_KEY | Credential the server authenticates with. | Yes |
Kill hallucinated APIs — version-accurate, up-to-date library documentation injected straight into context.
Microsoft's official browser automation server — drive a real browser through the accessibility tree, no screenshots needed.
GitHub's official server — repos, issues, pull requests, Actions and code security, straight from your assistant.
Issue tracking at the speed of conversation — Linear's official hosted server with OAuth and zero install.
Local repository surgery — status, diffs, commits, branches and history for any repo on disk.
Timezone sanity for AI — current time anywhere and correct conversions, without the model doing date math.