Skip to content

fix(mcp): SSE endpoint config mismatch and incorrect server name in MCP router #1673

Closed

Description

@fenbox

Describe the bug

In internal/router/mcp_router.go, the MCP SSE server is configured with an SSE endpoint that does not match the route it is actually mounted on:

sseServer := server.NewSSEServer(s,
    server.WithSSEEndpoint("/answer/api/v1/mcp/see"),   // typo: "see"
    server.WithMessageEndpoint("/answer/api/v1/mcp/message"),
)
r.GET("/mcp/sse", gin.WrapH(sseServer.SSEHandler()))
r.POST("/mcp/message", gin.WrapH(sseServer.MessageHandler()))

Problems:

  1. WithSSEEndpoint("/answer/api/v1/mcp/see") contains a typo (see → sse) and does not match the actual mount path GET /answer/api/v1/mcp/sse. It currently "works" only because SSEHandler()/MessageHandler() are mounted manually and the configured path is never validated by mcp-go v0.43.2; the value is misleading and will break anything relying on CompleteSsePath() (e.g. URL resolution, health checks, or future path validation).
  2. The endpoint strings are duplicated as raw literals instead of shared constants, so the SSE config, the gin mount paths, and the client-facing endpoint event can drift apart silently.
  3. The server is registered as "Answer Enterprise MCP Server", which is not appropriate naming for the Apache Answer project.

To Reproduce

  1. Read internal/router/mcp_router.go and compare WithSSEEndpoint("/answer/api/v1/mcp/see") with the actual mount path r.GET("/mcp/sse", ...).
  2. Start a site with MCP enabled in the admin settings.
  3. Connect any MCP client to http://<host>/answer/api/v1/mcp/sse and check the server name reported during initialization: it shows Answer Enterprise MCP Server.

Expected behavior

The configured SSE endpoint should exactly match the actual mount path (/answer/api/v1/mcp/sse), endpoint strings should be defined as shared constants to avoid drift, and the MCP server should identify itself as Apache Answer MCP Server.

Platform

  • Device: Any
  • OS: Any
  • Version: main branch (mcp-go v0.43.2)

Activity

  1. added theissue type on Nov 19, 2026
  2. added a commit that references this issue on Nov 19, 2026
    d0263ac
  3. LinkinStars commented on Nov 19, 2026

    @LinkinStars
    Member

    Fixed by #1680.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions