Skip to content

openapi-mcp-server: STDIO Connection Failure with MCP Inspector and Cline #1647

@lidorcg

Description

@lidorcg

Describe the bug

The OpenAPI MCP Server fails to establish STDIO connections with MCP Inspector and Cline, resulting in timeout errors (MCP error -32000: Connection closed).
However, the server responds correctly to MCP protocol messages when tested directly via CLI.

Expected Behavior

MCP server to connect to MCP Inspector and Cline

Current Behavior

MCP error -32000: Connection closed

Reproduction Steps

Test 1: MCP Inspector Connection (FAILS)

  1. Create Inspector configuration:
{
  "mcpServers": {
    "petstore-test": {
      "disabled": false,
      "timeout": 120,
      "type": "stdio",
      "command": "uvx",
      "args": ["awslabs.openapi-mcp-server@latest"],
      "env": {
        "API_NAME": "petstore",
        "API_BASE_URL": "https://petstore3.swagger.io/api/v3",
        "API_SPEC_URL": "https://petstore3.swagger.io/api/v3/openapi.json",
        "LOG_LEVEL": "DEBUG",
        "ENABLE_PROMETHEUS": "false",
        "ENABLE_OPERATION_PROMPTS": "true"
      }
    }
  }
}
  1. Run: npx @modelcontextprotocol/inspector petstore-test-config.json

  2. Result: Connection times out with error code -32001

    • Inspector logs show multiple "New STDIO connection request" messages
    • No successful MCP initialize handshake
    • Timeout after 60-120 seconds

Test 2: Cline Integration (FAILS)

  1. Add server to Cline MCP settings:
{
  "mcpServers": {
    "petstore-test": {
      "command": "uvx",
      "args": ["awslabs.openapi-mcp-server@latest"],
      "timeout": 120,
      "env": {
        "API_NAME": "petstore",
        "API_BASE_URL": "https://petstore3.swagger.io/api/v3",
        "API_SPEC_URL": "https://petstore3.swagger.io/api/v3/openapi.json",
        "LOG_LEVEL": "DEBUG"
      }
    }
  }
}
  1. Restart VSCode to activate server

  2. Result: Same timeout behavior as Inspector

    • Server appears to start but connection fails
    • No tools become available to Cline

Test 3: Direct CLI Test (SUCCEEDS)

  1. Run server with direct MCP protocol message:
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test-client","version":"1.0.0"}}}' | \
uvx awslabs.openapi-mcp-server@latest \
  --api-name petstore \
  --api-url https://petstore3.swagger.io/api/v3 \
  --spec-url https://petstore3.swagger.io/api/v3/openapi.json \
  --log-level ERROR
  1. Result: SUCCESS ✅
    • Server responds in <2 seconds
    • Valid JSON-RPC response received:
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "protocolVersion": "2024-11-05",
    "capabilities": {
      "tools": {},
      "resources": {}
    },
    "serverInfo": {
      "name": "petstore",
      "version": "0.2.5"
    }
  }
}

Possible Solution

Investigated SSE/HTTP transport as potential workaround:

  • awslabs.openapi-mcp-server v0.2.5 ONLY supports STDIO transport

Additional Information/Context

  • OS: Ubuntu 24.04.3 LTS
  • Python: via uvx
  • Package Version: awslabs.openapi-mcp-server@latest (0.2.5)
  • MCP Inspector: Latest version
  • Cline: Latest version (VSCode extension)

OS

Ubuntu 24.04.3 LTS

Server

openapi-mcp-server

Server Version

0.2.5

Other information

Are there known compatibility issues with MCP Inspector or Cline STDIO transport?
Are there specific STDIO configuration requirements we might be missing?

Service quota

  • I have reviewed the service quotas for this construct

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingneeds-triageThis needs to be handled, it is the first automatically assigned label to issues.

    Type

    No type

    Projects

    Status

    To triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions