v0.3.0 on RubyGems

Let AI agents call your Rails app’s tools.

Hitch gives your Rails app an OAuth 2.1 authorization server and an authenticated /mcp endpoint — built on the sign-in you already have.

bundle add hitch-rails

What it is

Hitch lets MCP clients -- Claude, ChatGPT, Cursor -- call your Rails app's tools as a specific signed-in user, with access you can revoke.

You do not stand up a separate auth server, add Redis, or adopt a new sign-in system. Hitch uses the authentication your app already has (current_user or Current.user) and your configured cache store.

Underneath it is a full OAuth 2.1 authorization server implementing the MCP 2026-07-28 authorization profile: PKCE (S256), audience-bound tokens (RFC 8707), discovery metadata (RFC 8414 + RFC 9728), revocation (RFC 7009), Client ID Metadata Documents, and optional Dynamic Client Registration (RFC 7591). It adds an authenticated /mcp endpoint backed by the official Ruby MCP SDK and a deny-default tool registry with schema validation and size caps. SQLite and PostgreSQL supported.

Questions you’d ask

Do I need a separate auth server?

No. Hitch mounts inside your Rails app and delegates identity to the authentication you already have — current_user or Current.user. There is no second sign-in system to run or sync.

Do I need Redis or new infrastructure?

No. Hitch uses your app’s configured cache store and your existing database. SQLite and PostgreSQL are supported.

How does an agent get access?

Through the standard MCP authorization flow: the client discovers your server’s metadata, the user approves access on a consent screen served by your app, and the client receives audience-bound tokens scoped to your server.

Can I take access away?

Yes. Tokens are revocable (RFC 7009), and access is per-user — revoking an agent’s grant doesn’t touch the user’s own session.

Which tools can an agent call?

Only the ones you register. The tool registry is deny-default, with JSON Schema validation and size caps on every call.

Where to go next

Source and README on GitHub
Public API for v0.3.0
Changelog