How to integrate Perplexityai MCP with Codex

Connect Codex to Perplexityai MCP. Summarize the latest ai research papers, generate a creative story about space travel, and more using natural language, with authentication handled for you.

Perplexityai logoPerplexityai
Api Key

Perplexityai delivers natural, conversational AI models for generating human-like text. Instantly get context-aware, high-quality responses for chat, search, or complex workflows.

28 Tools

Introduction

Codex is one of the most popular coding harnesses out there. And MCP makes the experience even better. With the Perplexityai MCP integration, Codex can run chat completions, search the web, create embeddings, execute agents, and check your usage analytics, all without leaving the terminal or the app, whichever you prefer.

For exact tool slugs and parameter tables, see the tool catalog in the Composio docs.

Also integrate Perplexityai with

Why use Composio?

Apart from a managed and hosted MCP server, you will get:

  • CodeAct: A dedicated workbench that allows GPT to write its code to handle complex tool chaining. Reduces to-and-fro with LLMs for frequent tool calling.
  • Large tool responses: Handle them to minimise context rot.
  • Dynamic just-in-time access to 20,000 tools across 1700+ other Apps for cross-app workflows. It loads the tools you need, so GPTs aren't overwhelmed by tools you don't need.

How to install Perplexityai MCP in Codex

Run the setup command

Run this command in your terminal to add the Composio MCP server to Codex.

Terminal

It will initiate the authentication in a browser window, authorize Codex to access your Composio account.

Composio authentication page

(Optional) Authenticate with OAuth

To authenticate manually, run the login command to open a browser window and authorize Codex to access your Composio account.

bash
codex mcp login composio

Verify the connection

Run codex mcp list to confirm Composio appears as a registered MCP server.

bash
codex mcp list

Codex App

Codex App follows the same approach as VS Code.

  1. Click ⚙️ on the bottom left → MCP Servers → + Add servers → Streamable HTTP:
  2. Fill the header and Key fields with { "x-consumer-api-key" = "ck_*******" }.
  3. The Key is the Composio API key, that you can find on dashboard.composio.dev
  4. Click on Authenticate and authorize Codex to your Composio account and you're all set.
Codex App MCP setup
  1. Restart and verify if it's there in .codex/config.toml
bash
[mcp_servers.composio]
url = "https://connect.composio.dev/mcp"
http_headers = { "x-consumer-api-key" = "ck_*******" }

Try it

Ask Codex for a Perplexityai task. The first time, Composio asks you to connect your Perplexityai account.

For example, ask it to:

  • "Summarize the latest AI research papers"
  • "Generate a creative story about space travel"
  • "Explain quantum computing in simple terms"

What is the Perplexityai MCP server, and what's possible with it?

The Perplexity AI MCP server is an implementation of the Model Context Protocol that connects your AI agent and assistants like Claude, Cursor, etc directly to your Perplexity AI account. It provides structured and secure access to Perplexity AI's conversational models, web search, embeddings, and agent execution, so your agent can search the web, generate responses, run Perplexity agents, create embeddings, and manage asynchronous chat requests on your behalf.

  • Web search: Have your agent search the web and return relevant results for research, fact-finding, or current topics.
  • Conversational responses: Let the agent use Perplexity Sonar models to answer questions, explain topics, and generate human-like text.
  • Asynchronous chat tasks: Direct your agent to start longer chat requests, check their progress, and review previously submitted requests.
  • Perplexity agent execution: Instruct your agent to run a Perplexity agent for tasks that need an agent-generated response.
  • Text embeddings and model discovery: Have your agent create standard or contextualized embeddings for text and view the Perplexity models available to your account.

Conclusion

You've successfully integrated Perplexityai with Codex using Composio's MCP server. Now you can interact with Perplexityai directly from your terminal, VS Code, or the Codex App using natural language commands.

Key benefits of this setup:

  • Seamless integration across CLI, VS Code, and standalone app
  • Natural language commands for Perplexityai operations
  • Managed authentication through Composio
  • Access to 20,000+ tools across 1700+ apps for cross-app workflows
  • CodeAct workbench for complex tool chaining

Next steps:

  • Try asking Codex to perform various Perplexityai operations
  • Explore cross-app workflows by connecting more toolkits
  • Build automation scripts that leverage Codex's AI capabilities
TOOLS

Supported Tools

Every Perplexityai action and event your agent gets out of the box.

Cancel Agent Response

Request cancellation of an existing durable agent response.

Create Async Chat Completion

Create Async Chat Completion (POST /v1/async/sonar).

Create Chat Completion

Generate a chat-compatible response from conversation messages, with optional search controls.

Create Contextualized Embeddings

Create Contextualized Embeddings (POST /v1/contextualizedembeddings).

CreateEmbeddings

Generate vector embeddings for independent texts (queries, sentences, documents).

Create Orchestrator Chat Completion

Create a non-streaming OpenAI-compatible chat completion using a cataloged Orchestrator model.

Create Orchestrator Message

Create a non-streaming Anthropic-compatible message using an Orchestrator catalog model.

CreateOrchestratorResponse

Generate a non-streaming model response through the Perplexity Orchestrator using a creator/model-name catalog ID, input text or structured items, optional tools, and structured output settings.

Create Skill

Create a Project-owned skill from a ZIP bundle containing SKILL.

Delete Skill

Delete a skill only if its current revision matches expected_revision.

Download Agent Response File

Download a file delivered by an Agent response's share_file tool.

Evaluate Decisions

Evaluate named yes/no, choice, and score questions against shared content.

Execute Agent

Create Agent Response (POST /v1/agent).

Get Agent Response

Retrieve a stored Agent response as a JSON snapshot (GET /v1/agent/{id}).

Get Async Chat Completion

Get Async Chat Completion (GET /v1/async/sonar/{id}).

Get Member Usage Analytics

Get organization Perplexity usage per member in daily UTC buckets.

Get Orchestrator Model

Retrieve one Orchestrator model by its full provider/model id.

Get Skill

Get a skill's metadata by identifier, optionally at a specific revision.

Get Skill Download URL

Get a short-lived URL to download a skill bundle as a ZIP, optionally for a specific revision; omit the revision to select the active revision.

Get Usage Analytics

Get an organization's Perplexity Computer usage as a bucketed time series.

List Agent Response Files

List files an agent response delivered from its sandbox using share_file.

List Async Chat Completions

List a page of legacy asynchronous Sonar chat completion requests for the authenticated user, including their statuses.

List Models

List Models (GET /v1/models).

List Orchestrator Models

List available Orchestrator API models sorted by id, with base token prices.

List Skill Revisions

List a skill's revisions, newest first.

List Skills

List skills in the authenticated Project, newest first.

Perplexity Search (Raw Results)

Search the Web (POST /search).

Update Skill

Upload a new ZIP bundle as a revision of an existing Project-owned skill.

FAQ

Frequently asked questions

Start with Perplexityai.It takes 30 seconds.

Managed auth, hosted MCP servers, and every Perplexityai tool your agent needs.Free to start.

Start building