# wynandw87/claude-code-perplexity-mcp architecture

> Architecture diagram of the GitHub repository wynandw87/claude-code-perplexity-mcp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/wynandw87/claude-code-perplexity-mcp
- Repository: https://github.com/wynandw87/claude-code-perplexity-mcp

## Overview

Perplexity MCP Server exposes Perplexity search, research, reasoning, analysis, and file-upload tools to Claude Code over MCP. The main workflow is a tool request handled by the server, which delegates to a Perplexity client and returns text, citations, or ranked results. Tool-specific stages include raw search, deep research, reasoning search, code review, brainstorming, and explanations. Configuration supplies the API key, model defaults, and timeout. Source excerpts show the server setup and several client calls; other documented capabilities are included, but their individual handlers are not fully visible.

Main entry points: [`src/index.ts`](https://github.com/wynandw87/claude-code-perplexity-mcp/blob/main/src/index.ts) (MCP server), [`src/perplexity-client.ts`](https://github.com/wynandw87/claude-code-perplexity-mcp/blob/main/src/perplexity-client.ts) (Perplexity client), [`src/config.ts`](https://github.com/wynandw87/claude-code-perplexity-mcp/blob/main/src/config.ts) (Configuration), [`src/prompts.ts`](https://github.com/wynandw87/claude-code-perplexity-mcp/blob/main/src/prompts.ts) (Prompt templates)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mcp["MCP server"]
  node_server["MCP server<br/>[index.ts]"]
end

subgraph group_research["Search and research"]
  node_ask["Ask<br/>[index.ts]"]
  node_websearch["Web search<br/>[index.ts]"]
  node_deepresearch["Deep research<br/>[index.ts]"]
  node_reasoning["Reasoning search<br/>[index.ts]"]
  node_rawsearch["Raw search<br/>[index.ts]"]
end

subgraph group_analysis["Text and files"]
  node_review["Code review<br/>[index.ts]"]
  node_brainstorm["Brainstorm<br/>[index.ts]"]
  node_explain["Explain<br/>[index.ts]"]
  node_upload["File analysis<br/>[index.ts]"]
  node_prompts["Prompt templates<br/>[prompts.ts]"]
end

subgraph group_integration["Client and configuration"]
  node_client["Perplexity client"]
  node_config["Configuration<br/>[config.ts]"]
end

node_claude(("Claude Code"))
node_api["Perplexity API"]

node_claude -->|"sends MCP requests"| node_server
node_server -->|"dispatches tools"| node_ask
node_server -->|"dispatches tools"| node_websearch
node_server -->|"dispatches tools"| node_deepresearch
node_server -->|"dispatches tools"| node_reasoning
node_server -->|"dispatches tools"| node_rawsearch
node_server -->|"dispatches tools"| node_review
node_server -->|"dispatches tools"| node_brainstorm
node_server -->|"dispatches tools"| node_explain
node_server -->|"dispatches tools"| node_upload
node_server -->|"calls operations"| node_client
node_server -->|"loads settings"| node_config
node_server -->|"uses templates"| node_prompts
node_client -->|"uses API settings"| node_config
node_client -->|"sends requests"| node_api

click node_server "https://github.com/wynandw87/claude-code-perplexity-mcp/blob/main/src/index.ts"
click node_ask "https://github.com/wynandw87/claude-code-perplexity-mcp/blob/main/src/index.ts"
click node_websearch "https://github.com/wynandw87/claude-code-perplexity-mcp/blob/main/src/index.ts"
click node_deepresearch "https://github.com/wynandw87/claude-code-perplexity-mcp/blob/main/src/index.ts"
click node_reasoning "https://github.com/wynandw87/claude-code-perplexity-mcp/blob/main/src/index.ts"
click node_rawsearch "https://github.com/wynandw87/claude-code-perplexity-mcp/blob/main/src/index.ts"
click node_review "https://github.com/wynandw87/claude-code-perplexity-mcp/blob/main/src/index.ts"
click node_brainstorm "https://github.com/wynandw87/claude-code-perplexity-mcp/blob/main/src/index.ts"
click node_explain "https://github.com/wynandw87/claude-code-perplexity-mcp/blob/main/src/index.ts"
click node_upload "https://github.com/wynandw87/claude-code-perplexity-mcp/blob/main/src/index.ts"
click node_prompts "https://github.com/wynandw87/claude-code-perplexity-mcp/blob/main/src/prompts.ts"
click node_client "https://github.com/wynandw87/claude-code-perplexity-mcp/blob/main/src/perplexity-client.ts"
click node_config "https://github.com/wynandw87/claude-code-perplexity-mcp/blob/main/src/config.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_server toneBlue
class node_ask,node_websearch,node_deepresearch,node_reasoning,node_rawsearch toneAmber
class node_review,node_brainstorm,node_explain,node_upload,node_prompts,node_api toneMint
class node_client,node_config toneRose
class node_claude toneIndigo
```

## Components

### MCP server

- [MCP server](https://github.com/wynandw87/claude-code-perplexity-mcp/blob/main/src/index.ts): `src/index.ts`

### Search and research

- [Ask](https://github.com/wynandw87/claude-code-perplexity-mcp/blob/main/src/index.ts): `src/index.ts`
- [Web search](https://github.com/wynandw87/claude-code-perplexity-mcp/blob/main/src/index.ts): `src/index.ts`
- [Deep research](https://github.com/wynandw87/claude-code-perplexity-mcp/blob/main/src/index.ts): `src/index.ts`
- [Reasoning search](https://github.com/wynandw87/claude-code-perplexity-mcp/blob/main/src/index.ts): `src/index.ts`
- [Raw search](https://github.com/wynandw87/claude-code-perplexity-mcp/blob/main/src/index.ts): `src/index.ts`

### Text and files

- [Code review](https://github.com/wynandw87/claude-code-perplexity-mcp/blob/main/src/index.ts): `src/index.ts`
- [Brainstorm](https://github.com/wynandw87/claude-code-perplexity-mcp/blob/main/src/index.ts): `src/index.ts`
- [Explain](https://github.com/wynandw87/claude-code-perplexity-mcp/blob/main/src/index.ts): `src/index.ts`
- [File analysis](https://github.com/wynandw87/claude-code-perplexity-mcp/blob/main/src/index.ts): `src/index.ts`
- [Prompt templates](https://github.com/wynandw87/claude-code-perplexity-mcp/blob/main/src/prompts.ts): `src/prompts.ts`

### Client and configuration

- [Perplexity client](https://github.com/wynandw87/claude-code-perplexity-mcp/blob/main/src/perplexity-client.ts): `src/perplexity-client.ts`
- [Configuration](https://github.com/wynandw87/claude-code-perplexity-mcp/blob/main/src/config.ts): `src/config.ts`

### Other components

- **Claude Code**
- **Perplexity API**

## Connections

- Claude Code → MCP server: sends MCP requests (evidence: `README.md`)
- MCP server → Ask: dispatches tools (evidence: `src/index.ts`)
- MCP server → Web search: dispatches tools (evidence: `src/index.ts`)
- MCP server → Deep research: dispatches tools (evidence: `src/index.ts`)
- MCP server → Reasoning search: dispatches tools (evidence: `src/index.ts`)
- MCP server → Raw search: dispatches tools (evidence: `src/index.ts`)
- MCP server → Code review: dispatches tools (evidence: `README.md`)
- MCP server → Brainstorm: dispatches tools (evidence: `README.md`)
- MCP server → Explain: dispatches tools (evidence: `README.md`)
- MCP server → File analysis: dispatches tools (evidence: `README.md`)
- MCP server → Perplexity client: calls operations (evidence: `src/index.ts`)
- MCP server → Configuration: loads settings (evidence: `src/index.ts`)
- MCP server → Prompt templates: uses templates (evidence: `src/index.ts`)
- Perplexity client → Configuration: uses API settings (evidence: `src/perplexity-client.ts`)
- Perplexity client → Perplexity API: sends requests (evidence: `src/perplexity-client.ts`)
