Skip to content

drop-in conventions for adding MCP Servers to Rails apps #60

Closed

Description

@topherbullock

allow base StreamableHTTP transport to be easily dropped into any Rack, Rails, etc. app - build out conventions that make adding to any existing server trivial.

Originally posted by @topherbullock in #33 (comment)

Activity

  1. kfischer-okarin commented on Jun 12, 2025

    @kfischer-okarin
    Contributor

    For Rails (or Sinatra or any other framework) I'd say the proper way forward would be to have a whole separate gem which internally implements a Transport class and offers integration/boilerplate/configuration options specific and idiomatic to the respective framework

  2. pusewicz commented on Jul 11, 2025

    @pusewicz
    Contributor

    @topherbullock This would be fantastic, as it would suddenly open a wide array of implementations. I'm in the process of trying to embed an MCP server in a Rails application, and using the OAuth2 flow, but, for some reason Claude does not like it and after a successful auth, does not send the access token to the MCP endpoint. Do you think there's something in the way the server gets embedded inside of the Rails app that might prevent this from working?

  3. alexandru-calinoiu commented on Jul 17, 2025

    @alexandru-calinoiu
    Contributor

    @pusewicz from my investiagation so far it looks like Claude will do a GET request to the mcp to a open an SSE connection, I have yet figured out how to implement this in a rails app based off the rack example that is in the repo.

  4. pusewicz commented on Jul 21, 2025

    @pusewicz
    Contributor

    @alexandru-calinoiu You don't need to implement an SSE connection. Claude is fine with getting simple JSON responses back. I just got it to work with OAuth and the issue I had was that the token endpoint was responding with 201 Created where the spec mentions 200 OK, and it seems Claude follows the spec strictly. This one change made the whole process work as expected.

  5. pbendersky commented on Nov 11, 2025

    @pbendersky

    @pusewicz do you have any public sample of this? what are you using to authenticate with OAuth and later validate the token on each tool calls?

    thank you!

  6. pusewicz commented on Nov 11, 2025

    @pusewicz
    Contributor

    @pbendersky I don't unfortunately. We were using our own OAuth server. In the Rails application exposing the tools we had our own Rack middleware that would authenticate. You can do as much and as little as you want.

  7. added
    enhancement
    on Mar 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions