Help
Troubleshooting the PcapAI MCP server
Updated
When something goes wrong, the PcapAI MCP server says what and why in a message written for your agent, which usually recovers on its own. This page lists those messages by the step where they appear, word for word, with what to do when the agent cannot fix it alone.
Most problems are in the first step, the connection, and most of those are a token that never reached the server. If you have not set the server up yet, the install guide comes first; the codes in compact form are in the tools reference.
The agent cannot connect
The server checks the token before anything else, so a connection that fails at once is almost always the token: an empty environment variable, a token from the wrong place, or one that expired. The agent shows the server's message in its MCP status or logs.
To tell a token problem from a client problem, ask the server directly from the same shell. 405 means the token is fine and the problem is in the client's configuration; 401 means the token is missing, mistyped, revoked or expired.
curl -s -o /dev/null -w "%{http_code}\n" \
-H "Authorization: Bearer $PCAPAI_TOKEN" https://pcapai.com/mcp
missing_tokenHTTP 401
Send a PcapAI MCP token in the Authorization header (Bearer pcapai_pat_...). Create one at https://pcapai.com/profile#mcp.
What to do: No token reached the server: the variable was empty when the agent started, or the header is missing from the configuration. Run echo ${PCAPAI_TOKEN:0:11} in the shell that starts the agent; it must print pcapai_pat_. Then restart the agent.
invalid_tokenHTTP 401
This is not a PcapAI MCP token. Create one at https://pcapai.com/profile#mcp.
What to do: The value does not start with pcapai_pat_. The REST API token of the Advanced plan does not work here; create an MCP token in your profile.
invalid_tokenHTTP 401
The token is revoked, expired or unknown. Create a new one at https://pcapai.com/profile#mcp.
What to do: Tokens expire after 30 days, 90 days or a year, and a revoked token stops working at once. Create a new token, update PCAPAI_TOKEN and restart the agent.
Origin header is not allowedHTTP 403
Forbidden: Origin header is not allowed
What to do: The client sent a browser Origin header, which the server refuses to protect your account from web pages. Agents that run on your machine send none; tell PcapAI which client did, through the contact page.
The upload fails
upload_capture opens a signed link for exactly the file's size, and the agent's curl command sends the file there. Most upload errors mean that command did not run, ran too late or sent a different file; the agent can usually recover by calling upload_capture again.
too_largetool error
This capture is larger than this account's limit of 20.0 MB. Cut it down, for example with editcap or a shorter tcpdump.
What to do: The limit follows your plan: 20 MB without a plan or with credit packs, 25 MB on Starter, 50 MB on Pro, 100 MB on Advanced. Split the capture or keep fewer bytes per packet, as shown below.
upload_missingtool error
The file has not reached storage yet. Run the PUT (the curl command from upload_capture), then call analyze_capture again.
What to do: The curl command did not run or failed. In Codex the sandbox blocks network access unless you approve the command or allow it; in other agents, check that the command was approved.
expiredtool error
This upload expired: the link lives 15 minutes. Call upload_capture again.
What to do: The signed link works for 15 minutes. The agent opens a new one with upload_capture and uploads again.
size_mismatchtool error
The uploaded file doesn't have the size this upload was opened for. Upload it again.
What to do: The file changed after the agent measured it, or a different file was sent. Let the capture finish writing, then upload again.
not_a_capturetool error
The uploaded file is not a readable PCAP or PCAPNG capture. Upload an uncompressed .pcap or .pcapng file exported from Wireshark, tcpdump, tshark, or another packet capture tool.
What to do: Unpack archives (.zip, .gz) first, or export the capture again as .pcap or .pcapng in Wireshark.
To get under the size limit, split the capture or keep only the start of every packet; the headers are what the engine reads for most network problems. The guide to reducing a PCAP's size explains what each option keeps.
# Split into files of 200,000 packets each
editcap -c 200000 big.pcapng part.pcapng
# Or keep only the first 128 bytes of every packet
editcap -s 128 big.pcapng small.pcapng
The analysis does not finish
The free summary usually takes about two minutes. The tools wait up to 25 seconds per call, then answer processing, and the agent asks again with get_analysis. An analysis that is still not done after ten minutes is marked failed.
processingstatus
The engine is still working on the capture. Call get_analysis again in about 10 seconds.
Not an error: the free summary is not ready yet. The agent asks again.
failedstatus
The analysis did not finish: the file may be damaged or not a capture the engine reads. Upload it again, or try it at https://pcapai.com/analyze-pcap.
What to do: Wi-Fi captures in monitor mode (radiotap), USB and Bluetooth captures are not supported, and a damaged file stops the engine; both show up as failed about ten minutes after the upload. The browser analyzer at /analyze-pcap names the reason.
expiredstatus
This analysis is older than its 24-hour window and was not unlocked, so its results are gone. Upload the capture again.
What to do: Analyses that are not unlocked are deleted 24 hours after the upload. Upload the capture again for a new free summary.
If an analysis fails and you cannot tell why, upload the same file in the browser analyzer: it shows the engine's reason, such as a link type it does not read.
Limits
Three limits protect every account: 60 requests a minute, 20 analyses a day and 3 analyses at a time. Each answer says how long to wait, and agents usually wait on their own.
rate_limitedHTTP 429
More than 60 requests in a minute. Wait 12 seconds.
What to do: The account sent more than 60 requests in one minute. The Retry-After header says when to try again; agents usually wait on their own.
rate_limitedtool error
This account started 20 analyses in the last 24 hours, the daily limit.
What to do: Every upload_capture call counts, including uploads that failed or were deleted. retry_after_seconds says when the oldest one leaves the 24-hour window.
rate_limitedtool error
3 analyses of this account are still uploading or running. Finish or wait for them first.
What to do: Three analyses can run at a time. Wait for one to finish, or let an abandoned upload expire after 30 minutes.
Credits and unlocking
The evidence, the hosts, the fixes and the PDF need an unlock, which spends one report credit the first time. These answers are how the server asks, refuses or explains; some of them are not errors at all.
confirmation_requiredstatus
Unlocking spends 1 of the 12 report credits left. Ask the user; if they agree, call unlock_analysis again with confirm set to true.
Not an error: this is the server asking. The agent tells you the cost and waits for your answer.
payment_requiredstatus
The account has no report credits left. The user can buy a single report or a pack on PcapAI while signed in as [email protected], then ask again.
What to do: Buy a single report, a credit pack or a plan while signed in with the same account, then ask the agent again; nothing was spent.
insufficient_scopetool error
This token is not allowed to do this (credits:spend). Create a token with that permission in the PcapAI profile.
What to do: The token was created with Never spend credits. Create another token with Ask before each unlock if this agent should unlock analyses.
lockedtool error
The details of this analysis need an unlock: unlock_analysis spends one report credit, so ask the user first. The free summary stays available through get_analysis.
What to do: The agent asked for details before the unlock. It asks you, unlocks, and asks again.
nothing_to_unlockstatus
The engine found nothing to report: this summary is the whole result.
What to do: A clean capture costs nothing and has nothing to unlock, so there is no PDF through the agent. For a clean-scan PDF, upload the capture at /analyze-pcap.
Frequently asked questions
Does the PcapAI MCP server work with Claude.ai, Claude Desktop or ChatGPT?
Not yet. Those apps connect to remote servers through a sign-in window in the browser, and the PcapAI server accepts personal tokens today. Use Claude Code (including the Code tab of the Claude desktop app), Cursor, Codex or VS Code; sign-in for the chat apps comes later.
Do I need a paid plan to use the MCP server?
No. Any PcapAI account can create a token, and the free summary of each capture costs nothing, up to 20 analyses a day. Report credits for unlocking the evidence and the PDF come from a plan or a credit pack.
Does the PDF report cost a second credit?
No. One report credit unlocks everything about one capture: the evidence of every finding, the hosts, the fix steps and the PDF. Unlocking the same analysis again never spends another credit.
Can my agent spend credits without asking me?
Only if you created its token with Unlock without asking. With the default setting the server answers the first unlock with the price and the credits left, and the agent has to ask you before it confirms. A token set to Never spend credits cannot unlock at all.
What happened to the downloadable pcap-ai-mcp binary?
It is deprecated: it gets no fixes and will stop working when its API is switched off. The hosted server replaces it with nothing to install.
Can I use the MCP server offline or in an air-gapped network?
No. The analysis runs on PcapAI's servers, so the capture has to be uploaded. If your captures cannot leave your network, ask PcapAI about an on-premise deployment.
Still stuck? Send the message your agent showed and the client you use through the contact page.
Was this page helpful?
Thanks. Missing something? Tell us what.