Skip to content

Conversation

@cswkim
Copy link
Owner

@cswkim cswkim commented Nov 5, 2025

Description

When running the server in Docker with HTTP stream transport (used by LibreChat and similar clients), SSE connections time out after ~60 seconds of inactivity, causing:

  • Repeated disconnections
  • Reconnect loops
  • Unstable connections in production

Configure FastMCP's built-in ping/keepalive for HTTP stream transport. The server sends periodic keepalive messages every 30 seconds (configurable) to prevent timeouts.

Checklist

  • It's useful if your PR references an issue where it is discussed ahead of time
  • Adhere to semantic messaging and prefix your PR title with feat:, fix:, chore:, docs:, etc.
  • I’ve added tests if needed
  • I’ve updated documentation if applicable
  • I’ve tested this locally
  • Add a changeset (pnpm changeset) if necessary

Tests and linting

  • Run the tests with pnpm test.
  • Run the lint check with pnpm lint.
  • Run the code formatting (prettier) check with pnpm format.

Related Issues

Closes #93

@changeset-bot
Copy link

changeset-bot bot commented Nov 5, 2025

🦋 Changeset detected

Latest commit: e950f3c

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
discogs-mcp-server Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@alonsocamaro
Copy link

alonsocamaro commented Nov 7, 2025

Thanks!

I´m seeing the following messages:

[INFO 2025-11-07T10:42:48.049Z] "Discogs MCP Server" started with transport type: stream
[FastMCP info] server is running on HTTP Stream at http://0.0.0.0:3002/mcp
[FastMCP info] HTTP Stream session established
[mcp-proxy] establishing new SSE stream for session ID 87db4756-939e-43cf-8f8d-83dae64db95f
[FastMCP info] HTTP Stream session established
[mcp-proxy] establishing new SSE stream for session ID c8557776-ba4e-400e-994c-e03bed2c14dc
[FastMCP info] HTTP Stream session established
[mcp-proxy] establishing new SSE stream for session ID 8cb08e7e-d133-4d79-bdcc-56fb6388722d
[FastMCP debug] server ping failed
[FastMCP debug] server ping failed
[FastMCP debug] server ping failed
[FastMCP debug] server ping failed
[FastMCP debug] server ping failed
[FastMCP debug] server ping failed
[FastMCP debug] server ping failed
[FastMCP debug] server ping failed
[FastMCP debug] server ping failed
[FastMCP debug] server ping failed
[FastMCP debug] server ping failed
[FastMCP debug] server ping failed

the ping failed messages appear randomly, sometimes after 1 second. I´m using the defaults (no configuration).

In LibreChat I see the following

2025-11-07 10:43:48 info: [MCP][discogs] Streamable-http transport closed
2025-11-07 10:43:48 info: [MCP][discogs] -------------------------------------------------┐
2025-11-07 10:43:48 info: [MCP][discogs] URL: http://10.1.1.4:3002/mcp
2025-11-07 10:43:48 info: [MCP][discogs] OAuth Required: false
2025-11-07 10:43:48 info: [MCP][discogs] Capabilities: {"logging":{},"tools":{}}
2025-11-07 10:43:48 info: [MCP][discogs] Tools: get_release, get_release_rating_by_user, edit_release_rating, delete_release_rating, get_release_community_rating, get_master_release, get_master_release_versions, get_artist, get_artist_releases, get_label, get_label_releases, search, get_user_inventory, get_marketplace_listing, create_marketplace_listing, update_marketplace_listing, delete_marketplace_listing, get_marketplace_order, edit_marketplace_order, get_marketplace_orders, get_marketplace_order_messages, create_marketplace_order_message, get_marketplace_release_stats, inventory_export, get_inventory_exports, get_inventory_export, download_inventory_export, get_user_identity, get_user_profile, edit_user_profile, get_user_submissions, get_user_contributions, get_user_collection_folders, create_user_collection_folder, get_user_collection_folder, edit_user_collection_folder, delete_user_collection_folder, find_release_in_user_collection, get_user_collection_items, add_release_to_user_collection_folder, rate_release_in_user_collection, move_release_in_user_collection, delete_release_from_user_collection_folder, get_user_collection_custom_fields, edit_user_collection_custom_field_value, get_user_collection_value, get_user_wantlist, add_to_wantlist, edit_item_in_wantlist, delete_item_in_wantlist, get_user_lists, get_list, fetch_image
2025-11-07 10:43:48 info: [MCP][discogs] Server Instructions: undefined
2025-11-07 10:43:48 info: [MCP][discogs] Initialized in: 275ms
2025-11-07 10:43:48 info: [MCP][discogs] -------------------------------------------------┘
2025-11-07 10:43:48 error: [MCP][discogs] Transport error: SSE stream disconnected: AbortError: This operation was aborted
2025-11-07 10:43:48 info: [MCP][discogs] Reconnecting 1/3 (delay: 2000ms)
2025-11-07 10:43:48 error: [MCP][discogs] Transport error: SSE stream disconnected: AbortError: This operation was aborted
2025-11-07 10:43:48 info: MCP servers initialized successfully. Added 53 MCP tools.
2025-11-07 10:43:48 info: OAuth reconnect manager initialized successfully.
2025-11-07 10:43:50 info: [MCP][discogs] Creating streamable-http transport: http://10.1.1.4:3002/mcp
2025-11-07 10:43:51 info: [Login] [Login successful] [Username: u.alonsocamaro@f5.com] [Request-IP: 192.168.192.1]
2025-11-07 10:43:51 info: [MCP][discogs] Creating streamable-http transport: http://10.1.1.4:3002/mcp

Please note, in both the discogs mcp server and the amadeus mcp server I always see an initial ransport error: SSE stream disconnected: AbortError: This operation was aborted

