Title: [FEATURE] MCP server: provide a JSON render option for tool result text content · Issue #669 · stackql/stackql · GitHub
Open Graph Title: [FEATURE] MCP server: provide a JSON render option for tool result text content · Issue #669 · stackql/stackql
X Title: [FEATURE] MCP server: provide a JSON render option for tool result text content · Issue #669 · stackql/stackql
Description: Summary MCP tool results from stackql mcp currently carry the typed payload in structuredContent and a markdown rendering in the text content block (pkg/mcp_server/render). That is spec-correct, but a large class of MCP clients - LLM hos...
Open Graph Description: Summary MCP tool results from stackql mcp currently carry the typed payload in structuredContent and a markdown rendering in the text content block (pkg/mcp_server/render). That is spec-correct, bu...
X Description: Summary MCP tool results from stackql mcp currently carry the typed payload in structuredContent and a markdown rendering in the text content block (pkg/mcp_server/render). That is spec-correct, bu...
Opengraph URL: https://github.com/stackql/stackql/issues/669
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[FEATURE] MCP server: provide a JSON render option for tool result text content","articleBody":"## Summary\n\nMCP tool results from `stackql mcp` currently carry the typed payload in\n`structuredContent` and a markdown rendering in the `text` content block\n(`pkg/mcp_server/render`). That is spec-correct, but a large class of MCP\nclients - LLM hosts, scripting clients, and SDK helpers - only consume the\n`text` content. For those clients the markdown table/KV rendering is lossy\nand unparseable, and there is no way to opt into machine-readable text.\n\n## Current behavior\n\n`tools/call run_select_query` returns:\n\n- `structuredContent`: `{\"rows\": [...]}` (typed DTO)\n- `content[0].text`: a markdown table (`RenderTable`) or KV records\n (`RenderKV`), e.g. `# Pull Result\\n\\n## Record 1\\n...`\n\n## Proposed enhancement\n\nEither (or both) of:\n\n1. A per-call argument on the query/metadata tools, e.g.\n `format: \"markdown\" | \"json\"` (default `markdown`, preserving current\n behavior), where `json` renders the same DTO as compact JSON into the\n text content block:\n\n ~~~json\n {\n \"name\": \"run_select_query\",\n \"arguments\": {\"sql\": \"SELECT 1\", \"format\": \"json\"}\n }\n ~~~\n\n2. A server-level render default in `--mcp.config`, consistent with the\n existing config surface:\n\n ~~~json\n {\"server\": {\"render\": \"json\", \"audit\": {\"disabled\": true}}}\n ~~~\n\nThe per-call argument is the more useful of the two for mixed workloads\n(human-facing hosts want markdown, embedded/scripting clients want JSON in\nthe same session).\n\n## Context\n\nEncountered while building the embedded Rust client (`stackql-mcp-rs`):\nclients that follow the MCP spec can and should prefer `structuredContent`\n(that is what we ship), but interop with text-only consumers currently\nrequires parsing markdown. Observed on stackql v0.10.500, MCP stdio mode.\n","author":{"url":"https://github.com/jeffreyaven","@type":"Person","name":"jeffreyaven"},"datePublished":"2026-06-13T01:10:02.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/669/stackql/issues/669"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:9fc26f9d-384b-e16c-c858-25d0ab58d616 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 864A:228A12:301EEEF:447B3B2:6A4D0948 |
| html-safe-nonce | a07eb11cd2dbc9c6e4b31cf79f221ad5aceb47343864c76c18aebd26c18de1c4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NjRBOjIyOEExMjozMDFFRUVGOjQ0N0IzQjI6NkE0RDA5NDgiLCJ2aXNpdG9yX2lkIjoiMjA0MzYwNjc0MzI4ODQ0OTM1MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 413582f39c3230618d3012f02078b91a777df82f207720bc8b7853e34a8e199e |
| hovercard-subject-tag | issue:4653696211 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/stackql/stackql/669/issue_layout |
| twitter:image | https://opengraph.githubassets.com/83a89cee622c4bfc206bea820ef795fdaaa5059cd0d439ccbefd2a155aa267a6/stackql/stackql/issues/669 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/83a89cee622c4bfc206bea820ef795fdaaa5059cd0d439ccbefd2a155aa267a6/stackql/stackql/issues/669 |
| og:image:alt | Summary MCP tool results from stackql mcp currently carry the typed payload in structuredContent and a markdown rendering in the text content block (pkg/mcp_server/render). That is spec-correct, bu... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jeffreyaven |
| hostname | github.com |
| expected-hostname | github.com |
| None | 31e4db13a9e20081f2fac78f441659a6576e582bbb15e153f9c7fb6473aa29f5 |
| turbo-cache-control | no-preview |
| go-import | github.com/stackql/stackql git https://github.com/stackql/stackql.git |
| octolytics-dimension-user_id | 95105302 |
| octolytics-dimension-user_login | stackql |
| octolytics-dimension-repository_id | 443987542 |
| octolytics-dimension-repository_nwo | stackql/stackql |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 443987542 |
| octolytics-dimension-repository_network_root_nwo | stackql/stackql |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | fb70bd3c4b2bec429781b65419e912c66e2d5581 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width