Skip to main content

Claude Code

Use this page to add your PolicyArc environment to Claude Code from a terminal. These steps were run with Claude Code 2.1.296 on 2026-10-12. A tool call from Claude Code has not been run yet.

Config​

Copy your gateway URL from the Admin Portal first. Copy your gateway URL shows where it is. The command below uses https://your-environment.example/gateway/mcp.

claude mcp add policyarc https://your-environment.example/gateway/mcp --transport http

Steps​

  1. Run the command above. Claude Code prints Added HTTP MCP server policyarc with URL: https://your-environment.example/gateway/mcp to local config.

    The server is saved for the current project only. To use it in every project, add --scope user. To write it to .mcp.json in the project directory, add --scope project.

  2. List your servers.

    claude mcp list

    You see policyarc: https://your-environment.example/gateway/mcp (HTTP) - ! Needs authentication. The gateway refuses a request that carries no token.

  3. Sign in.

    claude mcp login policyarc

    Claude Code opens your browser at the sign-in page of the identity provider your environment uses. After you sign in, it prints Authenticated with "policyarc". Its tools are now available in Claude Code.

  4. Run claude mcp list again. You see policyarc: https://your-environment.example/gateway/mcp (HTTP) - ✔ Connected.

Claude Code identifies itself with a client ID metadata document, so it makes no registration call. Under Access Activity in the Admin Portal, the sign-in shows as /authorize, /callback and /token rows whose client is https://claude.ai/oauth/claude-code-client-metadata.

If something goes wrong​

  • If you work on a machine with no browser, run claude mcp login policyarc --no-browser. Claude Code prints the sign-in URL instead of opening a browser. Open that URL in a browser and sign in, then paste the redirect URL back when Claude Code prompts for it.
  • If claude mcp list still shows ! Needs authentication after you sign in, check that you are in the directory where you added it. A server added with the default scope belongs to that directory, and claude mcp get policyarc shows its scope.
  • To remove the server, run claude mcp remove policyarc -s local.