Borrowing it
Nothing to install: this file belongs to zalez/perplexity-agent-mcp. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.
curl -O https://raw.githubusercontent.com/zalez/perplexity-agent-mcp/main/CLAUDE.mdgit clone --depth 1 https://github.com/zalez/perplexity-agent-mcpWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/instructions/zalez/perplexity-agent-mcp/claude-md)<a href="https://agentmods.dev/instructions/zalez/perplexity-agent-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/zalez/perplexity-agent-mcp/claude-md/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/instructions/zalez/perplexity-agent-mcp/claude-md"><img src="https://agentmods.dev/badge/instructions/zalez/perplexity-agent-mcp/claude-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.05496 | $0.05496 |
| Opus 5.5 | $0.02198 | $0.02198 |
| Sonnet 5.5 | $0.01099 | $0.01099 |
| Haiku 4.5 | $0.00550 | $0.00550 |
Grade A, and why
perplexity-agent-mcp CLAUDE.md scanned grade A with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Makes network callslowCapability
Not a fault in itself. Listed so you know the mod talks to something, and to what.
ergonomic than `urllib.request`. This project's entire pitch is **zero How it starts
The opening of the file, as written. The whole thing — 291 lines — stays where its author put it; the contents beside it link to each section on GitHub.
Working on perplexity-agent-mcp
This file is guardrails for an agent contributing to this repository, not a summary of what it does — read README.md for that. It exists because this project has a specific, easy-to-trip failure mode: a well-intentioned change that looks like an obvious improvement and quietly breaks the one property the whole repo exists to have. Two concrete examples that would each pass a casual glance:
- Adding
requests(or any other third-party package) because it's more ergonomic thanurllib.request. This project's entire pitch is zero runtime dependencies — see SECURITY.md for why that's a security property, not a style preference. - Adding a
print()for debugging and forgetting to remove it, or having any code path write to the real stdout. stdout is the JSON-RPC protocol stream; one stray line corrupts it, and the client-side symptom is a baffling parse error, not an obvious crash.
Both are mechanically caught before merge (tests/test_no_dependencies.py;
the stdout-rebind + tests/test_no_secrets.py), but catching a mistake in
CI is worse than not making it. This file exists so you don't make it.
Also read: CONTRIBUTING.md for the contributor workflow,
SECURITY.md for the full threat model, and
docs/specs/2026-07-22-perplexity-agent-mcp-design.md
for the original design rationale. If any of those, or this file, disagree
with perplexity_agent_mcp.py itself, the code is correct and the doc is
stale — fix the doc, don't trust it over the source.
1. Hard invariants
Every one of these applies to every change, no exceptions without discussing it with the maintainer first. Quoted from the implementation plan's Global Constraints:
- Zero third-party runtime dependencies in the server, and no extras
either. stdlib only. No
requirements.txt, no MCP SDK, nopip installfor users. Thellmadapter has dependencies, but it is a separate distribution built fromllm-plugin/— installing the server never pulls it in. Enforced bytests/test_no_dependencies.py, which allows the adapter exactly two dependencies and the server none. - Python floor
>=3.10. Nomatchstatements requiring 3.11+, notomllibin the server itself (3.11+), no PEP 695 generics. Develop on 3.14.6; CI matrix covers 3.10–3.14. - Single outbound host:
https://api.perplexity.aionly. Hardcoded constant. No environment-variable base-URL override — it is an API-key exfiltration vector (SECURITY.md §Network). - The API key is never printed, logged, echoed, or attached to an
exception. Read from
PERPLEXITY_API_KEYat call time, not import time. - stdout is exclusively JSON-RPC. All logging goes to stderr.
main()calls_claim_stdout(), which grabs the real stdout and pointssys.stdoutat stderr. It is deliberately NOT an import-time side effect: thellmadapter imports this module, and hijacking stdout on import would redirect that whole program's output. Don't move it back. - Two MCP protocol revisions, one process. Modern
2026-07-28(stateless, no handshake) and legacy2025-11-25/2025-06-18/2025-03-26. Era is decided per request, structurally — never by a flag, a setting, or state carried from an earlier request. The three precedence rules live aboveHANDLERSin the source; that comment is the authority, not this line. - Never error on version negotiation — in
initializeonly. Echo the requested legacy version on a match, else return2025-11-25. The modern path has the opposite rule and MUST return-32022for a revision it does not speak. Do not unify these two. They are pinned by tests from opposite sides precisely because unifying them looks like a tidy-up. 2026-07-28must never enterSUPPORTED_PROTOCOL_VERSIONS, which is the legacy-negotiable set. It is derived from the tail ofADVERTISED_PROTOCOL_VERSIONSso this is impossible rather than merely forbidden; keep the derivation.- Validation errors are
isError: true, never JSON-RPC-32602(SEP-1303 — see §3 below). - Line length 100. Ruff-formatted.
mypy --strictclean. Every public function annotated. - Comment density is high by design. This file's product is auditability; a reader must follow it top to bottom without cross-referencing.
- Copyright:
Copyright (c) 2026, Constantin Gonzalez. License: BSD-3-Clause. - Never claim cancellation reduces the bill — in code comments, tool descriptions, or docs.
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago Changed c13d3cf9eeea
- 1mo ago Changed · +4 lines · +93 tokens per session 7adf650b3897
- 1mo ago Changed ce39d51e4e4e
- 2mo ago Changed 5341c582f910
- 2mo ago First seen · 287 lines · 5,403 tokens per session scan A 47c7d26b0e30
perplexity-agent-mcp CLAUDE.md is an instructions file published in the GitHub repository zalez/perplexity-agent-mcp (0 stars, last pushed 2d ago), licensed BSD-3-Clause. It adds 5,496 tokens to every session, about $0.0220 per session on Opus 5.5. A static security scan graded it A with 1 finding (makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.
perplexity-agent-mcp CLAUDE.md compared with instructions from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| perplexity-agent-mcp CLAUDE.mdzalez/perplexity-agent-mcp | Instructions file | 0 | 2d ago | BSD-3-Clause | A | 5,496 | Claude Code |
| vscode buildNext.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 9,719 | GitHub Copilot |
| next.js AGENTS.mdvercel/next.js | Instructions file | 143k | yesterday | MIT | A | 7,461 | Codex, OpenCode |
| langchain AGENTS.mdlangchain-ai/langchain | Instructions file | 149k | yesterday | MIT | A | 4,680 | Codex, OpenCode |
| vscode oss-third-party-notices.instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 5,516 | GitHub Copilot |
| vscode copilot-instructions.mdmicrosoft/vscode | Instructions file | 195k | yesterday | MIT | A | 3,093 | GitHub Copilot |
| deepseek-harness AGENTS.mddeepseek-ai/deepseek-harness | Instructions file | 274k | 2d ago | MIT | A | 4,313 | Codex, OpenCode |