The spintax MCP server
An agent that drafts spintax needs a referee. The MCP server is that referee: three tools — validate, render, analyze — backed by the reference engine, so a model can check its own work before you see it. There are two doors to the same tools; you pick by constraint, not by preference.
Two doors, one engine
Both doors expose the identical three tools from @spintax/core, the reference engine, and they run the same tool module — a template that validates on one validates on the other. What differs is where the server runs and what it allows.
Hosted — spintax.net/mcp | Local — @spintax/mcp | |
|---|---|---|
| How you reach it | an HTTP URL | npx @spintax/mcp on your machine |
| Install | nothing | Node (npx fetches the rest) |
| Size caps | 8 KB template, 20 variants | none (configurable) |
#include | disabled | from disk |
| Network | required | none at runtime |
| Best for | a quick try, zero install | real work, offline, or where the hosted one can't be reached |
The three tools
validate_spintax— diagnostics with a severity, a stable code, and 1-based line and column. No errors means the template is safe to render.render_spintax— variants with a seed for reproducible output and a variable map for the context.analyze_spintax— what the template needs and contains: referenced variables,#setand#defdefinitions, includes, and construct counts.
Run it locally
The local server needs Node and nothing else. Point any MCP client — Claude Code, Claude Desktop, Cursor — at the package:
{
"mcpServers": {
"spintax": { "command": "npx", "args": ["-y", "@spintax/mcp"] }
}
}
That is the whole install. It has no size caps (the templates people actually ship outrun the hosted 8 KB), makes no network calls at runtime (the tools run on your machine, not against a server), and reads #include partials from disk when you point it at a root:
{
"mcpServers": {
"spintax": {
"command": "npx",
"args": ["-y", "@spintax/mcp", "--include-root", "./partials"]
}
}
}
The variant cap is yours to set with --max-variants (it defaults to 50, not the hosted 20). The same options are available as SPINTAX_MCP_* environment variables for clients that pass env rather than args.
Or use the hosted endpoint
When you only want to try the tools without installing anything, the hosted door is one line in Claude Code:
claude mcp add --transport http spintax https://spintax.net/mcp
It needs no account, answers over HTTP, and is listed in the official MCP registry as net.spintax/mcp. The trade is the caps — 8 KB per template, 20 variants per render, and #include disabled — because it pays for its own CPU on a free tier. Its full description lives in the server card.
Where the hosted door can't reach
The hosted endpoint runs on Cloudflare. Where Cloudflare is blocked — as it is across Russia — the URL cannot be reached, and no configuration changes that; it is also absent from ru.spintax.net, which is static and runs no server. The local server makes no such call at all, so it is the only working MCP path there — the same reason the Russian site moved to its own host. Air-gapped and firewalled machines are the same story once the package is installed: if it can run Node, it can run the tools.
Then what
The tools are the referee, not the author. The method for getting a template out of a model in the first place — the prompt, the review loop, the mistakes to watch for — is writing spintax templates with AI. To call the engine straight from your code instead of over MCP, see the four engines.