Skip to content

MCP: response shaping scrambles column order, sample breaks structuredContent, failed async tasks lose their request_id #275

Backlog

Description

@jrosskopf
  • Column order: response: {redact-columns: [...]} / max-rows (and every resource, which always gets the 1000-row cap) returns each row with its columns in a different order. MCPResponseShaper::shape rebuilds rows through crow::json::wvalue, which toolSuccessResultJson deliberately avoids (src/mcp_response_shaper.cpp:20-31,84-93).
  • sample: true: structuredContent.rows becomes an object {columns,row_count,sampled}, not an array, and row_count is missing beside it.
  • Failed async task: an async: true tool whose SQL fails ends status: completed with an isError result, and the text lacks the request_id (there is no request context on the worker thread), so the log line cannot be found.
  • WWW-Authenticate: a Bearer challenge is sent on a mcp.auth.type: basic server (src/mcp_route_handlers.cpp, buildWwwAuthenticate).
  • Dry-run output: _dryRun results carry rows: [] / row_count: 0, which reads like an empty answer.
  • Auditor gaps: with mcp.auth enabled, a tool without allowed-roles passes --validate-config silently and answers 403 to everyone. With mcp.auth off, an endpoint whose REST auth: requires a role exposes every row through tools/call, and the only signal is the generic MCP_UNAUTHENTICATED_TOOLS. A per-endpoint warning (REST auth on, tool open) and a strict mode would help.
    Found while writing and reviewing the task guides (docs: Task guides for every feature area, run in CI and aligned with flapi.io #272).

Activity

  1. added a commit that references this issue on Nov 26, 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