VOOZH about

URL: https://deepwiki.com/ppl-ai/modelcontextprotocol/6.3-windsurf-and-codex

⇱ Windsurf and Codex | ppl-ai/modelcontextprotocol | DeepWiki


Loading...
Last indexed: 28 February 2026 (95c7a8)
Menu

Windsurf and Codex

This page covers how to configure the @perplexity-ai/mcp-server for the Windsurf IDE and Codex CLI. Both use the stdio transport mode, but each has a different configuration mechanism.

For Cursor and VS Code configuration, see 6.2. For Claude Desktop, see 6.1. For a generic overview of stdio vs HTTP transport, see 6.4.


Overview

Both Windsurf and Codex launch the MCP server as a child process over stdio. The server entry point is src/index.ts, which reads PERPLEXITY_API_KEY, constructs a StdioServerTransport, and calls server.connect().

Configuration summary:

ClientMechanismConfig Location
WindsurfJSON config file (mcpServers block)~/.codeium/windsurf/mcp_config.json
CodexCLI command (codex mcp add)CLI-managed config

Windsurf

Configuration File

Windsurf reads MCP server definitions from ~/.codeium/windsurf/mcp_config.json. The structure is the same mcpServers wrapper used by Cursor and Claude Desktop README.md54-78


Replace your_key_here with a valid Perplexity API key obtained from the API portal.

Config Field Reference

FieldValueNotes
command"npx"Invokes the package runner
args[0]"-y"Auto-confirms npx install prompt
args[1]"@perplexity-ai/mcp-server"The published npm package
env.PERPLEXITY_API_KEYYour API keyRequired; validated at startup in src/index.ts

Optional Environment Variables

These can be added under the env block:

VariablePurposeDefault
PERPLEXITY_TIMEOUT_MSRequest timeout in ms300000 (5 min)
PERPLEXITY_LOG_LEVELLog verbosity (DEBUG/INFO/WARN/ERROR)ERROR
PERPLEXITY_BASE_URLOverride API base URLhttps://api.perplexity.ai
PERPLEXITY_PROXYOutbound HTTPS proxyNone

Strict Client Note

If Windsurf reports initialization errors or EOF during startup, npx may be writing installation progress messages to stdout, which corrupts the MCP framing. Switch to the quieter flag README.md177:


The -q flag suppresses npx output. See 11 for additional troubleshooting.

Sources: README.md54-78


Codex

CLI Installation Command

Codex provides a dedicated codex mcp add subcommand that registers an MCP server. The invocation mirrors the claude mcp add pattern README.md99-103:


Command breakdown:

PartMeaning
codex mcp add perplexityRegisters a server named perplexity
--env PERPLEXITY_API_KEY="your_key_here"Injects the API key as an environment variable
--Separator before the server launch command
npx -y @perplexity-ai/mcp-serverThe command Codex will spawn via stdio

Codex stores the resulting configuration in its own managed config file; no manual JSON editing is required.

Optional Environment Variables via CLI

Additional environment variables can be appended with repeated --env flags:


Sources: README.md99-103


How Both Clients Connect to the Server

The following diagram maps client configuration to the code execution path:

Diagram: stdio connection path for Windsurf and Codex


Sources: README.md54-78 README.md99-103 src/index.ts


Diagram: config key-to-code mapping


Sources: README.md54-78 README.md99-103


Comparison: Windsurf vs Codex vs Other Clients

AspectWindsurfCodexCursorClaude Desktop
Config mechanismJSON fileCLI commandJSON fileJSON file
Config file location~/.codeium/windsurf/mcp_config.jsonCLI-managed~/.cursor/mcp.jsonclaude_desktop_config.json
JSON wrapper keymcpServersN/AmcpServersmcpServers
Transportstdiostdiostdiostdio
-yq quiet flag may be neededPossiblyPossiblySee 6.2See 6.1

Sources: README.md54-78 README.md99-103