Title: mcp: server modes, elicitation gating, audit subsystem (PR2) by jeffreyaven · Pull Request #652 · stackql/stackql · GitHub
Open Graph Title: mcp: server modes, elicitation gating, audit subsystem (PR2) by jeffreyaven · Pull Request #652 · stackql/stackql
X Title: mcp: server modes, elicitation gating, audit subsystem (PR2) by jeffreyaven · Pull Request #652 · stackql/stackql
Description: Summary
PR2 of the two-PR MCP server series. PR1 trimmed the tool surface to 11 + 1 prompt and shipped a single read_only: true/false flag. PR2 replaces that flag with a four-mode safety contract, wires MCP elicitation for approval-required modes, and adds an audit subsystem.
Four server modes replacing IsReadOnly: read_only, safe (new default), delete_safe, full_access. Verb-classified gate (SELECT / INSERT|UPDATE|REPLACE|MERGE|UPSERT / DELETE / EXEC) decides allow / refuse / needs-approval per mode.
Elicitation flow for needs-approval modes: server sends elicitation/create if the client advertised the capability; otherwise refuses with a message pointing at full_access.
Audit subsystem writing JSONL via a Sink interface; file sink ships with lumberjack rotation. Audit is on by default. Three failure_mode options: strict (default), strict_mutations, best_effort.
Gate middleware is the single chokepoint: classify → decide → (refuse / elicit / allow) → handler → audit. Replaces PR1's per-handler isReadOnlyConfig checks.
server_info exposes mode (new) and is_read_only (back-compat: true iff mode == "read_only").
Legacy back-compat: read_only: true JSON/YAML key still parses and maps to mode: read_only. When both are set, mode wins.
Breaking changes
Default behaviour shift. PR1 default = "no enforcement; mutations proceed." PR2 default = mode: safe = "mutations require user approval." Operators running the bundled client (which does not advertise elicitation) or any non-elicitation automation must explicitly opt into mode: full_access.
Audit on by default. PR1 logged nothing. PR2 writes JSONL to ./stackql_mcp_server_
Open Graph Description: Summary PR2 of the two-PR MCP server series. PR1 trimmed the tool surface to 11 + 1 prompt and shipped a single read_only: true/false flag. PR2 replaces that flag with a four-mode safety contract...
X Description: Summary PR2 of the two-PR MCP server series. PR1 trimmed the tool surface to 11 + 1 prompt and shipped a single read_only: true/false flag. PR2 replaces that flag with a four-mode safety contract...
Opengraph URL: https://github.com/stackql/stackql/pull/652
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:cb2d994c-d96c-57fe-ffce-bbd069fd734e |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | E81E:218868:BA6134:FC4D14:6A4D77F7 |
| html-safe-nonce | 40d959dcd092ed6ad6b196ad1cb3108b606f4a688304b2dbb0087f59ad7a7dd9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFODFFOjIxODg2ODpCQTYxMzQ6RkM0RDE0OjZBNEQ3N0Y3IiwidmlzaXRvcl9pZCI6IjUyODYxOTI5MzAxOTI0NTU2NzEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 6bf731a0126557dc519c951fe9c73feb95d09d2382c9ce2881ae6977184431c1 |
| hovercard-subject-tag | pull_request:3693992124 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,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/stackql/stackql/pull/652/files |
| twitter:image | https://avatars.githubusercontent.com/u/5146499?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/5146499?s=400&v=4 |
| og:image:alt | Summary PR2 of the two-PR MCP server series. PR1 trimmed the tool surface to 11 + 1 prompt and shipped a single read_only: true/false flag. PR2 replaces that flag with a four-mode safety contract... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 7f8e15305e2ab58890ca84b830615e375f5df303cf471cafcba0c08272981be3 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| 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 full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 8608b0750fc35e283e5ec5b094bff942d7a0e197 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width