Skip to content

MCP setup

The @policygrain/mcp server wraps @policygrain/sdk over stdio JSON-RPC 2.0, reads POLICYGRAIN_API_KEY from the environment only, and redacts any credential prefixes from logs and errors.

View .mdOpen llms.txt

Install and configure @policygrain/mcp

Add the PolicyGrain MCP server to your Claude Code, Cursor or Codex MCP configuration. No API key is required for public CheckMyDPDP scans; authenticated PolicyGrain routes read POLICYGRAIN_API_KEY from the process environment.

json
{
  "mcpServers": {
    "policygrain": {
      "command": "npx",
      "args": ["-y", "@policygrain/mcp"],
      "env": {
        "POLICYGRAIN_API_KEY": "${POLICYGRAIN_API_KEY}",
        "POLICYGRAIN_API_URL": "https://api.policygrain.com"
      }
    }
  }
}

Passing POLICYGRAIN_API_KEY safely

Pass POLICYGRAIN_API_KEY by environment variable reference only. Never paste a pgk_ key into committed config files. The server strips pgk_, pgs_, pgr_ and pgt_ prefixes before writing any diagnostic or error message.

All 16 MCP tools

MCP tools exposed by @policygrain/mcp
ToolBacked routeAuth
checkmydpdp_scanPOST /v1/scansOptional (keyless or Bearer)
checkmydpdp_get_scanGET /v1/scans/{id}None (capability id)
checkmydpdp_create_handoffPOST /v1/scans/{id}/handoffBearer
policygrain_accountGET /v1/accountBearer
policygrain_list_questionsGET /v1/questionsNone
policygrain_list_profilesGET /v1/profilesBearer
policygrain_create_profilePOST /v1/profilesBearer
policygrain_update_profilePATCH /v1/profiles/{id}Bearer
policygrain_generate_documentsPOST /v1/generationsBearer
policygrain_get_generationGET /v1/generations/{id}Bearer
policygrain_list_documentsGET /v1/documentsBearer
policygrain_get_document_versionGET /v1/documents/{id}/versions/{n}Bearer
policygrain_publish_documentPUT /v1/documents/{id}/publicationBearer
policygrain_list_sitesGET /v1/sitesBearer
policygrain_verify_domainPOST /v1/sites/{id}/domains/{domain}/verifyBearer
policygrain_start_verificationPOST /v1/sites/{id}/verificationsBearer