@cnstra/mcp
v1.1.1
Published
MCP server for CNStra — gives Claude and Cursor instant understanding of your neuron graph
Downloads
93
Readme
@cnstra/mcp
MCP server for CNStra — gives Claude Code, Cursor, VS Code and Windsurf live access to your neuron graph.
Setup
npm i -D @cnstra/mcp
npx @cnstra/mcp initinit does three things:
- Generates
cns-mcp.ts(the server entry point) - Writes MCP config for every AI tool found in the project
- Prints a
CLAUDE.mdsnippet to paste into your project
Then wire up your CNS instance and registry in cns-mcp.ts:
import { startCNSMCPServer } from '@cnstra/mcp';
import { cns } from './src/cns';
import { registry } from './src/neurons/registry'; // CNSPersistOptionsRegistry
await startCNSMCPServer(cns, registry);The registry maps neurons and collaterals to stable names. Use per-file registration:
// src/neurons/registry.ts
import { CNSPersistOptionsRegistry } from '@cnstra/core';
export const registry = new CNSPersistOptionsRegistry();
// src/neurons/deck.ts
import { registry } from './registry';
registry
.register('deckNeuron', deckNeuron)
.registerCollateral('importStarted', importStarted);Or createPersistRegistry for simple projects:
import { createPersistRegistry } from '@cnstra/core';
export const registry = createPersistRegistry({ deckNeuron, cardNeuron });Open the project in Claude Code or Cursor — the server starts automatically.
Tools available to the AI
| Tool | What it returns |
|------|----------------|
| cns_get_context | CNStra concept guide + neuron list (start here) |
| cns_get_graph | Full graph: every neuron, what it emits and reacts to |
| cns_get_neuron | Details on one specific neuron |
| cns_list_neurons | One-line summary of all neurons |
| cns_list_collaterals | All collaterals with owners and subscribers |
Full docs: https://cnstra.org/docs/devtools/mcp
