MCP server

/

Coding assistants

Cursor

Installing Spectron as an MCP server in Cursor.

Installing Spectron in Cursor gives every AI interaction in your editor access to persistent memory. Cursor's agent can recall previous decisions, project context, and user preferences across sessions without you having to repeat yourself.

Run the following command in your terminal, replacing acme-prod with your context ID:

npx install-mcp spectron --client cursor --context acme-prod

The installer prompts for your Spectron API key and writes the MCP configuration to ~/.cursor/mcp.json. If that file already exists, the spectron entry is merged in without disturbing other MCP servers.

{
"mcpServers": {
"spectron": {
"url": "https://api.spectron.dev/mcp",
"headers": {
"API-KEY": "<your-api-key>",
"X-Spectron-Context": "acme-prod"
}
}
}
}

For self-hosted Spectron, replace https://api.spectron.dev with your server's base URL.

To isolate memory by project, pass --scope flags. Each project can have its own context so that memories from one codebase do not surface in another:

npx install-mcp spectron \
--client cursor \
--context acme-prod \
--scope user=alice \
--scope project=platform-v3

This adds X-Spectron-Scope: user=alice,project=platform-v3 to the headers, so all tool calls default to that scope. You can still override scope per call by passing a scope argument to any tool.

  1. Open Cursor

  2. Navigate to Settings → Features → MCP

  3. You should see spectron listed with a green indicator confirming the server is reachable

  4. Open the chat panel and ask: "What MCP tools do you have available?" – Cursor should report the seven Spectron tools

If the indicator is red, check that the URL and API key in ~/.cursor/mcp.json are correct and that your Spectron instance is accessible.

At the start of a work session, tell Cursor about the project:

"Remember that we're using a hexagonal architecture pattern in this codebase and that all new services should implement the Repository interface before touching the domain layer."

Cursor invokes memory_store automatically. The next time you start a session, that instruction is retrieved by memory_recall before Cursor answers questions about architecture.

When you ask an architectural question:

"Should I add this feature to the gateway service or create a new service?"

Cursor calls memory_recall with the query before composing its response, retrieving previous decisions about service boundaries and applying them to its answer.

If you have synced your documentation into Spectron's authoritative knowledge:

"What does our internal wiki say about the deployment process?"

Cursor calls knowledge_search against the knowledge base and incorporates the retrieved content into its response.

Because scope is set in the config headers, memories stored while working on platform-v3 are automatically isolated from memories in a different project context. Switch projects by editing ~/.cursor/mcp.json or by running install-mcp again with different --scope flags.

To change the API key, context, or scope after installation, edit ~/.cursor/mcp.json directly or re-run the install command. Re-running merges the new values over the existing entry:

npx install-mcp spectron \
--client cursor \
--context acme-prod \
--scope user=alice \
--scope project=new-project

Open ~/.cursor/mcp.json and delete the "spectron" key from mcpServers. Cursor will no longer offer the Spectron tools in subsequent sessions.

Was this page helpful?