Skip to content

mcp.port is documented and parsed but never read — MCP always shares the HTTP port #151

Closed

Description

@jrosskopf

What

docs/CONFIG_REFERENCE.md documents mcp.port in four places (lines 418, 440, 1856, 2005) as the "MCP server port", default 8081. CLAUDE.md's config example shows it too. It does nothing:

  • parsed at src/config_manager.cpp:466 into mcp_config.port,
  • logged at debug level at :484,
  • never read again. MCP is served by the unified server on the HTTP port (http-port / -p / FLAPI_PORT).

Measured

flAPI run with mcp: {enabled: true, port: 8081} and -p <free port>:

  • tools/list on http://127.0.0.1:<http port>/mcp/jsonrpc → answers, lists the tool
  • anything listening on 8081 → nothing; http://127.0.0.1:8081/mcp/jsonrpc → connection refused

Why it matters

This is exactly the class CLAUDE.md warns about ("documented and parsed but never read"), and it already caused real damage: the flagship launch blog post in docs/promotion/drafts/ set mcp.port: 8081 and pointed every MCP example at localhost:8081, so a reader following the tutorial would get connection refused. That draft is fixed on the chore/smoke-timeouts-and-server-json-version branch; the config reference still teaches it.

Two more dead declarations nearby, worth removing together:

  • MCPServerConfig::stdio_transport and MCPServerConfig::mcp_port (src/include/config_manager.hpp:445-446) — never read;
  • CONTENT_TYPE_SSE (src/include/mcp_constants.hpp:60) — defined, never used; flAPI answers MCP with JSON only.

Suggested fix

Actually serving MCP on a second port would be a real feature and should be decided on its merits. Until then:

  • remove mcp.port from CONFIG_REFERENCE.md and CLAUDE.md, stating that MCP shares the HTTP port;
  • warn at startup when mcp.port is set, naming the port MCP actually answers on — an operator who configured it deserves to be told, rather than to discover it by connection refused;
  • delete the dead fields and constant.

Activity

  1. added a commit that references this issue on Sep 29, 2026
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions