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:
| Capability | Environment variable | What it permits |
|---|---|---|
| Template and page execution | MCP_ENABLE_TEMPLATE_RENDER=true | Rendering a template string or an actual site route. This executes local templates and, for pages, their data loaders. |
| Project mutations | MCP_ENABLE_MUTATIONS=true | Full 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.
| Group | Examples | Purpose |
|---|---|---|
| Templates | validate_template, compile_template, analyze_template, list_components | Inspect the Ree engine and source without rendering. |
| Pages and project | list_pages, get_page_detail, get_route_map, get_config, search_code | Discover the actual static-site structure and localized output URLs. |
| Translations | list_translations, get_translations, check_translations | Read and audit language JSON files. |
| Quality | run_tests, validate_content | Run 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.
Recommended Use
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.