MCP server
The Rule Cascade Model Context Protocol server, on your machine or hosted at mcp.rulescascade.com - transports, tools, prompts, resources and safety model.
Rule Cascade serves the Model Context Protocol (MCP), so any AI agent can read the specification, check and evaluate rulesets, derive rules from API schemas and, on your machine, propose rules for a person to accept. There are two ways to use it.
Local: rcas mcp | Hosted: https://mcp.rulescascade.com/mcp | |
|---|---|---|
| Installation | npx -y @rules-cascade/cli mcp (Node), or the rcas binary | None |
| Sees | Your project: its rulesets, schemas and code | Only the files the agent sends with each call |
| Can propose rulesets | Yes, propose_ruleset (a person accepts) | No |
Finds rules in code (analyze) | Yes | No |
| Transports | Standard input and output, or HTTP | HTTP |
| Stores | Proposals under .rcas/proposals/ | Nothing |
Use the local server in a project. Use the hosted one to ask about the language, to try a ruleset without installing anything, or from a client that only takes a URL (Claude.ai and ChatGPT connectors).
Connect an agent
rcas mcp install writes the entry each tool expects; AI coding tools lists them all.
# the local server, started by the tool (the default)
npx -y @rules-cascade/cli mcp install claude cursor vscode
# the hosted server
npx -y @rules-cascade/cli mcp install claude cursor vscode --url https://mcp.rulescascade.com/mcpBy hand, the hosted server is:
| Tool | Entry |
|---|---|
| Claude Code | claude mcp add --transport http rules-cascade https://mcp.rulescascade.com/mcp |
| Codex | codex mcp add rules-cascade --url https://mcp.rulescascade.com/mcp |
| Gemini CLI | gemini mcp add --transport http rules-cascade https://mcp.rulescascade.com/mcp |
| Cursor, Kiro, Junie, Amp, Zed, Warp | { "url": "https://mcp.rulescascade.com/mcp" } |
| VS Code, Copilot CLI, Factory, Augment, Amazon Q | { "type": "http", "url": "https://mcp.rulescascade.com/mcp" } |
| Cline | { "type": "streamableHttp", "url": "https://mcp.rulescascade.com/mcp" } |
| OpenCode, Kilo | { "type": "remote", "url": "https://mcp.rulescascade.com/mcp", "enabled": true } |
| Devin, Windsurf | { "serverUrl": "https://mcp.rulescascade.com/mcp" } |
| Claude.ai, Claude Desktop | Settings, Connectors, Add custom connector: the URL, no sign-in (the configuration file of Claude Desktop takes only local servers) |
| ChatGPT | Add a custom MCP server with the URL |
Transports and protocol revisions
| Transport | How | For |
|---|---|---|
| Standard input and output | rcas mcp | Tools that start the server (the default of mcp install) |
| Streamable HTTP | POST /mcp | Every current client; the hosted server |
| HTTP+SSE (deprecated) | GET /sse, then POST /messages | Clients from before March 2025 |
The HTTP server also answers GET /health with ok (and /healthz, for probes), and GET / with a
short text that says what it is.
Every transport speaks every revision from 2024-11-05 to 2026-07-28. A client on the current revision
(2026-07-28) sends its protocol version and capabilities with each request and can call
server/discover; an older client opens with initialize. Either way the server remembers nothing
between requests, so one process serves any number of clients and needs no sticky sessions.
On Streamable HTTP, every request is answered with one JSON object, except subscriptions/listen,
which is answered with an event stream that stays open. The server checks the MCP-Protocol-Version,
Mcp-Method and Mcp-Name headers of a current request against its body (400, code -32020, when
they differ), answers an unknown revision with the ones it supports (400, code -32022), and
answers GET and DELETE on /mcp with 405: there is no standalone stream and no session to end.
Run the HTTP server on your machine
For a client that only takes a URL, or to share one server between several tools:
rcas mcp --http 127.0.0.1:8765 # your project, this machine only
rcas mcp --hosted --http 127.0.0.1:8765 # no project, like mcp.rulescascade.comrcas mcp [--root <dir>] [--read-only] [--hosted] [--list-tools]
[--http <addr> [--allow-origin <origins>] [--no-sse]]| Flag | Meaning |
|---|---|
--root <dir> | The project. Default: the directory the tool starts it in; rcas.yaml is looked up from there |
--read-only | Leave out propose_ruleset. Also mcp.readOnly: true in rcas.yaml |
--hosted | Serve no project: tools take the files as an argument, keep nothing, and analyze and the proposal tools are left out |
--list-tools | Print the tools and exit |
--http <addr> | Serve HTTP. host:port; without a port, $PORT, else 8765; the host defaults to 127.0.0.1 |
--allow-origin <origins> | Browser origins that may call it, comma separated, or * |
--no-sse | Leave out the deprecated HTTP+SSE transport |
Logs go to standard error; on standard input and output, standard output carries protocol messages
only. The environment variables RCAS_MCP_TOKEN,
RCAS_MCP_MAX_BODY_BYTES, RCAS_MCP_MAX_SSE_SESSIONS and RCAS_MCP_MAX_FILES set the token and
the limits.
The hosted server keeps at most one instance, starts on the first request and stops when idle; a cold start takes under a second.
To run your own, start the command the hosted server runs, on any machine or container that has
rcas:
rcas mcp --hosted --http 0.0.0.0:8080Tools
| Tool | Arguments (required in bold) | Returns |
|---|---|---|
list_rules | ruleset, entity, operation | The rules that apply to an operation on an entity: id, title, kind, severity, field, enforcement, who may accept the risk |
explain_rule | ruleset, rule_id | One rule in full, as in the server manifest |
evaluate_rules | ruleset, entity, operation, data_json, original_json, channel, actor_roles, resolutions_json | The result of a dry run: decision, findings, effects, commands |
check | paths, content | Lint, load and golden tests of rulesets, or of a draft passed as content (checked where it would live, written nowhere) |
test | paths, content | The same as check |
compile | path, include_bundle | Id, version, checksum and channels of the compiled bundle (and the bundle on request) |
manifest | path, channel | The client or server manifest |
derive | source, id, schema, pointer, entity, scope | The baseline ruleset YAML from an OpenAPI component schema or a JSON Schema, and what could not be derived |
analyze | path, paths, module, feature, include, exclude, changed, baseline, min_confidence, max_files | The inventory of schemas and decisions in code, with file:line, module and confidence; the names decided in several languages, with drift; and the rulesets that already name a hit (local only) |
propose_ruleset | id, title, files (path, content), rationale, source_refs | The stored proposal and its status: pending, or invalid with the problems check found (local only) |
list_proposals | status | Proposals and their status (local only) |
get_proposal | id | One proposal with the content of its files (local only) |
get_spec_section | section | A section of the specification by number (4.4) or words; without one, the list of sections |
get_operator_reference | operator | The operator table, or the lines about one operator |
get_authoring_guide | topic (authoring, naming, enforcement, openapi, cookbook), section | A guide, or one section of it |
On the hosted server, the first eight tools also take files: the rulesets (with their parents)
and the schemas and API documents they refer to, each {path, content}, with paths relative to a
project root such as rules/payments-transfer.ruleset.yaml. They are written to a temporary directory
for the call and removed after it; a path that leaves it is refused. check without paths checks
every ruleset sent.
Every tool except propose_ruleset is marked read-only and idempotent (readOnlyHint,
idempotentHint). A tool that fails returns its error as text with isError, so the model can read
it and correct its call.
Prompts
A person picks a prompt in the client, often as a slash command.
| Prompt | Arguments | What the agent does |
|---|---|---|
derive-rules | source (local), schema | derive, then completes the ruleset with the OpenAPI guide and check |
capture-rules | path, module, feature | analyze, compare the values of each candidate and flag drift, one ruleset per module and one per feature that extends it, with golden tests, check, then propose_ruleset (local only) |
review-ruleset | ruleset | Lists every MUST and SHOULD of the authoring guide a ruleset breaks, with a fix; changes nothing |
explain-decision | ruleset, entity, operation, data_json | evaluate_rules and explain_rule, explained in plain words |
Resources
| URI | Content |
|---|---|
rcas://docs/{topic} | The specification and the guides, as Markdown (specification, authoring, naming, enforcement, openapi, cookbook) |
rcas://spec/{section} | One section of the specification, e.g. rcas://spec/4.3 for the operators |
rcas://rulesets/{id} | The source of each ruleset of the project (local only) |
The documents are embedded in the command, so they match its version and need no network. The
arguments of the templates and prompts can be completed (completion/complete).
Safety model
- Proposals only. The one tool that writes,
propose_ruleset, writes under the proposals directory (.rcas/proposals/by default). A proposal may contain only*.ruleset.yaml,*.ruleset.yml,*.ruleset.jsonand*.schema.jsonfiles under the rules directory, none of them hidden: never configuration, version control, CI or tool files. A path that leaves the project, by.., an absolute path or a symbolic link, is refused.acceptchecks the same again. - What was reviewed is what is accepted. An agent cannot replace a proposal that exists; it must propose under a new id.
- Reads stay in the project. Schemas and API documents a draft refers to are read only from inside the project (on the hosted server, from inside the files of the call).
- A person accepts.
rcas proposals accept <id>writes the files, and refuses when a target file changed after the proposal was made, or when the proposal does not passcheck(--forceoverrides both, deliberately). - Evaluation is a dry run on the source rulesets. The actor of a dry run is a test value; in production the actor always comes from authentication, never from a model.
- No shell, no outgoing connections. The server reads the project and writes proposals; it starts
no processes and opens no connections. Over HTTP it accepts connections: by default only from this
machine (
127.0.0.1), withOriginchecked against DNS rebinding, a request size limit, and, withRCAS_MCP_TOKEN, a bearer token. Serve a project beyond your machine only with a token and TLS in front.
Try it by hand
# current revision: no handshake, the version travels with each request
printf '%s\n' \
'{"jsonrpc":"2.0","id":1,"method":"server/discover","params":{"_meta":{"io.modelcontextprotocol/protocolVersion":"2026-07-28","io.modelcontextprotocol/clientCapabilities":{}}}}' \
| rcas mcp
# an older client
printf '%s\n' \
'{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18"}}' \
'{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"check","arguments":{}}}' \
| rcas mcp
# over HTTP
curl -s https://mcp.rulescascade.com/mcp -H 'Content-Type: application/json' \
-H 'MCP-Protocol-Version: 2026-07-28' -H 'Mcp-Method: tools/call' -H 'Mcp-Name: get_spec_section' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"get_spec_section","arguments":{"section":"4.3"},"_meta":{"io.modelcontextprotocol/protocolVersion":"2026-07-28","io.modelcontextprotocol/clientCapabilities":{}}}}'AI coding tools
Set up Claude Code, Codex, GitHub Copilot, Cursor, Kiro, Gemini CLI, Devin (Windsurf), Junie, Muse Code, OpenCode and other AI coding agents for Rule Cascade, with instructions, skills for your languages, and the rcas MCP server.
Learn Rule Cascade
A short lesson for every feature of the rule language, then your language and the whole process. Every example runs in your browser.