Skip to content

feat: connect to the fixed StackGuardian MCP URL per region - #3

Merged
arunim2405 merged 1 commit into
mainfrom
feat/fixed-mcp-urls
Nov 13, 2026
Merged

arunim2405 merged 1 commit into
mainfrom
feat/fixed-mcp-urls

Conversation

@arunim2405

Copy link
Copy Markdown
Member

The plugin directory refused version 1.0.1 because its MCP URLs contain ${user_config.org}. This points stackguardian-eu and stackguardian-us at fixed URLs:

  • https://api.app.stackguardian.io/api/v1/mcp
  • https://api.us.stackguardian.io/api/v1/mcp

It also removes the org setting, since the organization is now chosen on the consent page, and bumps the plugin to 1.1.0. The READMEs say how to switch orgs and that upgrading asks for one more sign-in.

⚠️ Merge last (draft until then)

Merge only after these hold in both prod regions:

  • /api/v1/mcp is live in the gateway;
  • the api serves its protected-resource metadata;
  • the api's core pin mints dotted grant tokens;
  • the end-to-end sign-in check (Claude Code plus a claude.ai custom connector) has passed.

Before that, installs would hit a missing route or loop on sign-in.

Test plan

  • claude plugin validate --strict plugins/stackguardian and claude plugin validate --strict . pass.
  • No user_config references remain.
  • Reviewed by a separate reviewer.
  • After the backend is live: install the plugin, /mcp, sign in to each region, pick an org, and run a tool.
  • Resubmit plugins/stackguardian in the plugin directory.

🤖 Generated with Claude Code

The plugin directory refuses MCP URLs with ${...} variables. Point
stackguardian-eu and stackguardian-us at /api/v1/mcp and drop the org
setting: the organization is now chosen on the consent page.

Merge only after, in both prod regions: /api/v1/mcp is live, api serves
its protected-resource metadata, the api pin carries core's dotted grant
tokens, and the end-to-end sign-in check (Claude Code and a claude.ai
custom connector) has passed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@arunim2405

Copy link
Copy Markdown
Member Author

🤖 AI review (GPT-6.1)

Verdict: a few issues; no runtime blockers found.

auth#225 — feat: authorize grant tokens on the org-less /api/v1/mcp route

  • Should fix auth/tests/test_auth.py:1505 — The new log-redaction tests capture the root logger, while src.app constructs the authorizer logger with propagate=False. Consequently, its messages never reach pytest’s root capture handler, and all 11 new parameterized cases fail at assert expected_line in caplog.text. Four existing log-capture cases fail for the same reason.

    Reproduced with Python 3.12 and the pinned sg_logger commit. Attaching pytest’s capture handler directly to the authorizer logger makes all 15 affected cases pass, including their secret-redaction assertions. Suggested fix: add a test fixture that attaches/removes caplog.handler on that logger, or temporarily enables and restores propagation. Preserve the positive assertion that the expected log was observed.

    GitHub reports the head’s unit-test check as successful; reconcile that with the local reproduction. This finding concerns test capture, not an observed token leak.

sg-clickhouse-mcp#78 — feat: serve the MCP on the org-less /api/v1/mcp route

No serious findings. The fixed-route middleware runs before path rewriting, rejects duplicate context headers and unauthenticated contexts, and prevents the direct identity header from replacing a present gateway context.

The deployed Lambda Web Adapter’s context-header handling remains a live verification requirement; local tests cannot establish it.

api#1857 — feat: serve PRM for the org-less /api/v1/mcp and revoke dotted grant tokens

No serious findings. The metadata route preserves the requested resource path, and dotted-token revocation derives its org from the token before hashing. Legacy revocation still accepts an explicit org.

core#1416 — feat: embed the org in new OAuth grant tokens

No serious findings. Token grammar matches auth and API, org casing is preserved, and hashing still covers the full token using the org as the HMAC key. The stored attributes and lookup index remain unchanged, so this change requires no token backfill.

sg-clickhouse-mcp#77 — ci: ship skill Terraform examples to claude-plugins as Markdown

No serious findings. Ran only the copy/wrap steps against temporary copies: all 16 examples were converted, their fenced Terraform contents matched the originals byte for byte, and no .tf files remained in the output. The transformed plugin passed strict validation.

claude-plugins#3 — feat: connect to the fixed StackGuardian MCP URL per region

Draft; no serious findings. Both regional URLs match the backend contract, the obsolete org setting is removed, and strict plugin and marketplace validation pass.

Cross-PR / rollout

  • Deploy auth to QA before merging core: the API’s QA Pipfile tracks core main.
  • Deploy auth in both production regions before bumping the API production core pin to the new release. The current production pin remains v2.1.101; a later pin bump is still required to mint dotted tokens there.
  • Configure the fixed gateway route with a REQUEST authorizer, no identity source and authorizer-result TTL 0. Deploy API metadata and MCP middleware alongside the route.
  • Before releasing the plugin, verify unauthenticated discovery, rejection of forged identity headers, and complete sign-in/tool calls through Claude Code and a claude.ai connector in both regions.
  • Merge the generated skills-sync PR from #77 before directory resubmission. Keep claude-plugins#3 last.

Tests

Independently run:

  • Core grant tests: 36 passed.
  • API OAuth broker tests, using the reviewed core source: 126 passed.
  • MCP auth/analytics tests: 138 passed.
  • Auth suite: 279 passed, 15 failed, all in log capture. A separate capture-handler fixture made all 15 affected cases pass without changing repository source.
  • Strict plugin and marketplace validation: passed.
  • Terraform-to-Markdown conversion: 16 exact-content checks passed; transformed plugin validation passed.

Live gateway, Lambda Web Adapter header handling and end-to-end OAuth sign-in were not tested. All six temporary review worktrees were removed.

Automated review generated from the StackGuardian PR-review automation. Comments only; it does not approve or block. Reply here if a finding is wrong.

@vaibhav-202 vaibhav-202 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Reviewed the diff at a4bbed4 (I did not install the plugin; the backend isn't live yet). No issues found.

What I checked:

  • .mcp.json: both servers point at the fixed /api/v1/mcp URLs, which match the route served by sg-clickhouse-mcp#78 and the protected-resource metadata path in api#1857.
  • No user_config reference remains anywhere in the repo, including the synced skills, so removing the required org setting leaves nothing unresolved.
  • The skills never take the org from the server URL. Where they need it (sg-create-connector, the Terraform skills), they read it from the dashboard URL or from the /orgs/<org>/... ids the tools return, so they still work without the setting.
  • README: the claude.ai custom connector line is now correct for both regions. The org-switch and upgrade sign-in notes match how the per-region URL behaves.

Agree with keeping this a draft until the merge-last checklist in the description holds in both prod regions.

@arunim2405
arunim2405 marked this pull request as ready for review November 13, 2026 14:13
@arunim2405
arunim2405 merged commit cb17dd3 into main Nov 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants