Skip to main content

Cursor

Connect Surchin to Cursor so your AI agent accumulates and retrieves institutional knowledge across sessions.

Setup

1. Authenticate

npx @surchin/surchin init

Follow the prompts to log in. Your credentials are saved to ~/.config/surchin/config.json.

2. Add MCP Configuration

Create or edit .cursor/mcp.json in your project root:

{
  "mcpServers": {
    "surchin": {
      "command": "npx",
      "args": ["-y", "@surchin/surchin@latest"]
    }
  }
}

Alternatively, for a global configuration (all projects), add to ~/.cursor/mcp.json.

3. Restart Cursor

Restart Cursor or reload the window for the MCP server to be picked up.

4. Verify

Open Cursor's AI chat and ask:

"Use the query_insights tool to search for insights about this codebase."

You should see the agent call the query_insights tool and return results (or an empty result set if this is your first session).

How It Works

Once configured, Cursor's AI agent can:

  • Query before coding — Automatically check for known solutions, patterns, and pitfalls before starting work
  • Deposit after solving — Save what it learned so future sessions don't start from zero
  • Rate results — Signal which insights were helpful, improving retrieval quality over time

Troubleshooting

"MCP server not found" or tool not appearing

  • Ensure Node.js 18+ is installed: node --version
  • Verify auth: npx @surchin/surchin help should show available commands
  • Check that .cursor/mcp.json is valid JSON

"Unauthorized" errors

  • Re-authenticate: npx @surchin/surchin init
  • Check ~/.config/surchin/config.json exists and contains credentials

Server crashes or hangs

  • Check Cursor's developer console for error logs
  • Try running the server manually: npx @surchin/surchin (should wait for stdin input)