Skip to content

[language-support] Serena MCP Language Support Cannot Be Tested Through HTTP Gateway #1038

@github-actions

Description

@github-actions

Problem

The Language Support Tester workflow cannot test Go, TypeScript/JavaScript, and Python language support using the Serena MCP server because of a fundamental incompatibility between Serena's session requirements and the HTTP gateway architecture.

Root Cause

Serena MCP Server is a stdio-based MCP server that requires:

  • Persistent, streaming connections where initialization and tool calls happen on the same connection
  • Session state maintained throughout the connection lifecycle
  • The initialization handshake must be completed before tool calls can be made

The HTTP Gateway provides:

  • Stateless HTTP requests where each request is independent
  • No persistent connection to maintain session state
  • Each HTTP POST is treated as a separate session by Serena

Error Observed

When attempting to call Serena tools through the HTTP gateway:

{
  "jsonrpc": "2.0",
  "id": 2,
  "error": {
    "code": 0,
    "message": "method \"tools/list\" is invalid during session initialization"
  }
}

This occurs because:

  1. The initialize request completes successfully in one HTTP request
  2. Subsequent tools/call requests are sent as separate HTTP requests
  3. Serena treats each new HTTP request as a new session that hasn't completed initialization

Impact

Language support testing is blocked for:

  • ❌ Go language analysis (symbol finding, definitions, refactoring)
  • ❌ TypeScript/JavaScript language analysis
  • ❌ Python language analysis

Documentation

This limitation is documented in:

  • test/serena-mcp-tests/GATEWAY_TEST_FINDINGS.md - Comprehensive analysis of the behavioral differences
  • test/serena-mcp-tests/README.md - Test suite documentation mentioning stdio vs HTTP differences

Current Workarounds

The existing test scripts work correctly:

  • test/serena-mcp-tests/test_serena.sh - Direct stdio connection tests (15/23 tests pass)
  • test/serena-mcp-tests/test_serena_via_gateway.sh - Gateway tests (7/23 tests pass due to this issue)

Possible Solutions

Option 1: Enhance Gateway with Session Persistence

Modify the gateway to:

  • Maintain persistent stdio connections to backend servers
  • Map multiple HTTP requests from the same session (via Authorization header) to the same backend connection
  • Keep the backend connection alive across multiple HTTP requests

Option 2: Use HTTP-Native Serena

  • Develop or deploy an HTTP-native version of Serena that doesn't require streaming connections
  • HTTP-native servers are designed for stateless HTTP requests

Option 3: Update Workflow to Use Direct stdio

  • Modify the Language Support Tester workflow to connect directly to Serena via stdio instead of through the HTTP gateway
  • This would bypass the gateway limitation but may not match the production architecture

Recommendation

Option 1 (Gateway Enhancement) is recommended because:

  • It maintains the gateway architecture
  • It allows stdio-based MCP servers to work through HTTP proxying
  • It doesn't require changes to existing MCP servers like Serena
  • It would benefit other stdio-based MCP servers

References

Generated by Language Support Tester

  • expires on Feb 24, 2026, 2:08 PM UTC

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions