About
hitch-rails is an open-source Ruby gem (MIT licensed) that
lets MCP clients — Claude, ChatGPT, Cursor — call a Rails
application’s tools as a specific signed-in user, with access that user
can revoke. It mounts an OAuth 2.1 authorization server and an authenticated
/mcp endpoint inside the Rails app itself, built on the
authentication the app already has.
How it’s built
Three principles run through the codebase:
Fail closed. Tools are hidden until registered, origins refused until listed, credentials digested and never logged. Defaults deny; you opt in to exposure.
Conformance is the correctness bar. The gem implements OAuth 2.1 and the MCP authorization spec, and behavior that turns on a spec cites the RFC section it comes from — PKCE (S256), RFC 8707 audience binding, RFC 8414 and RFC 9728 discovery, RFC 7009 revocation, RFC 7591 registration.
Rails-native. No new sign-in system, no Redis, no
separate auth service. It uses current_user or
Current.user and the app’s configured cache store, and it
follows the framework’s conventions rather than inventing its own.
Who maintains it
hitch-rails is written and maintained by Tyler Klose. Development happens in the open: conformance findings are filed as public issues before they're fixed, and the changelog says plainly what each release shipped. The visible process is the trust argument.