Skip to content

feat(debugging): add project issues DEBUG-311 - #546

Merged
jordienr merged 12 commits into
mainfrom
jordi/debug-311-mcp-issues
Nov 25, 2026
Merged

jordienr merged 12 commits into
mainfrom
jordi/debug-311-mcp-issues

Conversation

@jordienr

@jordienr jordienr commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Local HTTP E2E against Mockamaster · 23 Nov 2026

Ran the official server and matching utils preview packages from a0137116ef03998cb00dc3ac9b18b698fea5234b using the built-in loopback HTTP server, staging Management API, project-scoped read-only mode, and the debugging feature group. Both scoped clients initialized with protocol 2026-07-28 and discovered query_logs, get_issues, and get_advisors.

Mockamaster-only credential Project-read control Actual tool calls
Advisors Read 403 (missing Project Settings Read) All eight Issues calls and three legacy Advisors calls succeeded. Security 7 groups, performance 4, health 0, all three checks complete. With minimum severity info / warning / critical, counts were 11 / 8 / 0.
Project Settings Read only 200 All eleven tool calls returned MCP tool errors. Security and performance reported missing advisors_read; health reported Forbidden. Discovery remained available.

Actual tools/call parameters and decoded response content:

{"name":"get_issues","arguments":{"type":"health"}}
  • Advisors Read: {"issues":[],"checks":[{"type":"health","status":"complete"}]}
  • Project Settings Read only: {"error":{"name":"ToolCallerError","message":"Forbidden"}}

Separate local tests exercised the companion Platform controller at ec68d80 with fixture authentication, permissions and backend data. All eleven assertions passed across modern and legacy HTTP, including both permission metadata entries, missing permission and wrong-project denial. Denied calls made zero backend requests. The live Mockamaster run above used real staging permissions. Shared hosted ingress and its deployed version remain outside this local test. All temporary QA tokens were revoked.

Current review follow-up (a013711)

Merged current main. Review checklist:

  • Self-hosted compatibility: Issues accepts bare arrays and hosted envelopes; legacy output stays intact. Studio #53837 covers the real adapter and primary independently verified its integration.
  • Partial failures: each failed or malformed check becomes unavailable without losing successful findings. HTTP 401/403 and hosted protocol authorization errors still propagate; regression cases cover both APIs and hosted error shapes.
  • Bounded evidence: affected_count gives the total and affected contains at most 20 findings, ordered by severity and ID. Truncation and shuffled-input regressions pass.
  • Distinct category/default coverage: the default-call fixture asserts security, performance, and health IDs/categories with an INFO finding.
  • Shared adapter lookup: Issues and Advisors dispatch through the same table.
  • Advisors description: removed the duplicate instruction to run regularly after DDL.
  • Unsupported health selection: excluded from the advertised enum; all still reports health unavailable.
  • Global instructions: refer to the project's issues and logs without naming a possibly disabled tool.
  • Preview CI scope: moved the checkout fix to separate MCP #602. Generated API types and the README paragraph have no diff against main.
  • Incomplete-assessment hosted metrics: proposal tracked in DEBUG-345; category/status observations or bounded counts exclude findings/payloads. Requires team agreement; hosted metric semantics are unchanged.

Companions: Platform #41754, Studio #53837, evals #542, and docs #53313. The official eval passed all three checks on this MCP revision, including the model-judged report, tool use and unchanged RLS settings. Eval run.

Validation on this head: full build and typecheck, 971 unit tests, changed-file Biome and diff checks passed. Primary independently passed the affected tests with shuffled order and the actual Studio adapter integration. The seeded platform-lite STDIO probe confirmed two grouped security findings, unavailable health coverage, and legacy discovery. The same probe then passed with the official published MCP preview and matching utils installed into an isolated npm consumer; it checked affected_count: 2 through a real child process and localhost upstream. Latest-head CI passed: test (including packaged consumer), UI tests, type/API checks, quality, Coveralls, and preview publication. The unrelated Proof check was conditionally skipped. Latest test run.

Incomplete-assessment metrics need team agreement and are tracked in DEBUG-345: proposed bounded category/status observations or counts, excluding findings and payloads. No hosted metric semantics changed in this PR.

Problem

Studio is moving from Advisors to Issues Inbox. MCP clients need the same Issues interface, including health checks, grouped findings, and severity filtering.

