Skip to content

Cursor setup

Cursor supports the Model Context Protocol, so InPolicy integrates the same way it does for Claude Desktop.

  • Cursor installed.
  • Node.js 18+.
  • An InPolicy API key.
  1. Open Cursor, then Settings → Cursor Settings → MCP (or Settings → Features → MCP Servers depending on Cursor version).

  2. Click Add new MCP server and paste this config:

    {
    "mcpServers": {
    "inpolicy": {
    "command": "npx",
    "args": ["-y", "@inpolicy/mcp-server"],
    "env": {
    "INPOLICY_API_KEY": "inp_live_REPLACE_ME"
    }
    }
    }
    }
  3. Save. Cursor loads the server on the next chat panel open. You should see inpolicy listed with a green status.

  4. Apply the system prompt template under Settings → Rules → User Rules (or at the project level in .cursor/rules.md).

Cursor’s MCP config location varies by platform:

PlatformPath
macOS~/Library/Application Support/Cursor/User/globalStorage/mcp.json
Windows%APPDATA%\Cursor\User\globalStorage\mcp.json
Linux~/.config/Cursor/User/globalStorage/mcp.json

Ship the same JSON shown above to that file via your MDM or scripting layer, substituting the API key at deploy time.

For engineering-org-wide enforcement at the project level, check in a .cursor/rules.md at the repo root with the system prompt. Engineers pick it up as soon as they open the project.

Open Cursor’s chat and ask:

“What InPolicy tools are available?”

Cursor should list the tools. If it doesn’t:

  • Check Settings → MCP. The inpolicy entry should show green. Yellow usually means Node isn’t available; red means bad config or a bad API key.
  • Restart Cursor (sometimes MCP servers need a full restart, not just a window reload).
  • Run the server manually to test: INPOLICY_API_KEY=... npx -y @inpolicy/mcp-server. It should print a readiness line to stderr and wait for stdin.
  • Cursor’s Composer mode (the multi-file agent) benefits most from InPolicy. That’s the context where the AI is making consequential changes and a policy nudge matters.
  • Cursor’s Tab completion does not route through MCP, so InPolicy does not see those completions. That’s expected.
  • Cursor’s agent has stronger tendency to invoke tools than Claude Desktop, so compliance with the system prompt is generally higher.