Cursor + ContextsBase Integration

The MCP server for Cursor that serves specs, schemas, and backlog.

Stop pasting 600-line spec docs or stuffing your entire data model into .cursorrules. ContextsBase connects directly to Cursor over the Model Context Protocol (MCP). Cursor Composer claims the next feature, reads structured business rules, and reports test results back.

  • Tested with Cursor 0.45+
  • JSON-RPC 2.0 & HTTP SSE
  • Free for 1 project
.cursor/mcp.json (Cursor workspace config)
{
  "mcpServers": {
    "contextsbase": {
      "command": "npx",
      "args": ["-y", "@contextsbase/mcp-server"],
      "env": {
        "CONTEXTSBASE_TOKEN": "cb_tok_live_abc123..."
      }
    }
  }
}
Instant Configuration

Add to your repository in under 60 seconds

Save the configuration into .cursor/mcp.json in your project root. Cursor will immediately detect the contextsbase server, light up green in your Cursor MCP settings, and expose the five core tools to Composer and Agent mode.

01

Why Cursor needs a dedicated MCP server

Cursor is one of the fastest AI editors, but it suffers from a fundamental context dilemma: prompts and .cursorrules are static, unversioned, and consume precious context window.

When you paste requirements into Cursor Composer, you are feeding unstructured prose. Cursor guesses the foreign keys in your database, guesses whether a user should be redirected, and tests buttons instead of underlying business logic.

ContextsBase solves this by acting as the context infrastructure for Cursor. Instead of dumping your app’s entire history into prompt tokens, Cursor calls ContextsBase over MCP on demand. It receives:

  • Structured Entities: JSON data models with fields, types, and relations so Cursor never invents a column.
  • Business Rules (F-n): Functional specs with explicit acceptance criteria and edge cases.
  • Given / When / Then Tests (T-n): Rules Cursor automatically converts into Playwright assertions.
  • Atomic Claims: Iteration items claimed one by one so multi-turn sessions don't duplicate work.

02

2-minute Cursor MCP setup

You can configure ContextsBase in Cursor in two ways: via local stdio process (npx) or direct HTTP SSE connection.

Option A: Workspace .cursor/mcp.json (Recommended)

Create a file at .cursor/mcp.json in your project repository root. Paste this snippet:

.cursor/mcp.json
{
  "mcpServers": {
    "contextsbase": {
      "command": "npx",
      "args": ["-y", "@contextsbase/mcp-server"],
      "env": {
        "CONTEXTSBASE_TOKEN": "cb_tok_live_abc123..."
      }
    }
  }
}

Option B: Direct Remote HTTP SSE

If your team prefers not to run local Node processes or wants Cursor connected across remote VMs:

.cursor/mcp.json (HTTP SSE)
{
  "mcpServers": {
    "contextsbase": {
      "url": "https://app.contextsbase.com/api/v1/mcp",
      "headers": {
        "Authorization": "Bearer cb_tok_live_abc123..."
      }
    }
  }
}

Verify Connection in Cursor

Open Cursor Settings > Features > MCP. You will see contextsbase with a green status indicator and 5 tools enabled.

03

Tools exposed to Cursor

ContextsBase provides five purpose-built MCP tools. Cursor calls them automatically during Composer and Agent sessions:

  • list_iterations

    read

    Returns open iterations and ordered features. Cursor knows what is planned and next.

  • next_iteration_item

    read

    Claims the next pending feature atomically. Returns spec, business rules, entities, flow, tests, and theme.

  • get_feature_spec

    read

    Fetches one published feature spec by ID (e.g. F-3). Draft features are hidden from the agent.

  • record_test_automation

    records

    Stores the generated Playwright test file, test case ID (e.g. T-7), and pass/fail result back into ContextsBase.

  • record_feature_implementation

    records

    Records the implemented code files against the spec fingerprint. Triggers Outdated status if spec changes.

04

The Cursor Composer workflow

Once connected, you no longer need to write multi-paragraph prompts describing your database schema or acceptance criteria. Simply trigger Cursor Composer (Cmd + I or Ctrl + I) with:

Cursor Composer prompt
Check ContextsBase next_iteration_item, implement the claimed feature, and run the Playwright test cases.
Prompting Cursor Composer with ContextsBase

Here is what happens under the hood:

  1. 01
    Atomic Claim: Cursor invokes next_iteration_item. ContextsBase locks the next pending feature (e.g. F-4) to prevent collisions.
  2. 02
    Schema & Rules Ingestion: The payload delivers exact TypeScript/SQL entity definitions and Given/When/Then test cases into Cursor’s session.
  3. 03
    Code & Playwright Generation: Cursor writes the components and produces a matching Playwright spec.
  4. 04
    Feedback & Recording: Cursor calls record_test_automation and record_feature_implementation. The feature moves to Implemented with a cryptographic fingerprint of the spec.

05

Product walkthrough in action

Watch how an agent pulls from ContextsBase over MCP, implements a spec, and updates the backlog:

walkthrough

06

ContextsBase vs .cursorrules

Most developers start with a .cursorrules file. Here is how that scales as your codebase grows:

Comparison of .cursorrules versus ContextsBase MCP server
Feature.cursorrules fileContextsBase MCP
Context Window CostConsumed on every promptFetched on demand per feature
Data Model IntegrityProne to truncation / driftLive JSON schema delivered per tool call
Multi-agent CoordinationNone (files overwrite)Atomic claim queue across agents
Test VerificationManual copy-pasteAutomated Given/When/Then tracking
Spec Drift AlertsNoneFingerprint marks code Outdated on edits

07

Frequently asked questions

How does Cursor connect to ContextsBase over MCP?

Cursor connects via the Model Context Protocol (MCP) using a standard `.cursor/mcp.json` file in your workspace or via Cursor Settings > MCP. You supply your project's ContextsBase MCP token.

Does ContextsBase replace .cursorrules?

It replaces bloated architectural specs and rules inside `.cursorrules`. Keep small code formatting preferences in `.cursorrules`, and let ContextsBase serve live business logic, schemas, and test cases dynamically over MCP so context windows stay clean.

Can Cursor write back to ContextsBase?

Yes. With the 'records' token scope, Cursor automatically records which files implemented the feature and reports Playwright test run results against the Given/When/Then test cases.

What happens if two developers run Cursor simultaneously?

ContextsBase uses atomic claims on iteration items (`next_iteration_item`). One agent takes F-3, while the next agent immediately receives F-4. They never overwrite or duplicate work.

Give Cursor the context infrastructure it deserves.

Set up ContextsBase in 2 minutes. Free forever for 1 project with full MCP access.

  • Free for one project
  • Bring your own agent