What this adds

  • get_issues in the debugging tool group, combining security, performance, and health checks through existing Management API endpoints.
  • Grouped findings with affected resources, evidence, remediation links, and a severity derived from the highest-severity finding in each group.
  • Minimum-severity filtering with up to 20 affected findings per matching group, highest severity first, and affected_count for the full total.
  • Explicit coverage for each requested check, so unavailable checks cannot be mistaken for clean results.
  • Compatible migration: both get_issues and get_advisors remain visible in discovery and callable. Advisors keeps its existing parameters and response contract, with an informational notice about planned future deprecation.
  • Read-only support: the tool is available on read-only connections and carries read-only, non-destructive, and idempotent annotations.

Also fixes a pre-existing order-dependent registry test by initializing SDK schemas before measuring repeated server creation, preserving the zero-growth assertion.

Interface and parameters

get_issues({ project_id, type, severity })

Parameter Values Default / requirement Behavior
project_id Supabase project reference Required on an unscoped connection Selects the project. On a project-scoped connection it is injected by the server and omitted from the advertised input schema.
type all, security, performance, health Runtime default: all Selects the requested check categories. all requests all three. Platforms without health support omit health from the advertised enum and report its coverage as unavailable for all.
severity info, warning, critical Runtime default: info Minimum grouped issue severity. warning includes warning and critical groups; critical includes only critical groups. Matching groups include a bounded sample of up to 20 findings and the full affected_count.

Underlying Advisors levels map as INFO → info, WARN → warning, and ERROR → critical. Severity filtering does not change check coverage.

The captured discovery schema advertises type and severity as required and includes their defaults. Runtime calls with these fields omitted apply the defaults. Clients following discovery should send both explicitly.

Example requests

Unscoped connection:

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "get_issues",
    "arguments": {
      "project_id": "erppftcfodkcyoftaqvb",
      "type": "security",
      "severity": "warning"
    }
  }
}

Project-scoped connection:

{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "tools/call",
  "params": {
    "name": "get_issues",
    "arguments": { "type": "all", "severity": "info" }
  }
}

These examples document the interface; the captured requests and responses below are actual live evidence.

Result fields

The result payload contains issues and checks:

Field Meaning
issues[].id Check identifier within the project, not a persistent incident ID.
title, description Human-readable check title and explanation.
severity Highest affected-resource severity in the group.
category security, performance, or health.
source lint.
docs_url Remediation documentation link.
affected_count Total findings in the group before truncation.
affected[] Up to 20 findings, sorted by severity descending and ID: id, resource (type, name, nullable schema), detail, severity, and docs_url.
checks[] Requested category (type), status (complete or unavailable), and optional reason.

An empty issues array means no issues matched the filter; inspect checks before concluding the assessment is complete. When a platform does not implement health checks, type: "all" reports health as unavailable; the advertised enum excludes health, so an explicit health request is rejected. Individual upstream or malformed-result failures become unavailable coverage with a reason while preserving other categories. Authentication, permission, and protocol errors still fail the call.

Permissions and discovery

  • Hosted checks use advisors_read; the companion Platform PR #41754 maps get_issues and legacy get_advisors to that permission.
  • With the debugging feature enabled, the tested project-scoped PR server advertises query_logs and get_issues. The legacy tool remains visible and callable.
  • Discovery advertises get_issues even for a valid token lacking Advisors access; invocation is denied. Discovery is not proof of authorization.
  • Published ChatGPT metadata requires a new plugin submission to expose the new tool. Existing frozen callers remain supported.

Historical verification

Verified source head: 279778822164f64a48100708712cb4632ade3798.

Check Coverage Result
Independent automated tests 920 unit tests, retries disabled, shuffled seed 11011; 7 stdio integration tests against a fresh build Passed
Static checks and build TypeScript, Biome, build Passed
Regression sensitivity Deliberately broke grouping, unavailable coverage, and filter wiring Tests caught each mutation
Live protocol matrix 10 cases in each of legacy and modern protocol modes: discovery, compatibility, invalid filters, and CLI parity Passed; at capture, default results matched CLI: 11 groups / 547 affected findings
Live scoped permissions Mockamaster-only advisors_read token versus valid project_admin_read token without Advisors access Allowed token: security 7, performance 4, health 0, all 11; denied token: all four requests rejected
Latest-head CI check, quality, test, Coveralls, preview publication, Continuous Releases Passed; original conditional preview check skipped, later preview publication succeeded

Latest-head test run · Preview publication

Mockamaster had no critical, mixed-severity, or unavailable findings during capture; those scenarios are covered by fixtures, not claimed as live coverage. Both temporary scoped QA tokens were revoked after testing and their local credential files deleted. No project schema, data, or settings were changed.

Hosted rollout remains pending: at the 12 November 2026 capture, deployed staging MCP 0.16.1 still advertised get_advisors, returned tool not found for get_issues, and omitted it from permission metadata. The successful new-tool checks used this PR's server over STDIO against live Mockamaster APIs. They do not establish that the hosted adapter has been deployed.

Historical screenshots

Actual terminal captures from the built PR server against Mockamaster, scoped read-only over STDIO. Credentials are not shown.

Health request and response

Full decoded tool payload: no findings, complete health coverage, successful exit.

MCP health request and response against Mockamaster

Security warning filter

Six warning issues and complete security coverage. For readability, this screenshot projects the response to check ID, title, severity, and affected count; it is not the full raw response.

MCP security request and response against Mockamaster

Earlier captured requests, responses, permissions, and discovery

Expand historical capture from 2797788 (before Advisors visibility was restored)

This earlier capture retains its original requests and responses. Its hidden-Advisors discovery result is superseded by the compatibility verification above. The current bounded evidence and partial-failure contracts supersede the historical payload format below.

Live Mockamaster MCP evidence, 12 Nov 2026

Target: staging Mockamaster (erppftcfodkcyoftaqvb), organization jordi-team; upstream https://api.supabase.green. New code ran through STDIO, source head 2797788, using --project-ref erppftcfodkcyoftaqvb --read-only --features debugging. Captures: 13:16:14–13:16:28 UTC with normal CLI login, then 13:21:18–13:21:34 UTC with two temporary project-only scoped PATs created through the normal dashboard UI, each with a 24-hour expiry. Tokens and session identifiers are excluded from this report. No project schema/data/settings were changed.

The new local MCP passed live scoped permission checks. The deployed hosted MCP still lacks get_issues; its legacy get_advisors correctly enforced the same permission in the control calls. This demonstrates local new-code behavior against live staging upstream APIs, not a completed hosted rollout.

Actual result summaries below are projections of complete captured responses:

Credential Local get_issues security / performance / health / all Additional observed control
Existing normal CLI login 7 / 4 / 0 / 11 grouped issues; requested checks complete warning: 8; critical: 0; invalid type/severity rejected with ZodError; hidden legacy get_advisors security call succeeds with 7 lints
Mockamaster-only advisors_read 7 / 4 / 0 / 11 grouped issues; requested checks complete Direct GET project: HTTP 403; hosted legacy health/security calls succeed
Mockamaster-only project_admin_read, without advisors_read All four calls return isError: true; security/performance/all report missing advisors_read; health reports Forbidden Direct GET project: HTTP 200, establishing the token is valid; hosted legacy health/security calls denied

Actual discovery request:

{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}

Both scoped credentials received the same local tools/list: query_logs, get_issues. Discovery advertises the tool even when the credential cannot execute it. get_advisors is absent from new-code discovery. Selected complete get_issues entry from the actual tools/list response, explicitly an excerpt of that response:

{"name":"get_issues","description":"Gets current project issues grouped by check, with security, performance, and health check coverage. Start here when debugging or after DDL changes. IDs identify checks within this project, not persistent incidents. An unavailable check is not a clean assessment. Include docs_url as a clickable remediation link.","annotations":{"title":"Get project issues","readOnlyHint":true,"destructiveHint":false,"idempotentHint":true,"openWorldHint":false},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","type":"object","properties":{"type":{"default":"all","type":"string","enum":["all","security","performance","health"]},"severity":{"description":"Minimum severity; filtering retains all findings of a matching issue","default":"info","type":"string","enum":["info","warning","critical"]}},"required":["type","severity"],"additionalProperties":false}}

Complete actual local STDIO health request, sent separately with each scoped credential:

{"jsonrpc":"2.0","id":5,"method":"tools/call","params":{"name":"get_issues","arguments":{"type":"health"}}}

Complete actual response with advisors_read:

{"result":{"content":[{"type":"text","text":"{\"issues\":[],\"checks\":[{\"type\":\"health\",\"status\":\"complete\"}]}"}]},"jsonrpc":"2.0","id":5}

Complete actual response without advisors_read:

{"result":{"content":[{"type":"text","text":"{\"error\":{\"name\":\"ToolCallerError\",\"message\":\"Forbidden\"}}"}],"isError":true},"jsonrpc":"2.0","id":5}

Hosted control endpoint: https://mcp.supabase.green/mcp?project_ref=erppftcfodkcyoftaqvb&read_only=true&features=debugging. Both scoped credentials initialized successfully and received legacy query_logs, get_advisors discovery. Complete actual legacy health request, sent separately with each credential:

{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"get_advisors","arguments":{"type":"health"}}}

