Skip to content
Last updated

MCP security

MCP agents inherit exactly the permissions of the app token they use. Treat MCP as production API access, not a sandbox.

Token hygiene

DoDon't
Store tokens in env vars, secrets managers, or CI secretsCommit tokens to git or share in Slack
Create separate apps per environment (dev/staging/prod)Reuse one token across teams and bots
Rotate when someone leaves or a laptop is lostEmbed tokens in Cursor rules or client-side code
Use minimum scopes in Developer → AppsGrant all-user access unless required

The JWT from appsAdd is shown once — same rules as authentication.

stdio (local IDE)

  • Tokens live in ~/.cursor/mcp.json or Claude Desktop config on your machine
  • Anyone with access to your laptop can read them — use full-disk encryption and separate dev tokens
  • Prefer a dedicated "MCP dev" app with read-only scopes when exploring

Hosted (/mcp)

  • Call only from trusted servers you control
  • Terminate TLS at your edge; never downgrade to HTTP
  • Pass x-app-token server-side; never forward to browsers or mobile apps
  • Session ids (mcp-session-id) are not secrets, but tie activity to your server — do not publish them

Permission scoping

Before giving an agent write tools (customersAdd, tagsRemove, …):

  1. Create an app limited to the required user group
  2. Test mutations in the Playground
  3. Optionally set KARZOUN_MCP_TOOL_PREFIX to read-only prefixes during development

Agent safety

LLMs can call mutations unexpectedly. Mitigations:

  • System prompts that require confirmation before deletes/merges (agent patterns)
  • Read-only tokens for analytics agents
  • Audit app usage via Karzoun logs where available

Comparison with other integrations

MethodCredential exposureBest for
MCP stdioLocal machineDeveloper productivity
MCP hostedBackend onlyProduction agents
GraphQL directYour serviceDeterministic integrations
WebhooksSigning secret on your serverEvent-driven, no LLM

Incident response

If a token leaks:

  1. Disable or remove the app in Developer → Apps
  2. Create a new app and update MCP config or server secrets
  3. Review recent GraphQL activity if audit tools are enabled