I find that discogs logs should have timestamps, otherwise it´s hard/a guess to match the logs and the events or packet traces.

I´m attaching a PCAP file next

discogs-mcp-server-ping.github.pcap.txt

@alonsocamaro
Copy link

btw, is there a way to increase verbosity of logs besides PING?

@cswkim
Copy link
Owner Author

cswkim commented Nov 10, 2025

Thanks!

I´m seeing the following messages:

[INFO 2025-11-07T10:42:48.049Z] "Discogs MCP Server" started with transport type: stream
[FastMCP info] server is running on HTTP Stream at http://0.0.0.0:3002/mcp
[FastMCP info] HTTP Stream session established
[mcp-proxy] establishing new SSE stream for session ID 87db4756-939e-43cf-8f8d-83dae64db95f
[FastMCP info] HTTP Stream session established
[mcp-proxy] establishing new SSE stream for session ID c8557776-ba4e-400e-994c-e03bed2c14dc
[FastMCP info] HTTP Stream session established
[mcp-proxy] establishing new SSE stream for session ID 8cb08e7e-d133-4d79-bdcc-56fb6388722d
[FastMCP debug] server ping failed
[FastMCP debug] server ping failed
[FastMCP debug] server ping failed
[FastMCP debug] server ping failed
[FastMCP debug] server ping failed
[FastMCP debug] server ping failed
[FastMCP debug] server ping failed
[FastMCP debug] server ping failed
[FastMCP debug] server ping failed
[FastMCP debug] server ping failed
[FastMCP debug] server ping failed
[FastMCP debug] server ping failed

the ping failed messages appear randomly, sometimes after 1 second. I´m using the defaults (no configuration).

In LibreChat I see the following

2025-11-07 10:43:48 info: [MCP][discogs] Streamable-http transport closed
2025-11-07 10:43:48 info: [MCP][discogs] -------------------------------------------------┐
2025-11-07 10:43:48 info: [MCP][discogs] URL: http://10.1.1.4:3002/mcp
2025-11-07 10:43:48 info: [MCP][discogs] OAuth Required: false
2025-11-07 10:43:48 info: [MCP][discogs] Capabilities: {"logging":{},"tools":{}}
2025-11-07 10:43:48 info: [MCP][discogs] Tools: get_release, get_release_rating_by_user, edit_release_rating, delete_release_rating, get_release_community_rating, get_master_release, get_master_release_versions, get_artist, get_artist_releases, get_label, get_label_releases, search, get_user_inventory, get_marketplace_listing, create_marketplace_listing, update_marketplace_listing, delete_marketplace_listing, get_marketplace_order, edit_marketplace_order, get_marketplace_orders, get_marketplace_order_messages, create_marketplace_order_message, get_marketplace_release_stats, inventory_export, get_inventory_exports, get_inventory_export, download_inventory_export, get_user_identity, get_user_profile, edit_user_profile, get_user_submissions, get_user_contributions, get_user_collection_folders, create_user_collection_folder, get_user_collection_folder, edit_user_collection_folder, delete_user_collection_folder, find_release_in_user_collection, get_user_collection_items, add_release_to_user_collection_folder, rate_release_in_user_collection, move_release_in_user_collection, delete_release_from_user_collection_folder, get_user_collection_custom_fields, edit_user_collection_custom_field_value, get_user_collection_value, get_user_wantlist, add_to_wantlist, edit_item_in_wantlist, delete_item_in_wantlist, get_user_lists, get_list, fetch_image
2025-11-07 10:43:48 info: [MCP][discogs] Server Instructions: undefined
2025-11-07 10:43:48 info: [MCP][discogs] Initialized in: 275ms
2025-11-07 10:43:48 info: [MCP][discogs] -------------------------------------------------┘
2025-11-07 10:43:48 error: [MCP][discogs] Transport error: SSE stream disconnected: AbortError: This operation was aborted
2025-11-07 10:43:48 info: [MCP][discogs] Reconnecting 1/3 (delay: 2000ms)
2025-11-07 10:43:48 error: [MCP][discogs] Transport error: SSE stream disconnected: AbortError: This operation was aborted
2025-11-07 10:43:48 info: MCP servers initialized successfully. Added 53 MCP tools.
2025-11-07 10:43:48 info: OAuth reconnect manager initialized successfully.
2025-11-07 10:43:50 info: [MCP][discogs] Creating streamable-http transport: http://10.1.1.4:3002/mcp
2025-11-07 10:43:51 info: [Login] [Login successful] [Username: u.alonsocamaro@f5.com] [Request-IP: 192.168.192.1]
2025-11-07 10:43:51 info: [MCP][discogs] Creating streamable-http transport: http://10.1.1.4:3002/mcp

Please note, in both the discogs mcp server and the amadeus mcp server I always see an initial ransport error: SSE stream disconnected: AbortError: This operation was aborted

I find that discogs logs should have timestamps, otherwise it´s hard/a guess to match the logs and the events or packet traces.

I´m attaching a PCAP file next

discogs-mcp-server-ping.github.pcap.txt

The ping failures look like a FastMCP issue - it may be pinging before sessions are ready. The initial disconnect happens with both servers, so that’s possibly a LibreChat initialization issue.

Our logs already have timestamps, but FastMCP’s don’t, which makes correlation harder.
Quick test: try setting PING_ENABLED=false to see if the connection stays stable without ping. If it does, we can disable it or wait for a FastMCP fix. The keepalive was meant to prevent timeouts, but if it’s causing failures, it may be counterproductive.

Can you try disabling ping and share the results?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Using discogs + docker in stream mode reports SSE timeout errors with Librechat

3 participants