Skip to content

Revoke API keys given to AI assistants

How to revoke API keys given to AI assistants: find the local MCP config files, cancel each key at its issuer, then switch to per-person sign-in.

Nachi Raman 6 min read
An IT administrator reviewing API key records while removing a stale credential entry

The situation

Somebody on the team pasted a Stripe key, a Jira token or an internal service key into an MCP server entry on their laptop. Maybe several people did. You found out from an expense line, a leaver's checklist or a security questionnaire. Now you need to know where those keys went, cancel them at the source, and make sure the next person does not have to paste anything.

This is clean-up after the fact. To revoke API keys given to AI assistants you work in three passes: find the config files, revoke at each issuer, then remove the reason anyone pasted a key in the first place.

One thing to settle before you start. No client admin console lists the MCP servers configured on a person's machine. None of the client admin pages read in October 2026 documents an admin inventory of the MCP servers in members' local config files (checked October 2026). That set includes Claude Code's managed MCP page, Cursor's MCP and integration management pages, VS Code's AI settings page and Codex's managed configuration page. The files on the devices are the inventory.

Where do the keys actually live?

A pasted key lives in the MCP configuration file of whichever client the person set up. Each client keeps its own file in its own place, so the search is per client, not per person.

Claude Desktop reads ~/Library/Application Support/Claude/claude_desktop_config.json on macOS and %APPDATA%\Claude\claude_desktop_config.json on Windows. It lists servers under an mcpServers key (connect local MCP servers, checked October 2026). Claude Code keeps local-scope and user-scope servers in ~/.claude.json. Project-scope servers go in a .mcp.json at the project root that teams commit to version control (Claude Code MCP docs, checked October 2026). A key in a committed .mcp.json is a key in your git history.

Cursor reads .cursor/mcp.json in a project and ~/.cursor/mcp.json in the home directory (Cursor MCP docs, checked October 2026). VS Code keeps workspace servers in .vscode/mcp.json and per-profile servers in the user profile folder. Its newer Add Server flow points at .mcp.json at the workspace root or $COPILOT_HOME/mcp-config.json (VS Code MCP servers, checked October 2026). Codex keeps servers in ~/.codex/config.toml, one table per server, and can scope them to a trusted project with .codex/config.toml (Codex MCP docs, checked October 2026). Devin Desktop's Cascade agent uses ~/.config/devin/mcp_config.json on macOS and Linux, or %APPDATA%\devin\mcp_config.json on Windows (Devin Cascade MCP, checked October 2026).

If your device management tool can read files, point it at these paths and collect the results. If it cannot, ask each person directly. Both approaches are covered in more detail in the post on finding the MCP servers employees installed.

How to revoke API keys given to AI assistants at the issuer

Deleting a line from a config file stops the client using the key. It does not stop the key. Revocation happens at the system that minted it, and until you do that, anyone holding a copy can still call the API.

Work issuer by issuer. For a SaaS app, revoke in that app's own key management screen. Note the key's last use first if the app records one, because that tells you whether anything else was depending on it. For an internal service, revoke in whatever mints your service tokens.

The two model providers publish their own guidance here. OpenAI says it disables an API key immediately once it detects that key on the public internet or leaked inside an app-store app. The same page advises against handing a key to untrusted third-party tools (keeping your OpenAI account secure, checked October 2026). Its guidance describes rotation as a manual sequence the key owner carries out: create a replacement, update the applications, then revoke the old one. Anthropic participates in GitHub's secret-scanning partner program. It automatically deactivates a Claude API key GitHub reports as exposed in a public repository, and emails the affected user (API key best practices, checked October 2026). A personal Anthropic API key is archived when its owner is removed from the organization, and archived keys are not restored if that person is re-invited (Anthropic authentication docs, checked October 2026).

If a key reached a repository, check GitHub's secret scanning in the same pass. It runs automatically and free on public repositories. On organization-owned private and internal repositories it needs GitHub Secret Protection enabled, on GitHub Team or GitHub Enterprise Cloud (supported secret scanning patterns, checked October 2026). That page lists Anthropic API Key as a partner pattern with user alerts, push protection and validity checks supported.

Revoke first, then edit the config file. Doing it the other way round leaves a live key sitting in a file you have stopped looking at.

What to replace the keys with

The reason people paste keys is that the client asks for one and nothing else is on offer. Remove that prompt and the behavior stops.

Elaichi serves MCP at one endpoint, https://api.elaichi.ai/mcp, the same address for every organization. The MCP address carries no token or other credential. The access token travels only in the Authorization header, so there is no URL anyone can forward that carries access with it. Each person connects their client once over OAuth and approves their own grant on Elaichi's consent screen. MCP clients register themselves through OAuth dynamic client registration at POST https://api.elaichi.ai/oauth/register, which needs no Elaichi credential. The person setting up a client has no client ID, secret or header to look up or paste.

The third-party credentials move too. Connector credentials are not kept in Elaichi's main data: a separate credential service holds every connected account's secrets in encrypted form, and Elaichi fetches them into memory only for the call that needs them. Stored connector secrets are encrypted at rest with AES-256-GCM, and the key can be rotated without re-encrypting old rows. The AI client holds an Elaichi token and nothing else.

For the mechanics of that swap across a fleet, see replacing personal MCP servers on employee laptops. For the argument about why a pasted key was the wrong unit of access to begin with, the post on personal API keys and AI tools covers it.

Which clients can you point at the new address?

Elaichi's authorization server is written with Claude, ChatGPT and Cursor in mind. Its code names Claude Desktop, claude.ai connectors and Cursor as the clients it serves, and recognizes their registered redirect addresses. The product team has also confirmed that GitHub Copilot in VS Code signs in over OAuth and runs connected tools through the MCP endpoint. It has confirmed that Microsoft Copilot reaches Elaichi through a Copilot Studio agent with OAuth set to Dynamic discovery.

For any other client, including Claude Code, Codex and Devin Desktop, state the requirements and test. Elaichi keeps no list of approved MCP clients. Any client that supports OAuth dynamic client registration, PKCE with S256 and a browser sign-in can connect, and every client goes through the same registration, sign-in and consent. What differs between clients is only where their own settings take the URL. So set one up on a test account before you tell a team to migrate.

What you can see afterwards

The point of the swap is that the next question has an answer. Every call that reaches execution is written to the audit log with the person, the connector, the connection and the MCP client. Elaichi's console labels a client's name as self-reported unless every non-loopback redirect address it registered maps to the same known client. Exactly seven clients can be shown as verified: Claude, ChatGPT, Cursor, Grok, Perplexity, Mistral and Devin. A client that registers only loopback redirects is never verified, so its entry shows the name it chose for itself.

Elaichi keeps 90 days of audit history. For a longer record, forward it to your own log service: logging destinations come with the Black plan, and Datadog is the destination that delivers.

The other thing that changes is offboarding. Removing or suspending a member revokes every live MCP OAuth grant they hold in that organization. Grants are re-read on every request, so their MCP clients fail on the next call. That is the opposite of a pasted key, which keeps working at the app until somebody remembers it exists.

The case where this is not your problem yet

If one engineer runs one local MCP server against a sandbox key, revoking that key and leaving it there is a reasonable end state. You do not need a control plane to manage a single credential with no blast radius. The post on when you don't need an MCP gateway yet sets out where that line sits.

The Elaichi approach has a real trade-off. Each person still connects their client once and approves their own grant, so there is a per-person setup step you cannot skip. You are trading a one-time paste for a one-time sign-in. The difference is that the sign-in leaves a revocable grant and an audit trail, and the paste leaves a credential nobody is tracking.

When you are ready to connect the first app, start with connecting your first work app, or browse what Elaichi runs in the connector catalog.

FAQ

Frequently asked questions

Does deleting an MCP server from a config file revoke the API key?

No. Removing a server entry from a local MCP configuration file stops that client from using the key, but the key itself stays valid at the system that issued it. Anyone holding a copy, including a stale backup or a committed repository file, can still call the API. Revoke the key in the issuing application's own key management screen first, then remove the config entry.

Can an admin console show which MCP servers employees have configured?

None of the client admin pages read in October 2026 documents an admin inventory of the MCP servers configured in members' local config files. That includes Claude Code's managed MCP and managed settings pages, Claude Desktop's enterprise configuration, Cursor's MCP and integration management pages, VS Code's AI settings page, Devin's Cascade MCP page and Codex's managed configuration page. The configuration files on each device are the inventory, so collect them with device management tooling or ask people directly.

What happens to an Anthropic API key when an employee leaves?

Anthropic's documentation states that a personal Anthropic API key is archived when its owner is removed from the organization, and that archived keys are not restored if the person is later re-invited (checked October 2026). Anthropic also participates in GitHub's secret-scanning partner program and automatically deactivates a Claude API key that GitHub reports as exposed in a public repository, emailing the affected user.

How does per-person sign-in remove the need to paste an API key?

Elaichi serves MCP at one address, https://api.elaichi.ai/mcp, which carries no token or credential. MCP clients register themselves through OAuth dynamic client registration with no Elaichi credential required, so the person connecting has no client ID, secret or header to paste. Each person signs in through a browser and approves their own grant. The connected app's own credential is held by a separate encrypted credential service, and the AI client only ever holds an Elaichi token.

Which AI clients are confirmed to sign in to Elaichi?

Elaichi's authorization server is written with Claude, ChatGPT and Cursor in mind, and its code recognizes their registered redirect addresses. The product team has also confirmed GitHub Copilot in VS Code and Microsoft Copilot through a Copilot Studio agent. Elaichi keeps no approved-client list, so any client supporting OAuth dynamic client registration, PKCE with S256 and a browser sign-in can connect. For a client not on that confirmed list, test the sign-in on one account before rolling it out.

Put AI to work in your own apps

14 days of Black, no credit card. Start with one app and one team.

When the trial ends, nothing is deleted. You move to the free Personal plan, and connections, roles and the audit log stay where they are.

Add one link to your AI app

The same link for everyone on your team.

https://api.elaichi.ai/mcp
  • ChatGPT
  • Claude
  • Cursor
  • Microsoft Copilot