You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
drop-in conventions for adding MCP Servers to Rails apps #60
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.
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
@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?
@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.
@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.
@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.
Activity
kfischer-okarin commentedon Jun 12, 2025
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
pusewicz commentedon Jul 11, 2025
@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?
alexandru-calinoiu commentedon Jul 17, 2025
@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.
pusewicz commentedon Jul 21, 2025
@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 Createdwhere the spec mentions200 OK, and it seems Claude follows the spec strictly. This one change made the whole process work as expected.pbendersky commentedon Nov 11, 2025
@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!
pusewicz commentedon Nov 11, 2025
@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.
Make `StreamableHTTPTransport` a Rack application