Skip to content

mcp: tools/list hangs after subscriptions/listen on the 2026-07-28 protocol #1376

Backlog

Description

@ransagy

Summary

railway mcp stops answering on the modern MCP revision. The server advertises
2026-07-28 via server/discover; the client then opens subscriptions/listen,
receives notifications/subscriptions/acknowledged, and tools/list never
returns. The process stays alive with an established TLS connection to
mcp.railway.com. Clients hit their startup timeout and lose every Railway tool.

Same binary, same token, same machine:

Sequence Result
initialize + tools/list (legacy) 85 tools, ~0.7s
server/discover + tools/list 85 tools, ~0.8s
server/discover + subscriptions/listen + tools/list no reply (killed at 40s)

Two things that make this easy to miss:

  • The bug needs stdin to stay open. Piping requests in and closing stdin makes
    the proxy flush and answer, which hides it.
  • Only the subscribe call triggers it; tools/list alone is fine.

Steps to reproduce

import json, socket, subprocess, time

a, b = socket.socketpair()            # stdin stays open
p = subprocess.Popen(["railway", "mcp"], stdin=b, stdout=b, stderr=b)
b.close()

meta = {"_meta": {
    "io.modelcontextprotocol/protocolVersion": "2026-07-28",
    "io.modelcontextprotocol/clientInfo": {"name": "probe", "version": "1"},
    "io.modelcontextprotocol/clientCapabilities": {"roots": {}},
}}

for msg in (
    {"jsonrpc": "2.0", "id": 1, "method": "server/discover", "params": meta},
    {"jsonrpc": "2.0", "id": 2, "method": "subscriptions/listen",
     "params": {**meta, "notifications": {"toolsListChanged": True}}},
    {"jsonrpc": "2.0", "id": 3, "method": "tools/list", "params": meta},
):
    a.sendall((json.dumps(msg) + "\n").encode())
    time.sleep(0.4)

a.settimeout(10)
buf = b""
try:
    while b'"id":3' not in buf:
        buf += a.recv(1 << 20)
except socket.timeout:
    pass
print(buf.decode())                   # 1 and 2 answered, 3 missing
p.kill()

Environment

  • Railway CLI 5.71.0 and 5.75.0, Linux x86_64
  • mcp.railway.com, authenticated (railway whoami works)
  • Platform status green; not auth or network
  • First seen with opencode 2.4.1, which defaults to protocol: auto and times
    out at 30s on connect

Impact

Every opencode 2.4.x session loses Railway tools. Client-side workaround is
pinning the legacy handshake (protocol: "legacy"), but the modern path is
broken for any client that subscribes.

Activity

  1. ransagy commented on Nov 24, 2026

    @ransagy
    Author

    Client-side cross-reference: this lines up with anomalyco/opencode#66101 — opencode v2.4.0 (2026-11-23) flipped its MCP default to protocol: auto, which is when this started appearing for us. Data point added there: anomalyco/opencode#66101 (comment)

    Pinning protocol: "legacy" works around it in opencode, but the modern path stays broken for any client that subscribes.

  2. ransagy commented on Nov 26, 2026

    @ransagy
    Author

    Update: the client half has a partial fix. anomalyco/opencode#66101 is closed by anomalyco/opencode#66588 (merged 2026-11-26), which falls back to legacy when the server/discover probe returns a 5xx.

    That does not cover this report. Here the probe succeeds, the client negotiates 2026-07-28, and tools/list never returns after subscriptions/listen — the PR notes the Railway case is out of scope. So the modern path is still broken for any client that subscribes, not just opencode.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions