Skip to content

EventEmitter overflow (drain) when used with OpenCode 1.14.28 — resources/list polling causes listener leak #621

Closed

Description

@ozcajefff

Issue Description

EventEmitter overflow (drain event) when excel-sbroenne MCP server is enabled in OpenCode. After a short period of use, OpenCode crashes with a Node.js overflow error. When the server is disabled, OpenCode works perfectly with no issues.

AI Assistant

MCP Tool & Action

  • Tool: N/A — the crash occurs at the connection/initialization level, not during a specific tool call
  • Action: The overflow appears to be triggered during getPrompt polling
  • File Path: N/A
  • Additional Parameters: N/A

Expected Behavior

The MCP server should stay connected and respond to requests from OpenCode without causing the Node.js event loop to overflow.

Actual Behavior

After enabling excel-sbroenne in OpenCode and using it for a short time, OpenCode crashes with:
type: "drain"
count: 11
at overflowWarning (node:events:185:19)
at addListener (node:events:158:22)
at once (node:events:200:36)
...at getPrompt
...at send

Error Response

{
  "error": "Node.js EventEmitter MaxListenersExceededWarning: drain event, count 11, at overflowWarning node:events:185:19"
}

MCP Server Configuration

Configuration file location: C:\Users\JEFRY\.config\opencode\opencode.json

"excel-sbroenne": {
  "type": "local",
  "enabled": true,
  "command": [
    "C:/Users/JEFRY/.dotnet/tools/mcp-excel.exe"
  ],
  "environment": {
    "DOTNET_EnableDiagnostics": "0",
    "APPLICATIONINSIGHTS_CONNECTION_STRING": ""
  },
  "timeout": 60000
}

Environment

  • Windows Version: Windows 11
  • Excel Version: Excel 365
  • ExcelMcp Version: v1.8.50
  • .NET Version: 8.0 and 10.0 (both installed)
  • Installation Method:
    • Global .NET tool (dotnet tool install --global Sbroenne.ExcelMcp.McpServer)

MCP Server Logs

INFO service=mcp key=excel-sbroenne toolCount=25 create() successfully created client
warn: ModelContextProtocol.Server.McpServer[2049951654]
Server (excel-mcp 1.8.50.0), Client (opencode 1.14.28) received request for method 'resources/list', but no handler is available.
warn: ModelContextProtocol.Server.McpServer[975074943]
Server (excel-mcp 1.8.50.0), Client (opencode 1.14.28) method 'resources/list' request handler failed in 29.7949ms.
ModelContextProtocol.McpProtocolException: Method 'resources/list' is not available.
ERROR service=mcp clientName=excel-sbroenne error=MCP error -32601: Method 'resources/list' is not available. failed to get resources

Steps to Reproduce

  1. Install mcp-excel via dotnet tool install --global Sbroenne.ExcelMcp.McpServer
  2. Configure OpenCode with the MCP server as shown above
  3. Start OpenCode — server connects successfully showing 25 tools
  4. Use OpenCode normally for a few minutes
  5. OpenCode crashes with EventEmitter overflow on drain event

Additional Context

  • The server connects successfully at startup (25 tools detected)
  • The crash happens during active use, not at startup
  • Disabling excel-sbroenne completely fixes the issue — OpenCode runs stably
  • The resources/list method is not implemented in the server, OpenCode receives -32601 error repeatedly which may be contributing to the listener accumulation
  • Also tried with the standalone ZIP executable (ExcelMcp-MCP-Server-1.8.50-windows.zip) — same overflow occurs
  • OpenCode uses Bun (not Node.js directly) as its runtime

Question

Is there a known workaround for this compatibility issue with OpenCode? Could the repeated resources/list polling by OpenCode be causing the listener leak?

Activity

  1. sbroenne commented on Apr 28, 2026

    @sbroenne
    Owner

    Hi @ozcajefff — quick update: we merged #625 to remove a stale, unregistered internal resource provider and clarify that Excel MCP is a tools/prompts-only server.

    That change does not add MCP resource support or a resources/list handler. The resources/list polling/overflow still looks like an OpenCode-side compatibility bug: an MCP client should handle an unsupported optional method (-32601 Method not available) without accumulating listeners or crashing.

    If OpenCode has a setting to disable resource polling for servers that do not advertise resources, that should be the best workaround. Otherwise, this is likely worth reporting upstream to OpenCode with the repeated resources/list polling and drain listener overflow details from this issue.

  2. ozcajefff commented on Apr 30, 2026

    @ozcajefff
    Author

    I’ll try to look into this issue and gather more information so I can help find a solution. I appreciate the details you shared.

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions