# MCP security incident response steps

URL: https://mcpservercybersecurity.com/guides/mcp-security-incident-response-steps/
Updated: 2026-11-16

When an MCP server is found malicious, block it centrally, find every machine and config file that references it, assume anything the client could read is exposed, rotate and revoke credentials at the issuer, then confirm removal and record the gap. Claude Code's remove command does not revoke tokens by itself. Sources were read on 16 Nov 2026.

## What do you do when a server is found malicious?

Contain it first, centrally if you can. Add the server to the deny side of the client's administrator settings: Claude Code documents deniedMcpServers, and Cursor's allowlist approves by command and URL pattern, so removing the pattern stops new use.

Then preserve evidence before cleanup: the config entry, the package copy and the logs. The MCP specification says local servers run with the client's privileges, with arbitrary code execution, data exfiltration and data loss among the stated risks, so treat the host as exposed.

Sources: [Claude Code documentation: Connect Claude Code to tools via MCP](https://code.claude.com/docs/en/mcp); [Cursor documentation: Model Context Protocol](https://cursor.com/docs/context/mcp); [MCP specification: Security Best Practices (2025-11-25)](https://modelcontextprotocol.io/specification/2025-11-25/basic/security_best_practices).

## How do you find every machine that ran it?

Search for the server's name, package or URL in client configuration files and in your inventory data. Microsoft says Defender for Endpoint's local agent inventory lists the remote and local MCP servers per agent and that the data can be queried in advanced hunting, and Snyk's Evo documentation says its fleet view lists every machine that reported a scan with counts of MCP servers discovered.

Without such a tool, an MDM or EDR query over the known config locations does the same job. Cisco's open-source scanner has a mode that reads well-known client config locations, which is useful for a spot check.

Sources: [Microsoft Learn: Discover local AI agents in Defender for Endpoint](https://learn.microsoft.com/en-us/defender-endpoint/discover-local-ai-agents); [Snyk documentation: Agent Supply Chain Security](https://docs.snyk.io/agent-security/evo-by-snyk/agentic-development-security-ads/agent-supply-chain-security.md); [Cisco AI Defense MCP Scanner repository](https://github.com/cisco-ai-defense/mcp-scanner).

## How do you revoke what the server held?

Revoke tokens at the issuer and rotate any key the server could read. Claude Code's documentation says that removing a server deletes the OAuth tokens and client registration it stored locally but does not revoke them at the authorization server, and that running claude mcp logout before claude mcp remove revokes them where the server supports revocation.

Environment variables in config files, cloud keys and tokens in the credential store all count as readable by a server that ran with the user's rights. OWASP advises per-server credentials, which limits how many you rotate.

Sources: [Claude Code documentation: Connect Claude Code to tools via MCP](https://code.claude.com/docs/en/mcp); [OWASP MCP Security Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/MCP_Security_Cheat_Sheet.html); [MCP specification: Security Best Practices (2025-11-25)](https://modelcontextprotocol.io/specification/2025-11-25/basic/security_best_practices).

## What if the server is vulnerable rather than malicious?

Patch or retire it on a deadline and treat the exposure window like a compromise if it was reachable. The MCP Inspector advisory (CVE-2025-49596, critical) shows the pattern: versions below 0.14.1 let unauthenticated requests launch MCP commands over stdio, and the fix was to upgrade to 0.14.1 or later.

Check where such tools were run, since a developer tool left listening on a shared network is reachable by others.

Sources: [GitHub advisory GHSA-7f8r-222p-6f5g: Inspector proxy server vulnerabilities (CVE-2025-49596)](https://github.com/modelcontextprotocol/inspector/security/advisories/GHSA-7f8r-222p-6f5g).

## How do you confirm the cleanup worked?

Re-scan the machines, check that the config entry is gone and look in the logs for any later call to the server. Confirm at the identity provider that the tokens no longer work.

Close the incident by checking that the deny entry is in place centrally, so a returning config file does not bring the server back.

Tell developers what happened and ask them to report any server they added themselves, since the inventory only knows what it found.

Sources: [Claude Code documentation: Connect Claude Code to tools via MCP](https://code.claude.com/docs/en/mcp); [OWASP MCP Security Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/MCP_Security_Cheat_Sheet.html).

## What do you record afterwards?

Record the timeline, the machines and credentials affected, how the server was approved and which control would have stopped it. Feed the answer into the catalog and the checklist, for example by adding hash pinning or a stricter startup-command review.

OWASP's recommendation of regular audits and simulated attacks against MCP setups gives a way to test the fix.

Sources: [OWASP MCP Security Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/MCP_Security_Cheat_Sheet.html).

## Sources

- [Claude Code documentation: Connect Claude Code to tools via MCP](https://code.claude.com/docs/en/mcp) (code.claude.com), read 2026-11-16
- [Cursor documentation: Model Context Protocol](https://cursor.com/docs/context/mcp) (cursor.com), read 2026-11-16
- [MCP specification: Security Best Practices (2025-11-25)](https://modelcontextprotocol.io/specification/2025-11-25/basic/security_best_practices) (modelcontextprotocol.io), read 2026-11-16
- [Microsoft Learn: Discover local AI agents in Defender for Endpoint](https://learn.microsoft.com/en-us/defender-endpoint/discover-local-ai-agents) (learn.microsoft.com), read 2026-11-16
- [Snyk documentation: Agent Supply Chain Security](https://docs.snyk.io/agent-security/evo-by-snyk/agentic-development-security-ads/agent-supply-chain-security.md) (docs.snyk.io), read 2026-11-16
- [Cisco AI Defense MCP Scanner repository](https://github.com/cisco-ai-defense/mcp-scanner) (github.com), read 2026-11-16
- [OWASP MCP Security Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/MCP_Security_Cheat_Sheet.html) (cheatsheetseries.owasp.org), read 2026-11-16
- [GitHub advisory GHSA-7f8r-222p-6f5g: Inspector proxy server vulnerabilities (CVE-2025-49596)](https://github.com/modelcontextprotocol/inspector/security/advisories/GHSA-7f8r-222p-6f5g) (github.com), read 2026-11-16

## Related pages

- [MCP Audit Logging: What to Record and How Long to Keep It](/guides/mcp-audit-logging-what-to-record/)
- [How to Vet an MCP Server Before Use: Steps and Signals](/guides/how-to-vet-an-mcp-server-before-use/)
- [MCP config file (glossary)](/glossary/mcp-config-file/)
- [npx launcher (glossary)](/glossary/npx-launcher/)
- [All guides](/guides/)
- [MCP Security Best Practices for Server Operators](/guides/mcp-security-best-practices/)
- [MCP Security vs API Security: What Changes](/guides/mcp-security-vs-api-security/)
- [The ranking](/ranking/)
- [Glossary](/glossary/)
