Skip to content

[BUG] MCP server URL with trailing slash causes 405 error instead of auto-normalizing #9120

@PaperBoardOfficial

Description

@PaperBoardOfficial

Problem (one or two sentences)

Roo Code fails to connect to MCP servers when the URL includes a trailing slash (e.g., https://api.githubcopilot.com/mcp/), returning a 405 non-200 response error. Cursor automatically normalizes URLs by removing trailing slashes, but Roo Code does not.

Context (who is affected and when)

Developers configuring MCP servers who copy URLs with trailing slashes from documentation or other sources encounter immediate connection failures. This affects anyone setting up HTTP-based MCP servers and creates friction when migrating configurations from Cursor, where the same URL works without modification.

Reproduction steps

  1. Open Roo Code and navigate to MCP server configuration (.roo/mcp.json)
  2. Add a new MCP server with a URL that includes a trailing slash:
{
  "mcpServers": {
    "github": {
      "type": "streamable-http",
      "url": "https://api.githubcopilot.com/mcp/",
      "headers": {
        "Authorization": "Bearer GITHUB_PAT"
      }
    }
  }
}

  1. Save the configuration and restart Roo Code
  2. Observe the connection error

Expected result

Roo Code should automatically normalize the URL by removing the trailing slash and successfully connect to the MCP server at https://api.githubcopilot.com/mcp, just like Cursor does.

Actual result

Roo Code fails to connect and returns a "405 non-200 response" error. The connection only works when the trailing slash is manually removed from the URL.

Variations tried (optional)

No response

App Version

3.30.3

API Provider (optional)

None

Model Used (optional)

No response

Roo Code Task Links (optional)

No response

Relevant logs or errors (optional)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions