Skip to content

chore: live SFY auth status on single-server GET and mid-turn authorize - #668

Merged
heerambavi1998 merged 3 commits into
mainfrom
sr-AGE-2153
Sep 10, 2026
Merged

heerambavi1998 merged 3 commits into
mainfrom
sr-AGE-2153

Conversation

@sr07asthana

@sr07asthana sr07asthana commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Closes #

Changes

How was this tested?

Checklist

  • I have read the contributing guidelines
  • pnpm build, pnpm test, pnpm typecheck, pnpm lint:ci, and pnpm format:check pass locally
  • Tests added/updated where it makes sense
  • No hand-edits to generated code (packages/trueforge-sdk, .github/fern/openapi/openapi.json, docs/openapi.json) — fork PRs omit SDK regen; maintainers regenerate after merge
  • Docs / .env.example updated if configuration or behavior changed

Note

Medium Risk
Changes MCP authentication timing and status for header/env and other non-DCR modes, which can alter UI and turn behavior for servers that previously skipped live SFY checks.

Overview
TrueFoundry MCP auth is no longer limited to DCR/oauth-style servers: single-server responses (e.g. GET by name) call SFY getMcpAuthStatus for the one record, while multi-server list responses still use manifest-derived stub status to avoid N upstream calls.

Mid-turn tool invoke always runs SFY authorize before attaching gateway Bearer headers. Servers that need user action return authRequired with the consent URL; missing URLs still fail with 422. Per-server header overrides and Bearer stripping are unchanged.

Unit tests cover live status for non-DCR records and authorize gating on invoke; perServerMcpHeaders mocks now stub getMcpAuthorize so every invoke path succeeds auth.

Reviewed by Cursor Bugbot for commit 0b0ca27. Bugbot is set up for automated code reviews on this repo. Configure here.

@cursor cursor Bot 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.

Stale Bugbot comment from a previous run.

@changeset-bot

changeset-bot Bot commented Sep 10, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 0b0ca27

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@truefoundry/trueforge Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@heerambavi1998
heerambavi1998 enabled auto-merge (squash) September 10, 2026 07:18
@heerambavi1998
heerambavi1998 merged commit 1c16780 into main Sep 10, 2026
10 checks passed
@heerambavi1998
heerambavi1998 deleted the sr-AGE-2153 branch September 10, 2026 07:21

@cursor cursor Bot 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.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 0b0ca27. Configure here.

tenant_id: record.tenant_id,
name: record.name,
userRef,
});

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Invoke requires OAuth public URL

Medium Severity

resolveInvokeHeaders now always calls authorize before returning gateway headers. authorize always builds a redirect URL via resolveAuthorizeRedirectURL, which fails with a 500 if PUBLIC_BASE_URL is empty. No-auth and header MCP invokes previously skipped this path, so a TrueFoundry deploy without PUBLIC_BASE_URL can now fail every mid-turn tool call, not just OAuth.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 0b0ca27. Configure here.

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