Skip to content

MCP Server

A Model Context Protocol server that gives AI coding assistants deep access to Juice documentation, API reference, and code scaffolding.

What Is MCP?

The Model Context Protocol is an open standard for connecting AI assistants to external tools and data sources. Instead of pasting documentation into chat, the assistant calls tools to search docs, look up APIs, and generate code on demand.

Setup

Claude Code

Add to your project's .claude/settings.json:

{
  "mcpServers": {
    "juice": {
      "command": "bunx",
      "args": ["@cmj/juice-mcp"]
    }
  }
}

Claude Desktop

Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

{
  "mcpServers": {
    "juice": {
      "command": "npx",
      "args": ["@cmj/juice-mcp"]
    }
  }
}

From Source

If you have the Juice repo cloned locally:

{
  "mcpServers": {
    "juice": {
      "command": "bun",
      "args": ["packages/juice-mcp/src/index.ts"]
    }
  }
}

Tools

The MCP server exposes four tools that AI assistants can call:

search_docs

Full-text search across all Juice documentation. Returns matching pages ranked by relevance.

// Input
{ "query": "streaming modes" }

// Returns: matched doc pages with summaries and content previews

get_api

Look up a specific API export by name. Returns the full signature, description, and usage example.

// Input
{ "name": "createRouter" }

// Returns: signature, description, code example
// Available: createRouter, redirect, cache, setContext, getContext,
//   createContextKey, createActionContext, Link, useRouter,
//   initNavigation, prefetchRSC

explain

Explain a Juice concept in detail with code examples. Finds the most relevant documentation page and returns its full content.

// Input
{ "topic": "flight manifest" }

// Returns: full documentation for the matched concept

scaffold

Generate Juice boilerplate code for common patterns.

// Input
{ "pattern": "server-action" }

// Available patterns:
//   route, dynamic-route, layout, middleware, server-action,
//   api-route, server-entry, client-component, vite-config

Resources

The server also exposes 28 documentation pages as MCP resources. AI assistants can list and read them on demand:

juice://docs/guides/quickstart
juice://docs/guides/concepts
juice://docs/guides/routing
juice://docs/reference/api
juice://docs/reference/options
...

Each resource returns the full page content as markdown.

How It Works

The MCP server bundles all Juice documentation as content strings — extracted from the same source files that power this docs site. It runs as a local stdio process (no network requests, no API keys) and responds to tool calls from the connected AI assistant.

The architecture:

  1. AI assistant connects via stdio transport
  2. Assistant discovers available tools and resources
  3. When the user asks about Juice, the assistant calls search_docs or get_api
  4. The server searches its bundled content and returns results
  5. The assistant uses the results to give accurate, Juice-specific answers

Package Details

Package@cmj/juice-mcp
Transportstdio (local process)
Dependencies@modelcontextprotocol/sdk
RuntimeBun (source) or Node.js (compiled)
Sourcepackages/juice-mcp/ in the Juice repo