Hub/Docs

MCP Server

How external agents interact with the wiki-base via the Model Context Protocol: read-only by default.

The Idea

Every community, product, and service will eventually have an externalised knowledge base that agents can query. The MCP server is how external agents: Claude Code, Cursor, Windsurf, or any MCP-compatible client: interact with the Latent Space wiki-base programmatically.

Instead of humans reading docs or searching a website, their agents connect to the knowledge graph directly, search it, and bring back what's relevant.

Architecture

The standalone MCP server (apps/mcp-server-standalone/) connects directly to Turso via @libsql/client. It runs as a stdio process: the MCP client spawns it as a subprocess.

AI Agent (Claude Code / Cursor / Windsurf)
    ↓ stdio
latent-space-hub-mcp (Node.js process)
    ↓ libsql
Turso cloud SQLite

Published to NPM as latent-space-hub-mcp.

Quick Start

Add to your Claude Code, Cursor, or Windsurf MCP config:

{
  "mcpServers": {
    "latent-space-hub": {
      "command": "npx",
      "args": ["-y", "latent-space-hub-mcp"],
      "env": {
        "TURSO_DATABASE_URL": "your-turso-url",
        "TURSO_AUTH_TOKEN": "your-turso-token"
      }
    }
  }
}

Security

The MCP server is read-only by default. External agents can search and read the wiki-base but cannot create, update, or delete anything.

Write tools (node creation, edge creation, dimension management) are only registered when MCP_ALLOW_WRITES=true is explicitly set. This is intended for trusted internal use only: not for public-facing agent access.

VariableDescriptionDefault
TURSO_DATABASE_URLTurso database URL (required):
TURSO_AUTH_TOKENTurso auth token (required):
MCP_ALLOW_WRITESEnable write toolsfalse
OPENAI_API_KEYEnables vector search in ls_search_nodes:
LSH_SKILLS_DIRCustom skills directory~/.latent-space-hub/skills/

The Turso credentials are the primary security boundary. Do not share them publicly.

Read Tools (Always Available)

ToolDescription
ls_get_contextGraph overview: stats, top nodes, dimensions, available skills
ls_search_nodesHybrid search across nodes by title/description. Supports node_type, date range, and dimension filters
ls_search_contentFull-text + vector search through source material (transcripts, articles). Hybrid RRF fusion
ls_get_nodesLoad full node records by ID (up to 10 per call)
ls_query_edgesFind all connections for a specific node
ls_list_dimensionsList all dimensions/tags with node counts
ls_sqlite_queryRun read-only SQL: SELECT, WITH, PRAGMA only
ls_list_skillsList system and custom skills
ls_read_skillRead a skill by name

Write Tools (Requires MCP_ALLOW_WRITES=true)

ToolDescription
ls_add_nodeCreate a new node (title + dimensions required)
ls_update_nodeUpdate a node: content appends to notes, dimensions replace
ls_create_edgeConnect two nodes with a directional relationship and explanation
ls_update_edgeUpdate an edge's explanation
ls_create_dimensionCreate a new dimension/tag
ls_update_dimensionRename or update a dimension
ls_delete_dimensionDelete a dimension and remove from all nodes
ls_write_skillCreate or update a custom skill
ls_delete_skillDelete a custom skill

Setup Options

OptionConfigNotes
NPX (standalone)"command": "npx", "args": ["-y", "latent-space-hub-mcp"]No local repo needed. Connects directly to Turso. Read-only by default.
Local stdio"command": "node", "args": ["path/to/apps/mcp-server/stdio-server.js"]Requires hub running (npm run dev). Proxies to Next.js API.
HTTP transport"url": "http://127.0.0.1:44145/mcp"For agents supporting HTTP MCP transport.

Slop Does Not Use MCP

The Discord bot (Slop) used to connect via MCP but has been decoupled. Slop now queries Turso directly with its own internal tools (slop_* prefix) in apps/bots/slop/. The MCP server is exclusively for external agent access.