betterspec
Integrations

MCP Server

Access betterspec through the Model Context Protocol.

MCP Server

The betterspec MCP server exposes your project's specs, knowledge, and capabilities through the Model Context Protocol. It is the primary programmatic interface for AI coding platforms to interact with betterspec — giving them structured, typed access without raw filesystem scanning.

Installation

# Via npx (no global install needed)
npx @betterspec/mcp

# Via the CLI
betterspec serve

Both start a stdio-based MCP server in the current directory (or nearest parent with a betterspec/ directory).

Connecting to Your AI Tool

Claude Code

claude mcp add betterspec -- npx @betterspec/mcp

OpenCode

Add to your OpenCode MCP configuration:

{
  "betterspec": {
    "command": "npx",
    "args": ["@betterspec/mcp"]
  }
}

Gemini CLI

Add to your Gemini CLI settings:

{
  "mcpServers": {
    "betterspec": {
      "command": "npx",
      "args": ["@betterspec/mcp"]
    }
  }
}

Cursor

Add to .cursor/mcp.json:

{
  "mcpServers": {
    "betterspec": {
      "command": "npx",
      "args": ["@betterspec/mcp"]
    }
  }
}

Available Tools

The MCP server exposes 9 tools that AI platforms can call:

Read

ToolDescription
betterspec_statusGet project status — active changes, capabilities count, task completion
betterspec_listList changes with optional status filter and archived flag
betterspec_showReturn all spec files for a change (proposal, requirements, scenarios, design, tasks)
betterspec_searchKeyword search across specs and capabilities
betterspec_impactShow what specs and capabilities reference a file or path
betterspec_digestGet a summary of project knowledge — capabilities, active changes, configuration

Write

ToolDescription
betterspec_proposeCreate a new change proposal from a description
betterspec_archiveArchive a completed change with an optional outcome summary

Analysis

ToolDescription
betterspec_verifyRun structural completeness checks on a change's spec files
betterspec_diffRun drift analysis and return the full drift report (score + items)

Available Resources

The MCP server exposes 6 resources that AI platforms can read:

Resource URIDescription
betterspec://knowledge/architectureProject architecture documentation
betterspec://knowledge/patternsEstablished code patterns and conventions
betterspec://knowledge/glossaryDomain-specific terminology
betterspec://capabilitiesAll registered project capabilities (JSON)
betterspec://decisionsArchitecture decision records (JSON)
betterspec://changes/activeCurrently active change specifications (JSON)

Typical AI workflow via MCP

1. betterspec_status       → understand current project state
2. betterspec_show         → read full spec for a change before implementing
3. betterspec_diff         → check for drift before starting work
4. betterspec_propose      → create a new change when planning
5. betterspec_verify       → confirm spec is complete before handing off to builder
6. betterspec_archive      → capture outcome and knowledge after implementation

MCP vs. Direct File Access

The MCP server is optional. AI tools can always read betterspec files directly from the filesystem. Use MCP when:

  • You want structured, typed access instead of raw markdown reads
  • Your tool supports MCP natively
  • You need to run actions (propose, archive) programmatically in sandboxed environments

On this page