MCP server: Claude Code
Install @cloakapi/mcp-server 0.6.2 from npm and run cloakapi-mcp, as described in MCP server. Version 0.5.1 remains on npm and bundles @cloakapi/sdk 1.5.0. Versions 0.4.0 and 0.4.1 were withdrawn, and their downloads answer HTTP 410.
Add the server
Run this in a terminal, in your project directory:
claude mcp add --transport stdio \ --env CLOAKAPI_API_KEY=cloak_your_key_here \ cloakapi -- cloakapi-mcpThis adds the server for you in the current project. Add --scope user to make it available in all your projects, or --scope project to write it to .mcp.json in the project root so the team shares it.
To write .mcp.json yourself, keep the key out of the file and read it from your environment instead. Claude Code expands ${CLOAKAPI_API_KEY} when it starts the server:
{ "mcpServers": { "cloakapi": { "type": "stdio", "command": "cloakapi-mcp", "args": [], "env": { "CLOAKAPI_API_KEY": "${CLOAKAPI_API_KEY}" } } }}Then set the key in the shell you start Claude Code from:
export CLOAKAPI_API_KEY="cloak_your_key_here"Claude Code started from a terminal uses that terminal’s PATH, so the command name usually works. If it does not, use absolute paths as shown in If the client cannot find the command.
Check
List your servers and their status:
claude mcp listInside a Claude Code session, /mcp shows the cloakapi server and its tools. Start a new session after you add or change the server. Then ask:
Use the cloakapi detect_pii tool on: "Please email Jane Doe at jane.doe@example.com or call +1 415 555 0134."The result reports "entity_count": 3.
Your prompts and the files Claude Code reads go to Claude as usual, and tool results join the conversation. For the full tool list and what each tool sends, see What leaves the device and what does not.