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
-
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.jsonin the project directory, add--scope project. -
List your servers.
claude mcp listYou see
policyarc: https://your-environment.example/gateway/mcp (HTTP) - ! Needs authentication. The gateway refuses a request that carries no token. -
Sign in.
claude mcp login policyarcClaude 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. -
Run
claude mcp listagain. You seepolicyarc: 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 liststill shows! Needs authenticationafter 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, andclaude mcp get policyarcshows its scope. - To remove the server, run
claude mcp remove policyarc -s local.
Send feedback about this page