Skip to content

Claude Desktop setup

Claude Desktop is Anthropic’s native Mac/Windows app for Claude. Installing InPolicy into Claude Desktop takes five minutes per machine.

Pick the path that matches your deployment:

Path Who it’s for What the user does
API key IT-deployed installs where you can pre-provision a credential Nothing. IT bakes the key into the MCP config.
Sign in with InPolicy BYOD / unmanaged-device users where each person authenticates as themselves Click through a one-time browser sign-in the first time the AI uses InPolicy.

The API-key path is described in this page below. For the sign-in path, see Sign in with InPolicy (BYOD) at the bottom — same claude_desktop_config.json shape, just no INPOLICY_API_KEY env var. The MCP server detects the missing key and runs the OAuth flow on first call.

  • Claude Desktop installed and signed in.
  • Node.js 18+ on each employee machine. Most engineering laptops already have this. For non-engineering users, install Node from nodejs.org. It’s a one-time install, no ongoing maintenance.
  • An InPolicy API key from your admin dashboard (see overview) — only for the API-key path.
  1. Open Claude Desktop and go to Settings → Developer → Edit Config. This opens claude_desktop_config.json. If the file doesn’t exist, Claude Desktop will create it.

  2. Add this entry inside the mcpServers object (create the object if it’s not there):

    {
    "mcpServers": {
    "inpolicy": {
    "command": "npx",
    "args": ["-y", "@inpolicy/mcp-server"],
    "env": {
    "INPOLICY_API_KEY": "inp_live_REPLACE_ME"
    }
    }
    }
    }

    Replace inp_live_REPLACE_ME with the actual API key from your dashboard.

  3. Save the file and fully quit Claude Desktop (Cmd-Q on Mac, not just close the window). Relaunch it.

  4. You should see an inpolicy server listed under Settings → Developer. The status should be green.

  5. Now apply the system prompt template under Settings → Profile → Custom Instructions.

That’s it. Claude now has access to your company’s policies on every turn.

For rolling out to many machines, three options depending on your MDM stack:

Option A: MDM config profile (Jamf, Intune, Mosyle, Kandji)

Section titled “Option A: MDM config profile (Jamf, Intune, Mosyle, Kandji)”

Ship claude_desktop_config.json to each user’s ~/Library/Application Support/Claude/ (Mac) or %APPDATA%\Claude\ (Windows) as a managed file. Most MDM tools support file deployment with variable substitution so the API key can be injected from a central secret.

Templated file (substitute ${INPOLICY_API_KEY} at deploy time):

{
"mcpServers": {
"inpolicy": {
"command": "npx",
"args": ["-y", "@inpolicy/mcp-server"],
"env": {
"INPOLICY_API_KEY": "${INPOLICY_API_KEY}"
}
}
}
}

If the user has customized their config, your deploy will overwrite it. Consider merging instead if your MDM supports it.

Run a one-shot script on each machine (via your RMM or ansible equivalent). On macOS:

#!/usr/bin/env bash
set -euo pipefail
CONFIG_DIR="$HOME/Library/Application Support/Claude"
CONFIG_FILE="$CONFIG_DIR/claude_desktop_config.json"
mkdir -p "$CONFIG_DIR"
cat > "$CONFIG_FILE" <<EOF
{
"mcpServers": {
"inpolicy": {
"command": "npx",
"args": ["-y", "@inpolicy/mcp-server"],
"env": {
"INPOLICY_API_KEY": "$INPOLICY_API_KEY"
}
}
}
}
EOF
echo "InPolicy MCP configured. Restart Claude Desktop to activate."

For smaller teams, email the config snippet with instructions. Include the API key (it’s a tenant identifier, not a user secret, so it’s safe to share within your org).

Open a new conversation in Claude Desktop and ask:

“What tools do you have available from InPolicy?”

Claude should list the InPolicy tools (record_turn, check_output, get_conversation_state, etc.). If it doesn’t, check:

  • The inpolicy entry appears in Settings → Developer with a green status.

  • Node.js 18+ is installed (node --version).

  • The API key is valid. Quick sanity check that exercises the real pre-inference endpoint:

    Terminal window
    curl -X POST https://api.inpolicy.ai/api/v1/agent/governance/pre-inference \
    -H "Authorization: Bearer $INPOLICY_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"sessionId":"verify-key", "prompt":"hello"}'

    A 200 response means the key works. A 401 means the key is bad or revoked. A 400 names the field to fix in the request.

