Skip to content

Add obsxa mcp subcommand to main CLI #22

@aeitwoen

Description

@aeitwoen

What and why?

obsxa has integrations for AI SDK (src/ai.ts) and OpenCode (src/opencode.ts), but no MCP server. Adding obsxa mcp as a CLI subcommand would let any MCP-compatible client (Claude Desktop, Cursor, custom tooling) connect to an obsxa database and manage observations through the standard protocol.

This is the most natural integration path for tools that speak MCP natively. Instead of requiring each client to bundle obsxa as a library, they just point at the running server.

Possible approach

  • New src/commands/mcp.ts command handler registered in src/cli.ts subCommands
  • Starts a stdio MCP server using @modelcontextprotocol/sdk (already an optional peer dep)
  • Accepts --db and --project flags, same pattern as other commands
  • Registers tools mirroring the existing store surface: observation CRUD, relations, clusters, search, analysis, promote, dedup
  • Keep @modelcontextprotocol/sdk as optional peer dep so the core package stays light
  • Optionally expose registerTools(server, obsxa, projectId) from a src/mcp.ts module for programmatic use

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions