Skip to content

MCP API Reference

Rust MCP server · localhost:3721 · rooms as tools

loci exposes rooms and search as MCP tools. Any MCP-compatible client (Claude Code, Cursor, Zed) can call these tools to access your indexed conversations and room context.


Tool reference

ToolDescriptionParametersReturns
loci_searchSearch all indexed conversationsquery: string, tags?: string[], room?: string, limit?: numberSearchResult[]
room_devDev Room context + recent conversationsnoneRoomContext
room_designDesign Room contextnoneRoomContext
room_researchResearch Room contextnoneRoomContext
room_hatcheryHatchery contextnoneRoomContext
room_gardenGarden context + active plantsnoneRoomContext
loci_getRetrieve a specific locus by slugslug: stringLocus
loci_crystalliseCreate a new locus from a conversationconversationId: string, name: string, room: string, tags?: string[]Locus

Search all indexed conversations. Returns ranked results with matched excerpts.

Parameters:

NameTypeRequiredDescription
querystringyesSearch query (supports fuzzy matching)
tagsstring[]noFilter by tags
roomstringnoFilter by room (dev, design, research, hatchery, garden)
limitnumbernoMax results (default: 10)

Example invocation (Claude Code):

loci_search query="authentication flow" tags=["security"] limit=5

Example response:

json
{
  "results": [
    {
      "id": "conv-20260501-abc123",
      "title": "Debugging the auth redirect",
      "platform": "claude.ai",
      "room": "dev",
      "date": "2026-05-01T14:30:00Z",
      "excerpt": "...the **authentication** **flow** breaks when the session expires...",
      "score": 0.89,
      "tags": ["security", "auth"]
    }
  ],
  "total": 1
}

room_dev

Returns the Dev Room context file and recent conversations assigned to this room.

Parameters: none

Example invocation:

room_dev

Example response:

json
{
  "room": "dev",
  "context": "# Dev Room\n\nCurrent focus: payment webhook integration...",
  "recent": [
    {
      "id": "conv-20260503-xyz789",
      "title": "Webhook signature validation",
      "date": "2026-05-03T09:15:00Z",
      "turns": 12
    }
  ],
  "loci": [
    {
      "slug": "kafka-vs-sqs",
      "name": "Message queue decision: Kafka",
      "created": "2026-05-02T16:00:00Z"
    }
  ]
}

The context field contains the room's context.md file: this is the accumulated memory of the room.


room_design, room_research, room_hatchery, room_garden

Same signature as room_dev. Each returns the context and recent conversations for that room.

The Garden room additionally includes an activePlants field:

json
{
  "room": "garden",
  "context": "# Garden\n\nSlow synthesis space...",
  "recent": [...],
  "loci": [...],
  "activePlants": [
    { "name": "Invisible Proof", "status": "active" },
    { "name": "Political Voice", "status": "active" }
  ]
}

loci_get

Retrieve a specific locus by its slug.

Parameters:

NameTypeRequiredDescription
slugstringyesThe locus slug (filename without .locus)

Example invocation:

loci_get slug="kafka-vs-sqs"

Example response:

json
{
  "slug": "kafka-vs-sqs",
  "name": "Message queue decision: Kafka",
  "room": "dev",
  "created": "2026-05-02T16:00:00Z",
  "tags": ["architecture", "messaging"],
  "sourceConversation": "https://claude.ai/chat/abc123",
  "content": "# Message Queue Decision\n\nWe chose Kafka over SQS for the event pipeline..."
}

loci_crystallise

Create a new locus from an existing conversation.

Parameters:

NameTypeRequiredDescription
conversationIdstringyesThe conversation to crystallise
namestringyesHuman-readable name for the locus
roomstringyesTarget room (dev, design, research, hatchery, garden)
tagsstring[]noTags to apply

Example invocation:

loci_crystallise conversationId="conv-20260503-xyz789" name="Webhook signature validation" room="dev" tags=["security", "webhooks"]

Example response:

json
{
  "slug": "webhook-signature-validation",
  "name": "Webhook signature validation",
  "room": "dev",
  "created": "2026-05-03T10:00:00Z",
  "path": "~/.loci/loci/webhook-signature-validation.locus"
}

Wiring to your IDE

Claude Code

Add to ~/.claude/claude_code_config.json:

json
{
  "mcpServers": {
    "loci": {
      "command": "loci-server",
      "args": ["--port", "3721"]
    }
  }
}

Or if running via the Tauri app:

json
{
  "mcpServers": {
    "loci": {
      "url": "http://localhost:3721"
    }
  }
}

Cursor

Add to .cursor/mcp.json in your project root:

json
{
  "servers": {
    "loci": {
      "url": "http://localhost:3721",
      "tools": ["loci_search", "room_dev", "room_design", "room_research", "loci_get"]
    }
  }
}

Zed

Add to ~/.config/zed/settings.json:

json
{
  "assistant": {
    "mcp_servers": {
      "loci": {
        "command": "loci-server",
        "args": ["--port", "3721"]
      }
    }
  }
}

Type definitions

typescript
interface SearchResult {
  id: string;
  title: string;
  platform: "claude.ai" | "chatgpt.com" | "gemini.google.com";
  room?: string;
  date: string;       // ISO 8601
  excerpt: string;    // matched text with highlighting
  score: number;      // relevance score 0-1
  tags: string[];
}

interface RoomContext {
  room: string;
  context: string;    // contents of context.md
  recent: Conversation[];
  loci: LocusSummary[];
  activePlants?: Plant[];  // garden only
}

interface Locus {
  slug: string;
  name: string;
  room: string;
  created: string;
  tags: string[];
  sourceConversation?: string;
  content: string;
}

Server status

Check if the MCP server is running:

bash
curl http://localhost:3721/health

Response: { "status": "ok", "version": "1.0.0" }

See Architecture for how the MCP server fits into the loci stack.

Built by Hux × Vesper · Apache 2.0