MCP Server

ReeWeb includes a Model Context Protocol server for project-aware AI assistance. It can inspect pages, routes, translations, configuration, components, Markdown content, and collection health without treating the project as an unstructured directory tree.

The server is a local stdio process that speaks JSON-RPC 2.0 through standard input and output. It does not open an HTTP port. Do not expose its stdio or an MCP bridge on a network endpoint.

Connect a Client

Register this equivalent server configuration in your MCP client, setting cwd to the ReeWeb project root:

{
    "mcpServers": {
        "reeweb": {
            "command": "bun",
            "args": ["run", "mcp"],
            "cwd": "/path/to/your/reeweb-project"
        }
    }
}

For troubleshooting, start the process directly:

bun run mcp

Protocol messages are written to stdout and diagnostics to stderr. A wrapper must preserve that separation.

Safety Model

The ordinary tool surface is read-only: it lists and analyzes pages, reads translations and configuration, searches authored code, validates content collections, and runs tests.

Two capabilities require a local opt-in:

CapabilityEnvironment variableWhat it permits
Template and page executionMCP_ENABLE_TEMPLATE_RENDER=trueRendering a template string or an actual site route. This executes local templates and, for pages, their data loaders.
Project mutationsMCP_ENABLE_MUTATIONS=trueFull SSG output generation, translation writes, and adding or removing languages.

Scope the setting to the MCP process rather than placing it in a deployed environment:

MCP_ENABLE_MUTATIONS=true bun run mcp

Tool Groups

The server currently registers 24 tools.

GroupExamplesPurpose
Templatesvalidate_template, compile_template, analyze_template, list_componentsInspect the Ree engine and source without rendering.
Pages and projectlist_pages, get_page_detail, get_route_map, get_config, search_codeDiscover the actual static-site structure and localized output URLs.
Translationslist_translations, get_translations, check_translationsRead and audit language JSON files.
Qualityrun_tests, validate_contentRun tests and validate collection frontmatter plus .ree/.md route collisions.

With the relevant opt-in, it also provides render_template, render_page, run_ssg, set_translations, add_language, and remove_language.

remove_demo_routes deserves special care: it deletes the starter homepage, sample pages, demos, their translation keys, and navigation links immediately. It has no dry run. Use version control to recover from it and invoke it only when turning a fresh template into a real project.

Use MCP when a task benefits from framework-aware inspection: find the source for a rendered route, verify localized URLs, check translation gaps, validate frontmatter before a build, or render a specific page with the exact SSG path. The source files and normal ReeWeb commands remain the authority for all changes.