Skip to content

Not able to connecto N8N MCP client to the MCP Server #148

@ppascualv

Description

@ppascualv

Description
I'm using the last version of the gem.
I tried with n8n but also with ChatGPT and it always happens the same, the connection is arriving but then is looping seending /messages without never ending until the server is stopped.

Here are the logs:
Using default server
MCP request subpath: '"/messages"'
Received message request
Request body: {"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"openai-mcp","version":"1.0.0"}},"jsonrpc":"2.0","id":0}
Received request: {"method"=>"initialize", "params"=>{"protocolVersion"=>"2025-06-18", "capabilities"=>{}, "clientInfo"=>{"name"=>"openai-mcp", "version"=>"1.0.0"}}, "jsonrpc"=>"2.0", "id"=>0}
Client connected: openai-mcp v1.0.0
Server response: {:protocolVersion=>"2024-11-05", :capabilities=>{:resources=>{:subscribe=>true, :listChanged=>true}, :tools=>{:listChanged=>true}}, :serverInfo=>{:name=>"Vixiees MCP server", :version=>"1.0.0"}}
Sending result: {:jsonrpc=>"2.0", :id=>0, :result=>{:protocolVersion=>"2024-11-05", :capabilities=>{:resources=>{:subscribe=>true, :listChanged=>true}, :tools=>{:listChanged=>true}}, :serverInfo=>{:name=>"Vixiees MCP server", :version=>"1.0.0"}}}
Sending response: {:jsonrpc=>"2.0", :id=>0, :result=>{:protocolVersion=>"2024-11-05", :capabilities=>{:resources=>{:subscribe=>true, :listChanged=>true}, :tools=>{:listChanged=>true}}, :serverInfo=>{:name=>"Vixiees MCP server", :version=>"1.0.0"}}}
Broadcasting message to 0 SSE clients: {"jsonrpc":"2.0","id":0,"result":{"protocolVersion":"2024-11-05","capabilities":{"resources":{"subscribe":true,"listChanged":true},"tools":{"listChanged":true}},"serverInfo":{"name":"Vixiees MCP server","version":"1.0.0"}}}
Sending ping PrefectHQ/fastmcp#5 to SSE client 59640465-9555-44c6-9298-0a744a8963f4
Started POST "/mcp/messages" for 172.212.159.66 at 2025-08-21 19:02:01 +0200
Rack request path: /mcp/messages
Setting server transport to RackTransport
Validating origin: vpn-development.vixiees.com
Using default server
MCP request subpath: '"/messages"'
Received message request
Request body: {"jsonrpc":"2.0","id":258149,"result":{}}
Received request: {"jsonrpc"=>"2.0", "id"=>258149, "result"=>{}}
Sending ping PrefectHQ/fastmcp#10 to SSE client 59640465-9555-44c6-9298-0a744a8963f4
Started POST "/mcp/messages" for 172.212.159.66 at 2025-08-21 19:02:06 +0200
Rack request path: /mcp/messages
Setting server transport to RackTransport
Validating origin: vpn-development.vixiees.com
Using default server
MCP request subpath: '"/messages"'
Received message request
Request body: {"jsonrpc":"2.0","id":112091,"result":{}}
Received request: {"jsonrpc"=>"2.0", "id"=>112091, "result"=>{}}

I mostly did the basic configuration:

Example Code

FastMcp.mount_in_rails(
  Rails.application,
  name: 'MCP server',
  version: '1.0.0',
  path_prefix: '/mcp', # This is the default path prefix
  messages_route: 'messages', # This is the default route for the messages endpoint
  sse_route: 'sse', # This is the default route for the SSE endpoint
  # Add allowed origins below, it defaults to Rails.application.config.hosts
  allowed_origins: ['localhost', '127.0.0.1', '[::1]', /.*\.ngrok\.com/],
  localhost_only: false, # Set to false to allow connections from other hosts
  # whitelist specific ips to if you want to run on localhost and allow connections from other IPs
  allowed_ips: ['20.218.238.125', '::1'],
  authenticate: true,       # Uncomment to enable authentication
  auth_token: Rails.application.credentials.n8n.receive_api_token, # Required if authenticate: true
) do |server|
  Rails.application.config.after_initialize do
    # FastMcp will automatically discover and register:
    # - All classes that inherit from ApplicationTool (which uses ActionTool::Base)
    # - All classes that inherit from ApplicationResource (which uses ActionResource::Base)
    server.register_tools(*ApplicationTool.descendants)
    server.register_resources(*ApplicationResource.descendants)
    # alternatively, you can register tools and resources manually:
    # server.register_tool(MyTool)
    # server.register_resource(MyResource)
  end
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions