Skip to content

MCP Server Returns InternalServerError on All JSON-RPC Calls Despite Healthy CDP Connection #1437

Description

@maceatwork

Issue Type

Agent Issue

Operating System

macOS

Description of the bug

The BrowserOS MCP server binary returns InternalServerError on ALL JSON-RPC method calls (initialize, tools/list, etc.), even though the health endpoint reports cdpConnected: true. This prevents any MCP client (Hermes agent, Claude, etc.) from using BrowserOS tools.

Environment

  • OS: macOS (Apple Silicon)
  • BrowserOS: v0.46.0
  • browseros-cli: v0.2.2
  • MCP Client: Hermes agent (but reproducible with raw curl)
  • Connection: HTTP to http://127.0.0.1:[port]/mcp

Expected Behavior

The MCP server should return a valid JSON-RPC response with server capabilities when calling initialize or tools/list methods.

Actual Behavior

All JSON-RPC method calls return InternalServerError, making the MCP server completely unusable despite appearing healthy.

Steps to Reproduce

  1. Start BrowserOS app normally

  2. Note the MCP servr port (changes on each restart - see related issue BrowserOS MCP server binds to random ports, settings show wrong port #199)

  3. Verify health endpoint works:

    curl http://127.0.0.1:9200/health
    # Returns: {"status":"ok","cdpConnected":true,...}
  4. Attempt to initialize MCP connection:

    curl -X POST http://127.0.0.1:9200/mcp \
      -H "Content-Type: application/json" \
      -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0"}}}'
  5. Result: Returns InternalServerError instead of valid JSON-RPC response

Screenshots / Videos

No response

BrowserOS Version

v0.46.0

Additional Context

Observed Pattern

  1. BrowserOS starts successfully
  2. Health endpoint reports cdpConnected: true
  3. Any JSON-RPC call to /mcp endpoint immediately returns InternalServerError
  4. Restarting BrowserOS does not fix the issue
  5. Port number changes on each restart (9200, 9201, etc.) - see issue BrowserOS MCP server binds to random ports, settings show wrong port #199

Related Issues

Error Details

  • Health endpoint: ✅ Works (cdpConnected: true)
  • MCP endpoint: ❌ Returns InternalServerError on ALL methods
  • Tested methods: initialize, tools/list, and others
  • Port behavior: Port changes on each restart

Workaround

None currently. The built-in browser tools work, but the MCP server is completely non-functional.

Additional Context

This appears to be a regression or different manifestation of issue #395. The key difference:

The health check shows CDP is connected, but the MCP layer cannot execute any commands. This suggests the server binary may have a bug in its JSON-RPC handler or initialization logic.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions