Skip to content

Docs for embedded auth server#540

Merged
tgrunnagle merged 6 commits intomainfrom
embedded-auth-server
Feb 12, 2026
Merged

Docs for embedded auth server#540
tgrunnagle merged 6 commits intomainfrom
embedded-auth-server

Conversation

@tgrunnagle
Copy link
Contributor

Description

Adds documentation for the embedded authorization server, a new ToolHive
feature (RFC THV-0031) that runs an OAuth authorization server in-process
within the ToolHive proxy. This enables MCP servers to authenticate users
via upstream identity providers (such as Okta or Microsoft Entra ID) without
requiring clients to obtain tokens independently.

  • Concepts page (auth-framework.mdx): New section explaining how the
    embedded authorization server works, when to use it, and how it compares
    to external token validation. Includes a sequence diagram of the full
    OAuth flow and notes that this feature is Kubernetes-only.
  • Kubernetes guide (auth-k8s.mdx): Step-by-step setup instructions
    covering Secrets for signing keys and HMAC keys, the MCPExternalAuthConfig
    CRD, and the MCPServer resource. Includes examples for both OIDC and
    OAuth 2.0 upstream providers, a verification/testing section, and
    troubleshooting guidance.

Type of change

  • New documentation

Related issues/PRs

Embedded Authorization Server in Proxy Runner
RFC: THV-0031-auth-server-integration

Screenshots

N/A

Submitter checklist

Content and formatting

  • I have reviewed the content for technical accuracy
  • I have reviewed the content for spelling, grammar, and style

Reviewer checklist

Content

  • I have reviewed the content for technical accuracy
  • I have reviewed the content for spelling, grammar, and style

@vercel
Copy link

vercel bot commented Feb 10, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs-website Ready Ready Preview, Comment Feb 12, 2026 5:00pm

Request Review

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds end-user documentation for ToolHive’s new embedded authorization server feature (RFC THV-0031), explaining how it works conceptually and how to configure it in Kubernetes via the Operator.

Changes:

  • Adds an “Embedded authorization server” concept section, including an OAuth flow sequence diagram and model comparison.
  • Extends the Kubernetes authentication guide with a new “Approach 4” and a full embedded-auth setup walkthrough (Secrets, MCPExternalAuthConfig, and MCPServer examples).
  • Adds testing/verification steps and troubleshooting guidance specific to embedded auth.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
docs/toolhive/guides-k8s/auth-k8s.mdx Documents embedded auth server setup in Kubernetes, including configuration examples and troubleshooting.
docs/toolhive/concepts/auth-framework.mdx Explains embedded auth server behavior, when to use it, and how it compares to external token validation.

Copy link
Contributor

@jhrozek jhrozek left a comment

Choose a reason for hiding this comment

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

I haven't really dove into the technical accuracy of the examples - I trust they are correct and will review them properly, but I think we should discuss explaining the benefits from a different angle

Copy link
Collaborator

@danbarr danbarr left a comment

Choose a reason for hiding this comment

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

Editorial review (remaining items)

Generated with the help of Claude using the docs-review skill. The suggestions below and inline suggestions above are a mix of human and AI review.

Primary issues

"Choosing the right backend authentication model" crosses the page's stated scope

The #### Choosing the right backend authentication model section in auth-framework.mdx discusses backend authentication patterns (static credentials, token exchange, embedded auth server). This crosses into backend-auth territory — the page's own scope note says it covers "client-to-MCP-server authentication" only, and backend auth is explicitly deferred to backend-auth.mdx.

The section is useful as a decision tree, but its placement under ### Embedded authorization server makes it seem like a sub-topic of the embedded auth server rather than a cross-cutting concern.

Suggestion: Consider one of:

  • Move this section to backend-auth.mdx as a new decision-guide section (adding the embedded auth server as a third pattern alongside token exchange and federation), and link to it from here.
  • Keep it in this file but promote it to its own ### heading at the same level as ### Embedded authorization server, and note that it bridges client and backend auth concerns.

Important limitation buried in a long bullet point

In the #### Key characteristics list, the "Direct upstream redirect" bullet buries a significant limitation:

Chained authentication—where a client authenticates with a corporate IdP like Okta, which then federates to an external provider like GitHub—is not yet supported.

This is a key "gotcha" that will determine whether the feature works for a given deployment. A user skimming the bullet list could easily miss it.

Suggestion: Extract the chained-auth limitation into a :::warning or :::info admonition immediately after the bullet list so it stands out visually.


Dual-purpose of oidcConfig in embedded auth MCPServer needs clearer explanation

In the K8s guide's Step 5, the MCPServer resource uses both externalAuthConfigRef and oidcConfig. The YAML comments and the :::note below explain the relationship, but the oidcConfig is being used to validate JWTs issued by the embedded auth server itself — a different mental model from external IdP validation in Approaches 1–3. This could easily trip up users.

Suggestion: Add a brief explanatory sentence before the YAML block, e.g.:

The MCPServer needs two configuration references: externalAuthConfigRef to enable the embedded authorization server, and oidcConfig to validate the JWTs that the embedded authorization server issues. The oidcConfig issuer must match the issuer in your MCPExternalAuthConfig.

The YAML comments and :::note can then reinforce rather than carry the explanation.

Secondary issues

Issue Recommendation
DCR mentioned but not elaborated Dynamic Client Registration (RFC 7591) is listed in Key characteristics but never discussed in the K8s guide setup. Add a brief note saying it works automatically / requires no configuration, or add a setup note in the guide.
Approach 4 intro is slightly repetitive "This approach is ideal when you need ToolHive to retrieve OAuth tokens from an upstream provider for MCP servers that accept Authorization: Bearer tokens" largely restates the preceding sentence. Consider tightening to a single sentence.
Test section step 4 is vague "Connect with an MCP client that supports the MCP OAuth specification" — is there a recommended client or a way to test with curl? If not, a cross-reference to the client compatibility page would help.
Guide page length The file grows from ~470 to ~790 lines. Not a problem today, but worth noting — if a 5th auth approach is added, consider extracting each approach into its own page.

What works well

  • Clean Diataxis separation between concepts and how-to guide
  • The sequence diagram clearly illustrates the full OAuth flow
  • Step-by-step structure follows the established pattern from the token exchange guide
  • Good use of admonitions for key rotation tips and ephemeral key warnings
  • Troubleshooting section is specific and actionable
  • Bidirectional cross-references between concepts and guide pages
  • The OAuth 2.0 provider variant (GitHub example) is a practical addition

Copy link
Contributor

@jhrozek jhrozek left a comment

Choose a reason for hiding this comment

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

This is looking great! I left a couple of comments but I really like these docs

spec:
type: embeddedAuthServer
embeddedAuthServer:
issuer: 'https://mcp.example.com'
Copy link
Contributor

Choose a reason for hiding this comment

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

does the issuer need to match the resourceUrl in the MCPServer? Might be worth documenting what these values are or should be

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Does it need to match the resourceUrl? It needs to match the issuer on oidcConfig, but I don't think there is such a requirement for the resourceUrl (though they might be the same)

@tgrunnagle tgrunnagle merged commit af597e2 into main Feb 12, 2026
6 checks passed
@tgrunnagle tgrunnagle deleted the embedded-auth-server branch February 12, 2026 20:49
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.

3 participants