Complete actual response with advisors_read (HTTP 200):

{"result":{"content":[{"type":"text","text":"{\"result\":{\"lints\":[]}}"}]},"jsonrpc":"2.0","id":3}

Complete actual response without advisors_read (HTTP 200, MCP tool error):

{"result":{"content":[{"type":"text","text":"{\"error\":{\"name\":\"ProtocolError\",\"message\":\"MCP error -32600: You do not have permission to perform this action\"}}"}],"isError":true},"jsonrpc":"2.0","id":3}

The earlier normal-login hosted initialization identified server version 0.16.1, protocol 2025-03-26. The complete actual get_issues health request and response demonstrate the rollout gap (HTTP 200, MCP tool error):

{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"get_issues","arguments":{"type":"health"}}}
{"result":{"content":[{"type":"text","text":"{\"error\":{\"name\":\"Error\",\"message\":\"tool not found\"}}"}],"isError":true},"jsonrpc":"2.0","id":3}

Hosted OAuth protected-resource discovery returned HTTP 200 at https://mcp.supabase.green/.well-known/oauth-protected-resource/mcp. Deployed permission discovery returned HTTP 200 at https://api.supabase.green/platform/mcp-tools-permissions in both captures. It contains "get_advisors":[["advisors_read"]] (selected entry, not the complete response) and has no get_issues entry. Source platform draft mapping includes both names under advisors_read; deployed metadata does not yet include the new name.

Complete newline-framed STDIO requests/responses, full paired exchanges, full HTTP bodies, timestamps, and executable provenance are retained privately. The complete health exchanges above are unprojected captured JSON-RPC bodies; the discovery entry and counts are explicitly labeled excerpts/projections. Executable SHA256: 43c65640d8efe798ce264b9bfbbe2442f14174fa8a4e6408351c792e0310221c. No token values, token hashes, credential file paths, or authentication/session headers appear here.

Cleanup: both temporary QA tokens were revoked in the dashboard after the captures. The filtered token list confirmed neither remained; both local credential files were deleted.

How to test

  1. Build this branch at a0137116ef03998cb00dc3ac9b18b698fea5234b and use a project-scoped, read-only connection with debugging enabled. The official preview package is published and passed the seeded local artifact probe; older captures below use earlier artifacts.
  2. Call tools/list: expect get_issues, with the parameters above; get_advisors should also be present.
  3. Call get_issues for each type and each minimum severity. Verify matching groups include no more than 20 affected findings, affected_count gives the full count, and requested coverage is explicit.
  4. Compare an Advisors Read token with a valid token lacking that permission. Expect successful results versus MCP tool errors, respectively.
  5. Call legacy get_advisors directly and verify its existing response remains supported.
  6. Use fixtures for unavailable or unsupported health and mixed-severity groups; do not infer those cases passed from empty live results.

Persistent issue state, dismissal, history, and banned-IP signals remain follow-ups.

Linked issue: DEBUG-311.

Historical review follow-ups

Review follow-up (02d500f)

get_issues now requests unavailable results from the security and performance adapters as well as health. Legacy get_advisors does not opt in. Platform support is tracked in supabase/platform#41754.

Verified: 32 focused tests passed with retries disabled and shuffled order (seed 1113), plus typecheck and formatting. The new regression cases failed before the fix. Latest-head CI is green; an unrelated generated Edge Function response test passed on its one rerun.

Reproducible official preview (c3b6c54)

Preview publication now checks out the exact PR head. Previously it built the merge ref, pulling in upstream dependency changes absent from the reviewed source and breaking the Platform consumer. The corrected official artifact installs under Platform's unchanged supply-chain protections, passes 272 scoped hosted E2E/unit tests twice (independent shuffle seed 1115, retries disabled), and passes actual Mockamaster discovery and calls to both tools. All latest MCP CI checks pass. Platform #41754 used this artifact for local QA only; its committed dependency remains unchanged pending a published release.

Compatibility clarification

Advisors stays visible, discoverable, documented, and usable alongside Issues. Deprecation is planned for a future release; the informational notices do not announce removal or a removal date. Existing contracts and permissions remain supported.

Verified correction at 85feadd

Independent QA passed 68 affected unit tests with retries disabled and shuffle seed 1114. Worker verification passed 87 unit/schema tests, build/typecheck, Biome, and all 7 STDIO integration tests; restoring hidden: true caused four discovery assertions to fail.

Fresh actual STDIO calls against Mockamaster returned discovery names query_logs, get_issues, and get_advisors. Both get_issues({type:"health"}) and get_advisors({type:"security"}) succeeded without tool or protocol errors. Captured 12 November 2026 at 15:50 UTC from source 85feadd2f2e4235d4e41c376a8a08e59a2397771; executable SHA256 bed5ad3e5ecd5e988a5eeae121ac358d5b83bbfd367bb343939310082d33151c. No new tokens or project writes.

All latest-head CI checks pass, including the test suite and coverage. One unrelated LLM evaluation initially omitted an invocation example; its failed job passed on rerun.

The shuffled origin/main baseline registers two lazy MCP SDK schemas on the first connection. Initialize that connection before measuring repeated server creation so the zero-growth assertion remains independent of test order.
@coveralls

coveralls commented Nov 11, 2026 •

Copy link
Copy Markdown

Coverage Report for CI Build 45143506798

Coverage increased (+0.03%) to 98.189%

Details

  • Coverage increased (+0.03%) from the base build.
  • Patch coverage: 7 uncovered changes across 2 files (319 of 326 lines covered, 97.85%).
  • 1 coverage regression across 1 file.

Uncovered Changes

File Changed Covered %
packages/mcp-server-supabase/src/tools/debugging-tools.ts 111 107 96.4%
packages/mcp-server-supabase/src/management-api/index.ts 11 8 72.73%
Total (5 files) 326 319 97.85%

Coverage Regressions

1 previously-covered line in 1 file lost coverage.

File Lines Losing Coverage Coverage
packages/mcp-server-supabase/src/management-api/index.ts 1 93.9%

Coverage Stats

Coverage Status
Relevant Lines: 6660
Covered Lines: 6564
Line Coverage: 98.56%
Relevant Branches: 1457
Covered Branches: 1406
Branch Coverage: 96.5%
Branches in Coverage %: Yes
Coverage Strength: 288.6 hits per line

💛 - Coveralls

@jordienr jordienr added the publish-preview Runs `publish-preview` workflow to publish preview packages via https://pkg.pr.new/ label Nov 12, 2026
@pkg-pr-new

pkg-pr-new Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

pnpm add https://pkg.pr.new/@supabase/mcp-server-supabase@a013711
pnpm add https://pkg.pr.new/@supabase/mcp-utils@a013711

commit: a013711

@jordienr
jordienr marked this pull request as ready for review November 12, 2026 16:09
@jordienr
jordienr requested a review from a team as a code owner November 12, 2026 16:09

@barryroodt barryroodt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this @jordienr!

Please could we look at the following before merging:

  1. Merge main and drop the generated-types commit + the README paragraph.
  2. Fix the four "Must fix" comments. (inline)
  3. Add an eval for it in supabase/evals. A scenario that passes with get_issues from your preview build would be great.

The "Smaller" comments (also inline) don't block.

