Get started
Install and connect the PcapAI MCP server
Tested with Claude Code 2.1.326, Cursor 3.32.10, Codex CLI 0.172.0 and VS Code 1.148.0 · Updated
There is nothing to install on your machine: the PcapAI MCP server runs at https://pcapai.com/mcp. You create a personal token, keep it in an environment variable, and add one entry to your agent's configuration. It takes about five minutes, and the last step checks that it works.
Before you start
Any PcapAI account can connect, including a free one; you only pay when you unlock the details of a capture. The agent must be able to run shell commands, because it uploads the capture itself with curl (and, if you ask, takes the capture with tcpdump). Claude Code, Cursor, Codex and VS Code with GitHub Copilot can; the chat apps cannot yet.
| Account | Largest capture |
|---|---|
| No plan, or credit packs | 20 MB |
| Starter | 25 MB |
| Pro | 50 MB |
| Advanced | 100 MB |
Every account gets 20 analyses a day, 3 at a time and 60 requests a minute, for uncompressed .pcap or .pcapng files. Wi-Fi captures in monitor mode (radiotap), USB and Bluetooth captures are not supported. A larger capture can be split or trimmed with editcap before the agent uploads it; the troubleshooting page shows how.
Connect in four steps
-
1Create a token
Sign in at pcapai.com (a free account works), open the MCP Server section of your profile and create a token. Give it a name you will recognize, choose when it expires and whether the agent may spend report credits. Copy the token at once: it starts with pcapai_pat_ and is shown only once.
No account yet? Sign up free, then come back to this step.
Open Profile → MCP Server and fill in the form. The Report credits choice decides what the token may do:
Report credits The agent can Scopes Ask before each unlock (default) Upload, read free summaries, and unlock after you say yes in the chat analyses:read analyses:write credits:spend Unlock without asking Unlock as soon as it decides to, for scripts and CI; every analysis it unlocks uses a credit the same Never spend credits Upload and read free summaries; any unlock is refused analyses:read analyses:write A token expires after 30 days, 90 days (the default) or a year, and an account can hold ten. PcapAI keeps only a hash of it, so if you lose the value, revoke it and create a new one.
-
2Keep it in an environment variable
Store the token as PCAPAI_TOKEN in your shell's environment, not in a file you share or commit. The commands below keep it in the macOS Keychain, in a file only you can read on Linux, or in your Windows user environment.
Terminal (macOS, zsh)# Keep the token in the Keychain (paste it when asked) security add-generic-password -a "$USER" -s pcapai-mcp -w # Load it into every new shell echo 'export PCAPAI_TOKEN="$(security find-generic-password -a "$USER" -s pcapai-mcp -w)"' >> ~/.zshrcTerminal (Linux, bash)# A file only you can read (paste the token when asked) install -m 600 /dev/null ~/.pcapai-token read -rs -p "Token: " t && printf '%s' "$t" > ~/.pcapai-token && unset t # Load it into every new shell echo 'export PCAPAI_TOKEN="$(cat ~/.pcapai-token)"' >> ~/.bashrcPowerShell[Environment]::SetEnvironmentVariable("PCAPAI_TOKEN", (Read-Host "Token"), "User")Open a new terminal afterwards, so the variable is loaded. Desktop apps started from the macOS Dock do not read your shell files; the Cursor guide shows two ways to hand them the token.
-
3Add the server to your agent
Add the server https://pcapai.com/mcp to your agent's configuration, with your token in the Authorization header. Pick your agent below: each tab has the exact command or file and a link to the full guide.
Claude Code
Terminalclaude mcp add --transport http --scope user pcapai https://pcapai.com/mcp \ --header "Authorization: Bearer $PCAPAI_TOKEN"The shell fills in the token when you run the command, and Claude Code keeps it in
~/.claude.json. Claude Code guideCursor
~/.cursor/mcp.json{ "mcpServers": { "pcapai": { "url": "https://pcapai.com/mcp", "headers": { "Authorization": "Bearer ${env:PCAPAI_TOKEN}" } } } }Cursor reads
PCAPAI_TOKENfrom its own environment when it starts. Cursor guideCodex
Terminalcodex mcp add pcapai --url https://pcapai.com/mcp --bearer-token-env-var PCAPAI_TOKENThe command writes three lines to
~/.codex/config.toml; Codex reads the variable when it starts and needs network access in its sandbox for the upload. Codex guideVS Code
.vscode/mcp.json{ "inputs": [ { "type": "promptString", "id": "pcapai-token", "description": "PcapAI MCP token (starts with pcapai_pat_)", "password": true } ], "servers": { "pcapai": { "type": "http", "url": "https://pcapai.com/mcp", "headers": { "Authorization": "Bearer ${input:pcapai-token}" } } } }VS Code asks for the token the first time the server starts. VS Code details
Other
Connection detailsURL https://pcapai.com/mcp Transport Streamable HTTP (POST, JSON answers, no session) Header Authorization: Bearer <your pcapai_pat_ token>Any client that speaks MCP over streamable HTTP and can send this header works. Requirements
-
4Check the connection
Restart the agent and ask: "Show my PcapAI account". It calls get_account and answers with your plan, the report credits left, your capture size limit and the analyses left today. If it cannot connect, the troubleshooting page lists every error with its fix.
To test the token without an agent, ask the server directly.
405means the token was accepted (the endpoint only takes POST);401means it is missing or wrong.Terminalcurl -s -o /dev/null -w "%{http_code}\n" \ -H "Authorization: Bearer $PCAPAI_TOKEN" https://pcapai.com/mcp
VS Code and other clients
VS Code connects through GitHub Copilot's agent mode. Put the file above in .vscode/mcp.json of a workspace, or run MCP: Open User Configuration from the Command Palette to add the same entry for every workspace. Then run MCP: List Servers, pick pcapai and start it: VS Code asks for the token once, keeps it in its secret storage, and the server starts with ten tools. Because of that prompt, the token never sits in the file and no environment variable is needed. Ask in plain words in agent mode. VS Code does not show the server's prompts, so the slash commands of Claude Code are not available there; every request works without them.
Other clients need three things: MCP over streamable HTTP (the server is stateless and answers plain JSON, so clients that expect a session or server-sent events still work), a way to send the Authorization header with a static value, and a shell the agent can run curl in. The connection details:
URL https://pcapai.com/mcp
Transport Streamable HTTP (POST, JSON answers, no session)
Header Authorization: Bearer <your pcapai_pat_ token>
The server speaks the MCP protocol versions 2024-11-05, 2025-03-26, 2025-06-18, 2025-11-25 and 2026-07-28. Claude.ai, the chat in Claude Desktop and ChatGPT add remote servers through a sign-in window in the browser and cannot connect with a token; that sign-in comes later.
Rotate, revoke or remove
To replace a token before it expires, create a new one, put it in PCAPAI_TOKEN and restart the agent; Claude Code users run the claude mcp add command again, because Claude Code stored the old value. Then revoke the old token in your profile: every agent that still uses it loses access at once. Revoking is also the answer if a token may have leaked, for example into a repository or a shared terminal log.
To remove the server, delete the pcapai entry from ~/.cursor/mcp.json, ~/.codex/config.toml or .vscode/mcp.json, or run this in Claude Code:
claude mcp remove --scope user pcapai
Removing the server does not delete your analyses; ask the agent to delete them first, or let analyses you did not unlock expire after 24 hours. What PcapAI keeps and for how long is on security, tokens and data handling.
Was this page helpful?
Thanks. Missing something? Tell us what.