Skip to main content

MCP Server

Give AI coding assistants full context about your SaaS Starter project.

MCP Server

SaaS Starter includes a Model Context Protocol (MCP) server that exposes your project's structure, schemas, API routes, and business rules to AI coding assistants like Claude Code, Cursor, and Windsurf.

The MCP server gives AI agents the context to write SaaS Starter-idiomatic code on the first try — no more guessing about auth patterns, billing factory usage, or route structure.

What is MCP?

MCP lets AI assistants query structured tools instead of relying on pasted context. When you configure your AI editor to use the SaaS Starter MCP server, it can:

  • Read your database schema (Drizzle models)
  • Understand your API route structure
  • Know your billing provider selection
  • Access feature flags and module configuration
  • Get context about auth patterns and multi-tenancy setup

Starting the MCP Server

# From project root
pnpm mcp

# Or directly
npx tsx packages/mcp/src/bin.ts

The server communicates over stdio (standard input/output), making it compatible with Claude Desktop, Cursor, Windsurf, and other MCP-compatible editors.

Configuring Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):

{
  "mcpServers": {
    "app": {
      "command": "npx",
      "args": ["tsx", "/absolute/path/to/app/packages/mcp/src/bin.ts"]
    }
  }
}

Configuring Cursor

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

{
  "mcpServers": {
    "app": {
      "command": "npx",
      "args": ["tsx", "packages/mcp/src/bin.ts"]
    }
  }
}

Available Tools

The MCP server exposes these tools to AI assistants:

| Tool | Purpose | |------|---------| | get_schema | Returns full Drizzle schema with tables, columns, relations | | get_routes | Lists all API route files and their handlers | | get_config | Returns current provider selections (billing, AI, email, storage) | | get_plans | Returns subscription plans and feature limits | | get_modules | Lists enabled/disabled feature modules | | get_project_structure | Returns package layout and key file locations |

Verification

Test that MCP is working by asking your AI assistant:

"What tables are in the database schema?"

If the MCP server is connected, it should return structured schema information. For full setup instructions, see docs/guides/mcp.md in the repository root.