Packages
@thexjs/mcp
An MCP (Model Context Protocol) server that gives AI coding agents grounded, accurate knowledge of X. Instead of letting an agent pattern-match to Next.js, Remix, Astro, or TanStack Start syntax that looks similar but behaves differently, the agent asks this server and gets the framework's actual conventions.
Every app created with create-thexjs-app already ships wired up: .mcp.json for Claude Code and .cursor/mcp.json for Cursor point at bunx @thexjs/mcp. To add it to an existing project by hand, drop this file at the project root:
{ "mcpServers": { "thexjs": { "command": "bunx", "args": ["@thexjs/mcp"] } }}Tools
| Tool | Purpose |
|---|---|
| list_topics() | Lists every doc topic available for X. Call this first to see what exists, then fetch individual topics with get_docs. |
| get_docs(topic) | Returns grounded reference docs for one topic (routing, loaders, static-vs-ssr, layouts, middleware, api-routes, actions, config, env, auth, data, images, content, navigation, cli, gotchas). Includes explicit corrections for the conventions agents most often get wrong. |
| search_docs(query) | Full-text search across all topics, for when the exact topic id is unknown. |
| scaffold_file(kind, name) | Generates a correctly-shaped file (page, dynamic-page, layout, middleware, api-route, action) with the right exports, path, and conventions, ready to paste. |
Why it exists
X deliberately diverges from similar frameworks in a few specific places: server functions have no "use server" directives, special files are underscore-prefixed (_layout.tsx, _middleware.ts), public env vars must carry the THEXJS_PUBLIC_ prefix, and loaders receive { params, request } rather than a context object. Those are exactly the details a general-purpose coding agent gets wrong from training data alone. This server grounds the agent in real conventions before it writes code.