Skip to content

MCP Server

The xript MCP server is a Model Context Protocol front-end built into @xriptjs/cli. It hands an agent the same capabilities the CLI hands a human, over one stdio connection: every command as a callable tool, the spec and authoring doctrine as resources, and reusable advisory prompts. Nothing forks; each tool runs the exact code the matching CLI command runs, so the two can’t drift.

Agents are first-class mod authors, and without the server they’re flying blind. An agent writing a mod guesses at the manifest schema, can’t validate without a human shelling out to the CLI, and answers theory questions from stale memory. The MCP closes that loop. Author, validate, run, and stay grounded in canon, all in one place.

The server is a subcommand of the CLI:

Terminal window
xript mcp

Or run it without a global install, which is the convenient form for client configuration:

Terminal window
npx -y @xriptjs/cli mcp

Configure your MCP client to launch xript mcp (or npx -y @xriptjs/cli mcp) over stdio.

ToolWhat it does
xript_validateValidate an app or mod manifest (auto-detects which)
xript_cross_validateCheck a mod’s capabilities, fills, and each fill’s payload against a host’s slots
xript_typegenGenerate TypeScript definitions from a manifest (ambient for the xript global)
xript_docgenGenerate markdown documentation from a manifest
xript_sanitizeSanitize an HTML fragment and report what was stripped
xript_scaffoldGenerate the files for a new app or mod project
xript_scanRead @xript annotations from a source directory into bindings
xript_manifest_describeSummarize exactly what a host exposes: bindings, hooks, slots, capabilities
xript_runLoad a mod into the QuickJS WASM sandbox and optionally invoke an export
xript_scoreScore a host’s moddability capacity: contract integrity, and how much extension surface it exposes
xript_score_diffDiff a host’s score against a saved baseline; toward or away from xript
xript_lintReview a host + mods for actionable findings; the complement to xript_score
xript_guideRead canonical authoring doctrine by topic
xript_server_infoReport the running server’s name, version, build timestamp, and runtime

xript_manifest_describe is the one to reach for first when authoring against a host. Point it at the host’s manifest and it returns the surface the mod can call and contribute into, derived from the manifest rather than guessed.

xript_server_info reports the build timestamp from the running module’s own file mtime, so a server process whose binary predates a change in the xript repo is detectable. If builtAt looks stale, rebuild and reconnect before trusting results.

Every tool that takes a manifest accepts either a file path or the inline JSON. Pass a path, absolute or relative to the client’s workspace root, and the server reads the file itself, so a large manifest never has to ride through the tool-call tokens. A value that starts with { or [ is treated as inline JSON; anything else is treated as a path. Relative paths resolve against the workspace root the client advertises (the same mechanism xript_scan uses); without a root, pass an absolute path.

The server serves the xript spec straight from source, so an agent’s answers can’t drift from what the spec actually says:

  • xript://spec/{manifest,mod-manifest,capabilities,bindings,hooks,fragments,modules,security,vision,annotations,debug-protocol}
  • xript://spec/{manifest-schema,mod-manifest-schema}
  • xript://guidance/{when-to-use,surfaces,mod-zero,boundary,openness,authoring,hosting,tiers}

Reusable advisory templates, each grounded in the doctrine:

PromptUse it to
adopt-xriptDecide whether a surface should be manifest-driven
is-this-xript-nativeAudit whether a surface is genuinely extensible or hardcoded next to a manifest
choose-a-surfacePick the right surface: binding, hook, slot, fragment, capability, or command
author-a-modWalk the authoring loop, optionally against a specific host manifest

The guidance the server serves is authored as content, not baked into the server. Editing a topic isn’t a recompile; it’s editing markdown. The same content backs the xript_guide tool and the xript://guidance/* resources, so there’s exactly one source of truth for what xript recommends.