Skip to main content
Glama
Perplexity Agent MCP

Perplexity Agent MCP

by Jercik

Perplexity Agent MCP

Source: https://code.j4k.dev/j4k-oss/perplexity-agent-mcp. github.com/Jercik/perplexity-agent-mcp is a read-only mirror; open issues and pull requests on the Forge.

An opinionated, coding-specialized, Model Context Protocol server that integrates Perplexity AI's Sonar models into AI coding assistants like Claude Code or Codex CLI. It's deliberately lean and adds very few tokens to your context. It covers quick API fact-checks and deeper research; How it works describes the tools.

Setup

The package is published only as @j4k-oss/perplexity-agent-mcp on the code.j4k.dev registry. The unscoped perplexity-agent-mcp package on npmjs is deprecated and gets no updates.

Always map the @j4k-oss scope to the code.j4k.dev registry: without a mapping, npm looks on npmjs, finds nothing, and fails with a 404. To do that once for every command, add this line to ~/.npmrc:

@j4k-oss:registry=https://code.j4k.dev/api/packages/j4k-oss/npm/

The inline flag in the commands below is enough for a single npx run. Keep the ~/.npmrc line for the global install: npm update -g and npm outdated -g read the registry from your configuration, so without the line they look the scoped name up on npmjs.org. Install the package globally:

npm install -g --@j4k-oss:registry=https://code.j4k.dev/api/packages/j4k-oss/npm/ @j4k-oss/perplexity-agent-mcp

If you installed the unscoped package globally, run npm uninstall -g perplexity-agent-mcp (or pnpm remove -g perplexity-agent-mcp) first: both packages provide the perplexity-agent-mcp command, npm refuses to overwrite it, and pnpm keeps running the old copy. To check the latest release without installing it:

npx -y --@j4k-oss:registry=https://code.j4k.dev/api/packages/j4k-oss/npm/ @j4k-oss/perplexity-agent-mcp@latest --version

In a pnpm project, map the scope to its registry and exempt it from minimumReleaseAge in pnpm-workspace.yaml, then add the package:

registries:
  "@j4k-oss": https://code.j4k.dev/api/packages/j4k-oss/npm/
minimumReleaseAgeExclude:
  - "@j4k-oss/*"
pnpm add -D @j4k-oss/perplexity-agent-mcp

The package installs the perplexity-agent-mcp command and reports the MCP server name perplexity-agent-mcp.

Then add it to your Claude config file (~/.claude.json or ~/.config/claude/config.json):

"mcpServers": {
  "perplexity": {
    "command": "perplexity-agent-mcp",
    "env": {
      "PERPLEXITY_API_KEY": "your-api-key-here"
    }
  }
}

Restart Claude Code after saving, and you're ready to go.

How it works

The server exposes only two tools with concise descriptions (~1.3K tokens), keeping your context window lean and efficient:

  • lookup: Gets quick facts from documentation (like API syntax or config keys)

  • answer: Does deeper research to compare options and make recommendations

Under the hood, both tools are opinionated wrappers that call Perplexity API with coding-specialized system prompts. The lookup tool uses a compact fact‑extraction prompt focused on code/docs facts. The answer tool uses a technical decision/analysis prompt tailored for migrations and architecture choices. Each tool calls a fixed Perplexity model chosen for its task, and callers cannot select another.

Example AI agent prompt that will trigger AI agent to use this MCP and give you good results:

Please update the "foo" dependency to the latest version. Use Perplexity for the migration guide.

Requirements

  • Node.js 26.0.0 or newer

  • A Perplexity API key

Available Tools

2 tools
answerA

Research a question, compare options, and recommend a path (backed by sources). Use for library choices, architecture trade-offs, migrations, complex debugging, and performance decisions. Returns a concise recommendation, a brief why, and short how-to steps.

Inputs: question (required).

lookupA

Fetch precise, source-backed facts from official sources. Use for API syntax/params, config keys/defaults, CLI flags, runtime compatibility, and package metadata (types, ESM/CJS, side-effects). Returns short, factual answers. No recommendations or comparisons.

Inputs: query (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 2 tools

    Disambiguation5/5

    The two tools have clearly distinct purposes: 'answer' is for research, comparison, and recommendations on complex decisions, while 'lookup' is for fetching precise, factual information from official sources. There is no overlap in functionality, as one provides recommendations and the other provides facts without recommendations.

    Naming Consistency5/5

    Both tool names follow a consistent, simple verb-based pattern ('answer' and 'lookup') that clearly indicates their actions. There are no deviations in naming conventions, making them predictable and easy to understand.

    Tool Count3/5

    With only two tools, the set feels thin for a server named 'Perplexity Agent MCP', which suggests a broader scope for handling queries and research. While the tools cover distinct areas, more operations (e.g., for follow-up queries or deeper analysis) might be expected to fully support agent workflows.

    Completeness3/5

    The tools cover two key areas—complex decision-making and factual lookups—but there are notable gaps. For instance, there are no tools for updating or managing research sessions, handling multi-step interactions, or integrating with external data sources beyond the described lookups, which could limit agent effectiveness in extended tasks.

    Maintenance

    ActivityActive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides access to Perplexity AI models through two tools: ask\_perplexity for expert programming assistance and chat\_perplexity for maintaining ongoing conversations with context preservation.
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Provides AI-powered search, research, and reasoning capabilities through integration with Perplexity.ai, offering three specialized tools: general conversational AI, deep research with citations, and advanced reasoning.
      16 npm
      2
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Integrates with Perplexity's API to provide web search and AI-powered answers with citations. Offers a three-tier research workflow: search for sources, ask for grounded AI answers, and ask_more for deeper analysis using advanced models.
      -