A tool result is marked as an error only when the call failed: an API error, a timeout, a network failure or invalid arguments. A check_output with decision: "warn" or "block", or a check_tool_call with allow: false, is a normal result for the model to act on. On a block, the model may send suggested_redaction only when it is not null (every finding is then rewritten); when it is null, it regenerates and checks again, or escalates to a person.

An API error reads InPolicy API <status>: <the server's reason>, for example InPolicy API 400: country must be an ISO 3166-1 alpha-2 code such as 'GB'. A short hint follows for 401, 402 (the monthly budget is used up, so nothing was checked), 403 and 429, then code, retry_after_ms, checks_resume_at and trace_id when the server sent them. A timeout says the output or tool call was not checked.

Each call waits up to INPOLICY_TIMEOUT_MS milliseconds (default 30000). Valid values are 1 to 2147483647. A larger value is capped at 2147483647 and a fraction of at least 1 is rounded down, each with a warning on stderr. Anything else, such as 30s, 0.5 or 0, falls back to 30000 with a warning naming the range.

A session_id may use letters, digits and . _ : @ + = -, 1 to 200 characters; any other id is refused before it is sent.

record_turn and end_conversation can return a 409 while another turn for the same session is still being saved. The model should call the tool again. end_conversation is otherwise safe to call twice.

country is a two-letter ISO 3166-1 alpha-2 code such as GB (not UK). The server checks it against the ISO list and refuses an invalid code with a 400, also when signed in. With Sign in with InPolicy, a valid country a tool sends is ignored and the country on the user’s InPolicy profile applies.

See What employees will see. Two key points:

  1. They don’t need to do anything differently. The system prompt handles it.
  2. Sometimes Claude will mention a policy by name (e.g. “I should note that per Policy 4.2…”). That’s expected and a sign it’s working.

For deployments where each user authenticates as themselves rather than sharing a tenant API key, omit the INPOLICY_API_KEY env var:

{
"mcpServers": {
"inpolicy": {
"command": "npx",
"args": ["-y", "@inpolicy/mcp-server"]
}
}
}

When the user first asks Claude to do something policy-relevant:

  1. The MCP server detects there’s no cached token.
  2. It opens the user’s default browser to the InPolicy sign-in page, on a randomly-bound localhost callback URL.
  3. The user signs into InPolicy as themselves, sees a consent screen (“Claude Desktop on andrew-mbp wants access”), and clicks Allow.
  4. The browser tab confirms “Connected, return to your AI assistant.”
  5. Claude resumes whatever the user originally asked. Subsequent calls use the cached token.

The token is stored on disk at:

OS Path
macOS ~/Library/Application Support/InPolicy/oauth.json
Windows %APPDATA%\InPolicy\oauth.json
Linux $XDG_CONFIG_HOME/inpolicy/oauth.json (default ~/.config/inpolicy/oauth.json)

File mode is 0600 on POSIX. Future versions will move this into the OS keystore (Keychain / DPAPI / libsecret).

Tokens auto-refresh. The user only sees the browser flow again if they revoke their grant from Settings → Connected Apps in the InPolicy dashboard, or if an admin revokes it.

If you run an InPolicy backend yourself, point the MCP at it via INPOLICY_API_URL. The MCP derives the dashboard URL from the API URL by convention (api.x.com → app.x.com); override that with INPOLICY_DASHBOARD_URL if your dashboard lives somewhere unusual.

{
"mcpServers": {
"inpolicy": {
"command": "npx",
"args": ["-y", "@inpolicy/mcp-server"],
"env": {
"INPOLICY_API_URL": "https://api.acme.internal/api/v1/agent",
"INPOLICY_DASHBOARD_URL": "https://policies.acme.internal"
}
}
}
}

You’ll also need to register an OAuth client in your InPolicy backend so it recognizes the MCP server’s client_id. Run make seed-oauth-clients against your backend’s database to register the shipped mcp_inpolicy_v1 client — the seed is idempotent and safe to re-run. A UI for registering custom clients is on the roadmap.