
Rails Mcp
io.github.jaimenbell由 GitHub 账号 jaimenbell 发布v0.1.0更新于 Oct 24, 2026
Default-deny action registry, append-only spend ledger, and human sign-off audit trail (MCP tools).
发布方自己的服务:Job Bot by Agent Rails
概览
一个自托管的治理服务器,为助手提供默认拒绝的动作分类器、支出意向账本和只读的签核状态。
- 可以做什么
- 对动作类型进行分类,无论配置或是否登记,判定始终为 GATED,并查询某动作类型是否有登记条目及其执行层、执行指针和仪式信息。读取已加载登记表的短哈希与条目数量,以及当前人工签核状态或空值。追加包含金额、供应商、用途和执行者的支出意向记录,并将滚动窗口内的支出总额与预算上限比较。从 YAML 或 JSON 配置文件加载动作登记表,也可在空登记表下运行。
- 适用场景
- 当你希望助手查询一份自托管的不可逆动作登记表,并保留支出意向和人工签核的审计记录时使用。适合已有自己的拦截钩子、权限拒绝列表或 CI 关卡,并希望在其旁配一个小型、可审查的模式与账本的团队。它本身不执行任何拦截。
- 运行要求
- 以 stdio 本地进程运行,可从 PyPI 安装(pip install rails-mcp),或以 python -m rails_mcp 启动。可选环境变量:RAILS_MCP_CONFIG_PATH 指定登记表配置文件,RAILS_MCP_SIGNOFF_LEDGER_PATH 和 RAILS_MCP_SPEND_LEDGER_PATH 指定账本位置。无需账号、API 密钥或网络访问。
安装
在 SourceWeft 中
- 打开 控制台中的 Rails Mcp,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
rails-mcp
[PyPI] [MCP Registry] [License: MIT] [Tests] [CI]
A self-hosted, caller-configured default-deny action registry + append-only spend ledger + CLI-only sign-off audit trail, exposed as MCP tools. Different category from this author's other six MCP servers (mcp-factory, rag-mcp, bus-mcp, desktop-mcp, github-mcp, discord-mcp) -- those are devtools ("connect an agent to X"); this one is governance and safety: "stop an agent from doing something irreversible without a human noticing."
Ported and generalized from a live internal registry (shared/rails/,
31 tests, running against a real multi-bot fleet since 2026-07-06) --
this pattern shipped internally before it shipped publicly.
What this is / is not
Is:
- A schema + pure logic for classifying
action_typestrings as unconditionally GATED (default-deny), registered or not. - A place to register what you know about an action-type's current
enforcement (
enforcement_layer,enforcement_pointer,ceremony) -- informational, never permissive. - An append-only spend-intent ledger + rolling-window budget check.
- An append-only human sign-off ledger, recording who blessed the registry's current hash and when.
Is NOT:
- Not an enforcer.
classify_actionreturningGATEDdoes not block anything by itself. You still wire it into your own PreToolUse hook, permission deny-list, or CI gate -- rails-mcp gives you the schema and the audit trail, not the interceptor.record_spend_intentrecords intent to spend; it never calls a vendor, a paid API, or a broker, and nothing here stops an over-budget spend from happening. - Not pre-loaded with any action-type data. Every adopter supplies their own registry (a YAML/JSON config file, or a plain dict). No fleet's specific action-types ship with this package.
- Not multi-tenant. The sign-off ledger assumes one human operator string per registry; fine for v1, a known limitation for later.
The one invariant that is never configurable
classify_action(action_type) always returns "GATED" -- registered
or not, whatever config was loaded, no argument or config field can change
it. This is the whole product. A config-driven fail-open knob would defeat
the entire pitch, so classify() (rails_mcp/registry.py) takes only an
action_type argument: there is no parameter through which a caller could
ever make it return anything permissive. is_action_registered answers a
separate, purely informational question -- "do I know something about this
action-type's enforcement?" -- and never feeds back into the GATED verdict.
Quickstart (60 seconds)
Add to your Claude Desktop/Code MCP config:
No console script on PATH? Fall back to "command": "python", "args": ["-m", "rails_mcp"].
By default the registry loads empty (honest-empty, not fail-open --
classify_action is still unconditionally GATED for everything). Point
it at your own action-type config:
See examples/rails.config.example.yaml (or .example.json) for the
config shape.
Tools
All six are read-mostly -- none of them can write to the sign-off ledger.
The CLI-only sign-off boundary -- and why it exists
append_signoff -- the function that records a human blessing the
registry's current hash -- is deliberately not an MCP tool, and never
will be. It is exposed only as a CLI command a human runs by hand:
Why: the boundary exists to prevent an agent holding only this
server's MCP tool connection from self-approving an irreversible action.
If append_signoff were reachable as an MCP tool, any agent holding this
server's connection could sign its own registry -- silently defeating the
one thing the boundary exists to enforce. This mirrors the internal design
rule the original shared/rails/ implementation was built around: the
lane that builds the auditor never signs the registry it ships. An
auditor that can also sign isn't an auditor.
What this boundary does not prove: the sign-off ledger has no
cryptographic tamper-evidence and no binding to a real human identity --
its integrity rests entirely on filesystem ACLs and the self-hosted
deployment model, not on cryptography. An agent (or anyone) with shell or
file-write access to the ledger's path can run rails-mcp sign itself, or
hand-append a forged {"type": "signoff", ...} JSONL line straight into
the file -- the ledger has no way to tell that apart from a real CLI
invocation. The MCP-only boundary stops the narrower case of an agent that
has only this server's MCP tool connection; it is not proof that a human
reviewed anything, and shouldn't be read as one.
This boundary is enforced structurally, not just by convention:
rails_mcp/server.pyandrails_mcp/routes.pynever import or callappend_signoff, anywhere -- proven by an AST-based check (not a naive string grep, which would false-positive on this very explanation appearing in their docstrings) intests/test_server.py::test_append_signoff_unreachable_via_any_mcp_tool.- The registered MCP tool set is exactly the 6 read-mostly tools above --
no
sign/append_signoff/revoke_signofftool exists, checked intests/test_server.py::test_all_six_rails_tools_registered. - A behavioral test drives every registered tool and confirms the sign-off
ledger file is never created
(
test_no_registered_tool_can_create_a_signoff_record). run_server.py(the entrypoint~/.claude.jsoninvokes) imports onlyrails_mcp.server, neverrails_mcp.cli-- so even the process that serves MCP tools has no code path to thesignsubcommand.
Env vars
Config file shape
Or the more compact 3-element form (matches the internal registry's native shape):
JSON works identically ({"actions": {"deploy_prod": [...]}}). See
examples/ for full examples of both.
enforcement_layer should be honest, not aspirational -- "prose"
(no structural rail exists yet, just a doc) is a legitimate, correct value.
Rounding a "prose" entry up to "L1" because it feels better defeats the
entire point of an honest registry.
Testing
CI (.github/workflows/ci.yml) runs this suite on every push/PR and fails
the build if the Tests badge above drifts from what the suite actually
reports -- see scripts/check_readme_counts.py.
106 tests, all hermetic (every ledger/config path goes through tmp_path +
an autouse env-isolation fixture in tests/conftest.py; nothing touches a
real ./rails_data/). No network, no live-smoke gate needed -- this
server has no external API to fake.
tests/test_registry.py(24) -- the ported + generalized registry logic: default-deny property tests, immutability, hash determinism, sign-off ledger fold/append/load, structural no-shell-out proof.tests/test_spend_ledger.py(14) -- ported near-verbatim from the internal suite: append/load roundtrips, budget window math, naive- datetime honest-degrade, structural no-effector proof.tests/test_config.py(18) -- new: env-var resolution, YAML/JSON loading in both entry shapes, honest-empty-when-unconfigured, loud failure on an explicit missing path.tests/test_routes.py(14) -- the MCP tool surface's business logic, exercised directly.tests/test_server.py(17) -- tool registration, passthrough correctness, and the CLI-only sign-off structural + behavioral proof.tests/test_cli.py(8) -- theserve/signsubcommands, including thatsignis genuinely append-only and prints a human-readable confirmation.tests/test_check_readme_counts.py(11) -- this CI gate's own TDD suite: parse-claimed, parse-actual, compare, andmain()end-to-end against match/drift/missing fixtures.
Install / connect
Registered in ~/.claude.json under mcpServers.rails-mcp as a stdio
server invoking run_server.py by absolute path (no cwd needed -- the
entrypoint adds its own directory to sys.path), OR via the rails-mcp
console script once installed from PyPI.
Handshake check
Prints the six registered tool names with no transport started.
Competitive picture (fact-checked 2026-07-16)
The closest prior art is not a hosted dead-man's-switch product -- that's a different problem ("is the operator still alive and watching"). The closer comparisons, once actually verified:
- Microsoft Agent Governance Toolkit -- MIT-licensed, backed by Microsoft, broader/heavier policy-enforcement scope covering the OWASP Agentic Top 10. The "big-name, well-resourced" adjacent entrant.
- Marchward -- the closest feature-for-feature match: server-side credential injection, spend caps, human-approval gates for irreversible actions, tamper-evident logging, Apache-2.0 open-source proxy.
- AgentLedger -- AGPL-3.0, overlaps
spend_ledger.pyspecifically (budgets, approvals, audit trail).
rails-mcp's narrower bet: a small, inspectable, self-hosted
registry+ledger+audit-trail schema with one hard invariant (default-deny
classification can never be configured away) and one hard boundary
(sign-off is CLI-only, never MCP-reachable) -- not a full policy-engine
product.
Out of scope
- Actual enforcement. No git hooks, no
settings.jsondeny rules, no graduation gates. You wireclassify_action/is_action_registeredinto your own interceptor. - A coverage auditor that checks whether your specific enforcement
mechanism (a hook, a CI gate) actually does what your registry claims.
That is real, separate engineering (this author's internal
coverage_audit.py) and is not part of this package. - Multi-tenant / multi-operator sign-off. One operator string per ledger for v1.
- Blocking an over-budget spend.
evaluate_budgettells you the number; nothing here intercepts a call before it happens. - Ledger rotation/capping.
record_spend_intentappends forever -- there's no rotation, size cap, or archival built in. A known limitation, not yet a problem at v1 scale.
Commercial support
Maintained by Jaimen Bell. For production MCP integrations, agent-governance rails, or agent-reliability work, see jaimenbell.dev.
Building your own MCP server? The MCP Starter Kit has templates, a build playbook, and packaging war-stories from shipping this one.
mcp-name: io.github.jaimenbell/rails-mcp
来源:README.md,提交 6bfb355
工具
0版本历史
1- v0.1.0最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分
其他 Rails 集成
Job Bot by Agent Rails
so.rails官方发布者
远程求职 MCP 服务器,生成每行都引用可核查事实的文档,且不会替你发送任何内容。
Unblock by Agent Rails
so.rails官方发布者
让智能体在手机上向你提问,等待你的回答后继续执行任务。
Language Tutor by Agent Rails
so.rails官方发布者
让助理通过简短对话练习西班牙语、法语或俄语,并提供纠正。
Rolodex by Agent Rails
so.rails官方发布者
远程 MCP 服务器,用于维护关系记忆:谁该走下一步,并为每条记录附上依据。
Recruiter by Agent Rails
so.rails官方发布者
远程 MCP 服务器:输入职位后返回按各项要求附证据的候选人,以及待你批准的触达草稿。