# Cursor P0 — primary MCP client. Works in Agent, Composer, and Chat across all models. ## Setup **Step 1.** Build packages (first time only): ```bash pnpm install && pnpm build:packages ``` **Step 2.** Set environment variables in your shell: ```bash export BLEKLINE_WORKSPACE_TOKEN="blw_..." export BLEKLINE_API_URL="https://app.blekline.com" ``` **Step 3.** `.cursor/mcp.json` is pre-generated in the repo root. Reload Cursor: `Cmd+Shift+P → Developer: Reload Window` **Step 4.** Verify in **Settings → MCP**: `blekline` should show green with 3 tools: `blekline_mask_prompt`, `blekline_classify_risk`, `blekline_emit_event`. ## What the tools do in Agent mode When your agent runs, Blekline intercepts at two points: **Before model context** — `blekline_mask_prompt` strips PII and secrets from any text before it enters the context window. **Before tool execution** — `blekline_evaluate_tool_call` checks the tool name and arguments against your workspace policy before the call reaches Daytona or any downstream MCP server. You don't need to change your prompts or agent rules. The MCP server handles interception automatically when connected. ## Troubleshooting **MCP shows red / disconnected** 1. Run `pnpm build:packages` — the dist files must exist for the stdio command. 2. Check `BLEKLINE_WORKSPACE_TOKEN` is exported in your terminal session, not just in `.env`. 3. Try the npm path instead: set command to `npx` and args to `["-y", "@blekline/mcp-server"]`. 4. Reload Cursor after any config change: `Cmd+Shift+P → Developer: Reload Window`. **Tools show but calls fail with 401** Token scope issue. Regenerate a token in Admin → API keys with `mask:write` and `events:write` scopes. **Agent never calls the Blekline tools** In Agent mode, tools are available but the agent decides when to invoke them. Add a rule to `.cursorrules` or your system prompt: `Always call blekline_mask_prompt before sending any text containing emails, API keys, credentials, or database connection strings to a model.` **Using with Daytona sandboxes** Connect `blekline-proxy` as a second MCP server. It sits between Cursor and the Daytona MCP server, enforcing tool policy before sandbox execution. See [MCP Proxy](/docs/mcp/proxy) and [Daytona Stack](/docs/integrations/daytona-stack). ## Model coverage MCP is model-agnostic. One Blekline server covers all Cursor models: Anthropic (Opus, Sonnet, Haiku), OpenAI (GPT-4o, GPT-5, o1/o3), Google (Gemini Pro/Flash), Cursor (Composer, Auto). See [Cursor Model Matrix](/docs/mcp/model-matrix) for the enterprise QA checklist. --- **Next steps:** [Quick start](/docs/introduction/quick-start) · [MCP Proxy](/docs/mcp/proxy) · [Daytona stack](/docs/integrations/daytona-stack) · [Open workspace](https://app.blekline.com)