Comment thread .github/workflows/publish-preview.yml Resolved
checks: [
{
type: category,
status: unavailable.length ? 'unavailable' : 'complete',

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Smaller: agree with us how an unavailable check shows up in the hosted metrics.

On hosted we count each tool call as ok or as an error. A get_issues call that returns unavailable here still counts as ok, so we can't see how often an assessment comes back incomplete.

I don't have a mechanism to suggest yet, so this is one to work out together in #team-ai.

@mattrossman

Copy link
Copy Markdown
Collaborator

Add an eval for it in supabase/evals. A scenario that passes with get_issues from your preview build would be great.

@jordienr We also made it easier to test MCP source changes against evals in supabase/evals#514 so you can iterate on these without a preview build!

@barryroodt barryroodt left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks Jordi! My inline comments are non-blocking, so feel free to merge whenever you're ready.

const response = await adapter(project_id, {
includeUnavailable: true,
});
return normalizeIssues(response, category);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One unexpected lint hides every other finding in its category. I agree with flagging malformed responses. If one lint has a new level, though, the user gets an unavailable check with the raw Zod error. The generated v1 and v2 lint types all fit lintSchema today, so this only comes up when a live payload drifts from the spec (a null in cache_key, or a new level).

I'd use safeParse on each lint so we can return the valid findings. For the check itself, I'd flag how many lints we skipped so a partial result can't read as clean.

value.code <= -32000) ||
value.code === 'UNAUTHORIZED' ||
value.code === 'FORBIDDEN' ||
(value.cause !== error &&

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: the caller can get a RangeError where it expects an unavailable check. The guard covers an error that points to itself, but two errors that point to each other will overflow the stack. I'd add a small depth cap for that rare case.

francis-codex added a commit to francis-codex/evals that referenced this pull request Nov 25, 2026
…on eval

Adds 10 Supabase database linter checks to platform-lite (security:
policy_exists_rls_disabled, rls_enabled_no_policy, security_definer_view,
function_search_path_mutable, materialized_view_in_api; performance:
unindexed_foreign_keys, auth_rls_initplan, no_primary_key,
multiple_permissive_policies, duplicate_index). The performance advisor
now returns real lints instead of an empty list. rls_disabled_in_public
remediation is now the docs URL, matching the hosted API.

New regression eval investigate-database-001-large-advisor-backlog seeds
a Mockamaster-shaped project: 547 findings in 11 issues, 8 at warning or
worse, and 3 critical issues that all trace to public.payments having RLS
disabled. It checks get_issues was called, its output stayed under 100k
chars without harness truncation, and the agent ranked enabling RLS on
public.payments first.

The experiment pins supabase/mcp at a0137116 (supabase#546 head) so it runs
without a local MCP checkout. Drop the pin once get_issues ships.

Refs supabase/mcp#546, supabase/mcp#574
@jordienr
jordienr merged commit 01f8021 into main Nov 25, 2026
8 checks passed
@supabase-releaser supabase-releaser Bot mentioned this pull request Nov 25, 2026
@barryroodt
barryroodt deleted the jordi/debug-311-mcp-issues branch November 25, 2026 13:11
Brian-1812 added a commit to Brian-1812/mcp that referenced this pull request Nov 25, 2026
The budget comment now says what the size test checks: growth of more
than about 10% fails. The supabase#546 test name now says that the docs link is
on the issue. The finding no longer has its own remediation link.
No assertion or constant changes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
barryroodt pushed a commit that referenced this pull request Nov 26, 2026
## What kind of change does this PR introduce?

Bug fix (response size). Follow-up to #546, as @barryroodt asked on #574
([comment](#574 (comment))).
Refs #124.

## What is the current behavior?

Every finding in `get_issues` repeats its issue's `docs_url`. In
splinter, each lint has one fixed remediation link, so these copies add
no data for splinter lints. On a project the size of the Mockamaster
capture in #546 (547 findings in 11 issues), the copies are about 22% of
the default response.

## What is the new behavior?

Findings no longer carry `docs_url`. The issue keeps its `docs_url`, so
every finding still reaches the link through its issue. Nothing else in
the output changes.

| Call | Before | After | Saved (chars / tokens) |
|---|---:|---:|---:|
| default | 62,296 chars, 15,225 tokens | 48,243 chars, 11,614 tokens |
22.6% / 23.7% |
| `severity: warning` | 43,789 chars, 10,533 tokens | 34,836 chars,
8,252 tokens | 20.4% / 21.7% |

I ran the real splinter SQL in PGlite on the supabase/evals#552 seed and
fed the lints to the real `get_issues` on `main`. Splinter also flags 41
unused indexes there, because a fresh database has no index scans. I
left those out to match 547 findings in 11 issues. With them, the
default call goes from 69,279 to 53,346 chars (23.0%). Tokens are OpenAI
`o200k_base`; I did not count Claude tokens. In every call I ran, each
removed link was equal to its issue's link, and the rest of the output
is byte-identical.

There is exactly one way this change can lose data: two findings of the
same lint with different docs links, where the second link is now gone.
I checked splinter at
[`cc529aa9`](https://github.com/supabase/splinter/blob/cc529aa9d3eeffd2e64576c7591e60b22abd205c/splinter.sql):
each of its 31 lints has one constant remediation, so this can't happen
there. I can't see the platform-only and health lints, though: can you
confirm that none of them gives two findings of one lint different
links?

## How to Review

1. **Output contract**
   - `packages/mcp-server-supabase/src/issues.ts`
- `docs_url` leaves the finding schema and the finding object. The
issue-level `docs_url` does not change. `get_issues` uses this schema as
its output schema, so `tools/list` changes too.

2. **Tests**
- `packages/mcp-server-supabase/src/server.debugging.test.ts`: a new
size test calls `get_issues` through the server harness on 547 findings
in 11 issues. The default response must stay under
`LARGE_PROJECT_ISSUES_BUDGET` (48,000 chars).
- `packages/mcp-server-supabase/src/issues.test.ts`: one #546 test gave
two findings of one issue different links. It now checks the issue's
link, and that a finding has no `docs_url`.

**Review questions**

- [ ] Is 48,000 chars a good budget? It is about 10% above today's
43,493 for this fixture, so it catches growth early. It is well under
the 25,000-token limit from #124.
- [ ] If a platform-only or health lint can give different links
(question above), should I keep `docs_url` on a finding only when it
differs from the issue's link?
- [ ] Should this land before the release in #586? Then no published
version has `docs_url` on findings.
- [ ] Do the tests check output, not implementation details?

## Verification

- With `main`'s `issues.ts`, the new size test fails with `expected
56866 to be less than 48000`. On this branch it passes at 43,493.
- `pnpm format:check`, `tsc --noEmit`, and `vitest run --project unit`:
1028/1028 passed.

## Additional context

This changes the `get_issues` output schema: `issues[].affected[]` no
longer has `docs_url`. So it is best merged before that schema goes into
a ChatGPT submission. If #586 merges first, the field is in a published
release. Then I will mark the commit as breaking, as CONTRIBUTING asks
for a contract step.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
barryroodt pushed a commit that referenced this pull request Nov 26, 2026
🤖 I have created a release *beep* *boop*
---


<details><summary>mcp-utils: 0.11.1</summary>

##
[0.11.1](mcp-utils-v0.11.0...mcp-utils-v0.11.1)
(2026-11-26)


### Bug Fixes

* **mcp-ui:** shared project card for create-project and create-branch
([#578](#578))
([efe189f](efe189f))
</details>

<details><summary>mcp-server-supabase: 0.20.0</summary>

##
[0.20.0](mcp-server-supabase-v0.19.0...mcp-server-supabase-v0.20.0)
(2026-11-26)


### Features

* **debugging:** add project issues DEBUG-311
([#546](#546))
([01f8021](01f8021))
* **mcp-server-supabase:** add optional schemas parameter to
generate_typescript_types
([#592](#592))
([7532f53](7532f53))


### Bug Fixes

* **debugging:** link docs once per issue in get_issues
([#610](#610))
([74801d8](74801d8))
* **mcp-server-supabase:** detect import maps uploaded with a ./ prefix
([#591](#591))
([6b8f4dc](6b8f4dc))
* **mcp-server-supabase:** keep a declined or cancelled SQL confirmation
final ([#581](#581))
([03afe8e](03afe8e))
* **mcp-server-supabase:** match Studio's notebook row_limit and clarify
skip and blank-input messages
([#593](#593))
([ad07f1b](ad07f1b))
* **mcp-server-supabase:** skip cost confirmation for $0 projects on
clients without forms
([#608](#608))
([50cfc37](50cfc37))
* **mcp-server-supabase:** stop reusing a removed import map on edge
function redeploy ([#588](#588))
([56093a6](56093a6))
* **mcp-ui:** shared project card for create-project and create-branch
([#578](#578))
([efe189f](efe189f))
* **mcp:** confirm UPDATEs without WHERE that follow a comment and set a
dollar-quoted value ([#612](#612))
([468907a](468907a))
* **mcp:** confirm UPDATEs without WHERE that use inheritance syntax
([#565](#565))
([687b3ee](687b3ee))
* **mcp:** confirm UPDATEs without WHERE when a column name ends in
where ([#557](#557))
([57fa34b](57fa34b))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: supabase-releaser[bot] <223506987+supabase-releaser[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

publish-preview Runs `publish-preview` workflow to publish preview packages via https://pkg.pr.new/

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants