When an MCP server your agents use turns malicious or is compromised, it is holding live credentials, receiving your data and able to steer every agent connected to it. Response has to cover more than the server: the OAuth tokens clients hold for it, the downstream API keys it uses, the tool definitions agents have cached, the endpoints where it is installed and the actions agents already took on its say-so. This playbook is a fill-in template for that response, aligned to NIST SP 800-61 Rev. 3 and the MCP specification revision 2026-07-28 (checked 27 October 2026). It is for security operations, identity and platform teams; replace the bracketed placeholders and keep it next to your general incident response plan.
How to use this template
- Replace text in square brackets, such as [Organisation], [MCP platform owner] and [SOC], with your own names, contacts and systems.
- "Must" marks a mandatory step; "should" marks a step you may skip with a recorded reason.
- Complete the preparation items in the Implementation guidance before you need the playbook; most MCP incidents are slow because nobody knows where a server is installed or what credentials it holds.
- Use this playbook alongside the AI Agent Incident Response Playbook, which covers the agent itself; this one covers the MCP server, its credentials and its clients.
- Review after every MCP incident and at least every [6] months; the protocol changes several times a year.
1. Scope and triggers
1.1 This playbook applies to any MCP server used by [Organisation] staff, agents or products: local (stdio) servers on endpoints, remote (Streamable HTTP) servers operated by [Organisation], and third-party hosted servers.
1.2 Invoke the playbook when any of the following is confirmed or credibly suspected:
| Trigger | Example signal | Initial severity |
|---|---|---|
| Malicious server or update | Package version adds exfiltration or hidden recipients; upstream registry marks the server deleted; vendor or researcher advisory | [High] |
| Compromised server operator or host | Vendor breach notice; exploited vulnerability in the server or gateway, such as one listed in CISA KEV | [High] |
| Tool poisoning or rug pull | Tool description or schema changes to include instructions; new tools appear without a release | [Medium to High] |
| Prompt injection delivered through tool output | Agent runs a command or calls a tool that came from data returned by the server | [Medium to High] |
| Credential exposure | Server logs, config or server.json contain tokens; token used from unexpected IPs | [High] |
| Authorisation flaw | Token passthrough, missing audience checks, state handle hijacking or confused deputy behaviour found in a server you run | [Medium] |
1.3 Out of scope: model provider outages and general agent misbehaviour with no MCP component, which follow [general incident response plan].
2. Roles and contacts
| Role | Responsibility | Contact |
|---|---|---|
| Incident lead | Owns decisions, severity and timeline | [Name, phone, deputy] |
| MCP platform owner | Registry, gateway and client policy changes; server inventory | [Name] |
| Identity and NHI owner | Revokes OAuth grants and client registrations, rotates keys and service accounts | [Name] |
| Endpoint team | Finds and removes local servers and config entries on devices | [Name] |
| Server owner (internal) or vendor contact (third party) | Supplies server logs, fixes, attestations | [Name or vendor security contact] |
| Data protection and legal | Assesses personal data exposure and notification duties | [DPO, counsel] |
| Communications | Internal notices; customer statements if needed | [Name] |
2.1 The incident lead must record every decision with time and reason. 2.2 Out-of-hours escalation follows [call tree]. See the Incident Response Contact and Call Tree Template.
3. Detection and triage
3.1 Identify the server precisely: registry name (for example io.github.vendor/server), package and version or image digest, remote URL, and the serverInfo it reports. Versions matter: a server can be clean in one version and malicious in the next.
3.2 Establish blast radius within [2] hours by answering:
- Where is it installed or connected? Query endpoint inventory for MCP config files, gateway connection logs and agent platform connector lists.
- What credentials does it hold or receive? OAuth tokens issued to it, downstream API keys in its environment, secrets users entered through URL mode elicitation, and any tokens clients sent to it.
- What can those credentials reach? List scopes and the systems behind them.
- What did agents do through it? Pull tool call logs for the exposure window: tool names, arguments, results, and any follow-on tool calls or commands the agent ran after its output.
- Since when? Find the first malicious version or first suspicious change and set the exposure window from there, not from the date you noticed.
3.3 Preserve evidence before changing anything: export gateway and client logs, tool definitions as cached by clients, the package or image (by digest), server configuration and the trace IDs. MCP 2026-07-28 reserves OpenTelemetry traceparent in request _meta; where clients propagate it, use it to link agent actions to server calls. Store evidence in [evidence store] with hashes and chain of custody.
3.4 Set severity using [severity matrix]. Treat as [High] any case where the server could reach production data, send email or messages, or run commands on endpoints.
4. Containment
4.1 Stop new use, in this order, recording each time:
- Block at the gateway: deny the server name and URL at [MCP gateway]; this is the fastest control for remote servers.
- Remove from the catalogue: delete or quarantine the entry in [private MCP registry] and the client allowlist, so it cannot be reinstalled.
- Revoke client authorisation: revoke refresh and access tokens issued for the server's resource at [authorisation server], and disable the client registration or Client ID Metadata Document trust for it.
- Disable downstream credentials: disable (do not yet delete) the API keys, service accounts and OAuth grants the server uses to reach other systems. Disabling first preserves audit history.
- Endpoints: push removal of the config entry and kill running server processes through [EDR or MDM]. Local servers keep working after a package is pulled from npm or PyPI, as the postmark-mcp malicious MCP server showed: installed copies kept copying email until users removed them.
4.2 If business-critical agents depend on the server, the incident lead may approve a temporary replacement (an earlier verified version by digest, or the vendor's official server) only after 4.1 steps 3 and 4 are complete.
4.3 If the compromise is in a shared gateway rather than one server, treat every credential the gateway holds as exposed. The LiteLLM MCP auth bypass (CVE-2026-59822, added to CISA KEV on 2 September 2026) exposed the gateway master key, model provider keys and credentials for connected MCP servers at once.
4.4 Decision points by server type:
| Server type | Fastest containment | Who holds the evidence | Key decision |
|---|---|---|---|
| Local stdio server on endpoints | Remove config entry and kill process via [EDR or MDM]; block the package in [internal package proxy] | Endpoints: config files, process and network telemetry | Whether to isolate devices where the server ran commands or read credential files |
| Remote server operated by [Organisation] | Take the endpoint offline or block at the gateway; revoke its tokens at the authorisation server | [Organisation]: server, gateway and authorisation server logs | Whether customers or other tenants are affected and need notice under section 7 |
| Third-party hosted server | Block at the gateway and egress proxy; revoke the OAuth grant you gave it; rotate any key you sent it | Vendor, plus your gateway logs | Whether to wait for the vendor's fix or replace the server; do not reconnect on the vendor's word alone |
| Gateway or proxy in front of many servers | Isolate the gateway; fail closed rather than bypass it | [Organisation] or gateway vendor | Treat every credential held by the gateway as exposed |
4.5 Any key users or teams gave to a hosted MCP server is shared with that host. Rotate such keys even when the vendor says its own systems were not affected, as the Smithery.ai MCP hosting breach showed when a single platform token reached more than 3,000 hosted servers.
5. Eradication
5.1 Rotate, then delete, every credential identified in 3.2: downstream API keys, service account secrets, OAuth client secrets, signing keys, and any secret users entered through the server. Rotate credentials in agent environments where agents executed commands or packages suggested by the server's output; the Sentry MCP agentjacking research showed injected tool output leading agents to run commands with the developer's own privileges.
5.2 Review and reverse actions the agent took on the server's instruction: sent messages, created or modified records, repository changes, new OAuth grants, new MCP servers added to configs.
5.3 Search for persistence: changed agent instruction files, added MCP config entries, scheduled tasks or new keys created with the exposed credentials.
5.4 For a server [Organisation] operates, fix the root cause and verify against the MCP Security Best Practices: the server must not accept tokens not issued for it (no token passthrough), must validate audience, must not treat state handles as authentication, and must apply per-client consent if it proxies to third-party OAuth.
5.5 Report malicious public servers: to the package registry as abuse, and to the official MCP Registry as a GitHub issue titled "Abuse report: [server name]".
6. Recovery
6.1 Reinstate a server only through the normal review gate: new version pinned by digest, tool definitions reviewed and baselined, scopes reduced to the minimum, and owner sign-off by [MCP platform owner].
6.2 Issue new credentials with shorter lifetimes and narrower scopes than before. Clients must key stored credentials by authorisation server issuer and must not reuse them with a different one (a 2026-07-28 requirement); confirm this when re-registering.
6.3 Monitor the reinstated server and the rotated credentials with heightened alerting for [30] days.
6.4 The incident lead closes recovery when [criteria: no further indicators for N days, all credentials rotated, all endpoints clean].
7. Communication and notification
7.1 Internal: notify affected teams and users with what to remove, what was rotated and what to watch for, using [template]. Do not paste indicators that include secrets.
7.2 Vendor: for third-party servers, request the vendor's timeline, affected versions, indicators and confirmation of credential rotation on their side.
7.3 Regulatory and contractual: legal and the DPO decide within [24] hours whether personal data or customer data was exposed and whether notification duties apply (for example a 72-hour regulator deadline under [applicable law]).
7.4 Customers: if [Organisation] operates the affected server for customers, notify them with the exposure window, affected versions and the actions they must take, such as revoking grants.
8. Post-incident review
8.1 Hold the review within [10] working days. Record timeline, root cause, exposure window, detection gap and cost.
8.2 Answer specifically: How did the server enter our environment? Was it in the registry, approved by version and digest? How long from first malicious version to detection? Which credentials were broader than needed? Did any agent act without human approval?
8.3 Track actions to closure with owners and dates in [tracker], and update this playbook.
Implementation guidance
Prepare before an incident
- Maintain an inventory of MCP servers with owner, version or digest, transport, scopes and credentials; see the MCP Registry and Server Publishing Security Guide.
- Route remote servers through a gateway that can block by name and URL in minutes and logs tool calls with arguments.
- Give each server its own narrowly scoped credential, so one rotation does not break everything.
- Make sure endpoint tooling can find and remove MCP config entries across your supported clients.
- Run a tabletop each [6] months using a malicious update scenario and a gateway compromise scenario.
Metrics
- Time from trigger to gateway block, and to full credential revocation.
- Percentage of affected endpoints cleaned within [24] hours.
- Exposure window: first malicious version to containment.
- Credentials rotated as a share of credentials identified in triage (target: 100%).
Framework mapping
| Playbook section | NIST CSF 2.0 | NIST SP 800-53 Rev. 5 | Threat references |
|---|---|---|---|
| 3. Detection and triage | RS.AN-03 | IR-4, IR-5, SI-4, AU-11 | ATLAS AML.T0110 AI Agent Tool Poisoning; AML.T0109 AI Supply Chain Rug Pull |
| 4. Containment | RS.MI-01 | IR-4, CM-7(5) | ATT&CK T1528 Steal Application Access Token |
| 5. Eradication | RS.MI-02 | IA-5, AC-2 | ATT&CK T1550.001 Application Access Token; ATLAS AML.T0098 AI Agent Tool Credential Harvesting |
| 6. Recovery | RC.RP-01 | IR-4 | ATLAS AML.T0083 Credentials from AI Agent Configuration |
| 7. Communication | RS.CO-02, RS.CO-03, RS.MA-01 | IR-6 | Not applicable |
| 8. Review | ID.IM-03 | IR-8 | Not applicable |
References
- NIST: SP 800-61 Rev. 3 Incident Response Recommendations and Considerations for Cybersecurity Risk Management
- Model Context Protocol: Security Best Practices
- Model Context Protocol: Key Changes in revision 2026-07-28
- Model Context Protocol: The MCP Registry Moderation Policy
- CISA: Known Exploited Vulnerabilities Catalog
- MITRE ATLAS: AI Agent Tool Poisoning
Related NHI Mgmt Group resources: AI Agent Incident Response Playbook · Leaked Credential Response Playbook · MCP Gateway and MCP Server Governance Guide · Identity Incident Response Playbook