Skip to content

Plug-and-play MCP OAuth, local CLI, proprietary eval engine, canonical host - #6

Merged
criptogus merged 2 commits into
mainfrom
claude/fix-mcp-oauth-connections-xotJ6
May 15, 2026
Merged

Plug-and-play MCP OAuth, local CLI, proprietary eval engine, canonical host#6
criptogus merged 2 commits into
mainfrom
claude/fix-mcp-oauth-connections-xotJ6

Conversation

@criptogus

Copy link
Copy Markdown
Owner

Summary

Makes connecting Super Agent Skill via MCP truly plug-and-play across Claude, Cursor, Codex, VS Code, Lovable, Windsurf, etc., hardens the evaluation "secret sauce" against leakage, and standardizes the canonical host.

1. MCP OAuth — fixes the failing/non-fluid connection

  • Root cause: modern clients probe the path-aware /.well-known/oauth-protected-resource/api/mcp (RFC 9728); that route didn't exist → 404 aborted the handshake. Added the path-aware protected-resource and authorization-server routes.
  • Centralized discovery metadata + CORS in mcp-oauth.server.ts (removed 4 drifting copies).
  • /api/mcp now sends CORS, an OPTIONS handler, and exposes the WWW-Authenticate challenge so web connectors can discover OAuth.

2. Local CLI (cli/super-agent.mjs)

  • connect — dynamic client registration + loopback PKCE OAuth in the browser + auto-writes the client's MCP config.
  • login / status / logout / setup <client>.
  • mcp — local stdio↔HTTP bridge that injects and auto-refreshes the OAuth token (plug-and-play for stdio-only or flaky-OAuth clients).
  • Documented on /connect and /docs/mcp with ready-to-paste connection prompts.

3. Proprietary evaluation engine (secret sauce)

  • Old get_methodology dumped the full rubric and review_skill echoed every check + fix string → a model internalized the evaluator after one call.
  • Signals, weights and thresholds are now server-private. get_methodology returns only dimension names + how-to-use; review_skill returns score + coarse band + rotating, file-specific outcome directives — no per-check pass/fail.
  • Stronger engine: graded multi-signal scoring with per-type weighting and weighted-deficit action ranking.

4. Canonical host

  • 301 www.superagentskill.comsuperagentskill.com at the server entry (preserves path + query) so the OAuth issuer/resource mismatch is resolved at runtime; in-app links + top-level docs normalized to the apex.
  • content/skills/*.yaml and the seed script intentionally left untouched (published package payloads).

Test plan

  • npm run test (CLI tests pass locally: 4/4)
  • Add the connector in Claude/Cursor/Codex and confirm OAuth completes without a 404
  • npx super-agent connect --client claude-code end-to-end (browser login → token stored → config written)
  • npx super-agent mcp bridges a stdio client with auth injected
  • review_skill / get_methodology no longer expose the rubric or per-check booleans
  • Hitting www. 301-redirects to the apex with path/query preserved

https://claude.ai/code/session_01QjRrzVxTXxMAwWsU65Avaf


Generated by Claude Code

The OAuth issuer/resource is minted against the bare apex, so clients
reaching the site via www.* hit an issuer mismatch and reject the token.

- Add a narrow 301 www.superagentskill.com -> superagentskill.com
  redirect at the server entry (preserves path + query) so the mismatch
  is resolved at runtime, not just in docs
- Normalize all in-app links and top-level docs to the apex host

Note: content/skills/*.yaml and scripts/seed-gtm-skills.mjs still
reference www and are intentionally left untouched — they are published
package payloads and rewriting them would change registry data/signing.

https://claude.ai/code/session_01QjRrzVxTXxMAwWsU65Avaf

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: cf2e564082

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/server.ts
if (url.host !== `www.${CANONICAL_HOST}`) return null;
url.host = CANONICAL_HOST;
return new Response(null, {
status: 301,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Preserve HTTP method on canonical host redirect

The new canonicalRedirect returns 301, which can cause clients/intermediaries to replay non-GET requests as GET when following redirects. Because this redirect runs before routing for every request, POST/PUT API calls sent to www.superagentskill.com (for example OAuth/token or package upload flows) can lose their method/body and fail unexpectedly. Use a method-preserving permanent redirect (308) for this host canonicalization.

Useful? React with 👍 / 👎.

…connections-xotJ6

# Conflicts:
#	src/server.ts
@criptogus
criptogus merged commit 77c182e into main May 15, 2026
1 of 2 checks passed
criptogus pushed a commit that referenced this pull request May 15, 2026
301 lets clients/intermediaries replay non-GET requests as GET. Since
the redirect runs before routing for every request, POSTs to the www
alias (OAuth token, package upload) could lose their method/body. 308
preserves both. Addresses PR #6 review.

https://claude.ai/code/session_01QjRrzVxTXxMAwWsU65Avaf
criptogus pushed a commit that referenced this pull request May 28, 2026
…equest

Infra/API follow-ups from operator feedback:

- review_skills_batch: score up to 10 files in one parallel call, aligned to
  input order with a single shared feedback_request — far lower round-trip
  latency than N review_skill calls (feedback #8).
- In-process result cache keyed by content_hash + options. Identical
  re-submissions skip both the deterministic scoring and the LLM semantic pass,
  cutting ~15-30s to ~0 on iterative loops; responses carry `cached` (#9).
  Core review logic extracted into computeReview(), shared by single + batch.
- dry_run preview for upload_packages and request_primitive: validates the file
  (type inference + prompt-injection guard) or echoes the would-be request
  WITHOUT auth, persistence, or model budget, so agents can test the publish
  flow before connecting OAuth. The MCP write-tool auth gate now lets a
  dry_run call through anonymously (#5/#6).

https://claude.ai/code/session_01EntkmBiYh381pKqvvSFBkg
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