Skip to content

Add CIMD support documentation#911

Draft
amirejaz wants to merge 3 commits into
mainfrom
cimd-support-documentation
Draft

Add CIMD support documentation#911
amirejaz wants to merge 3 commits into
mainfrom
cimd-support-documentation

Conversation

@amirejaz
Copy link
Copy Markdown
Contributor

@amirejaz amirejaz commented Jun 2, 2026

Summary

Documents the Client ID Metadata Document (CIMD) feature shipped in toolhive#5320, #5343, and #5348.

CIMD eliminates OAuth app pre-registration in two directions:

  • ToolHive as client (thv run): automatically uses https://toolhive.dev/oauth/client-metadata.json when the remote AS advertises CIMD support (e.g. Linear), falls back to DCR otherwise
  • ToolHive as server (embedded AS): accepts HTTPS URLs as client_id from clients like VS Code without prior DCR registration

Files changed

File Change
docs/toolhive/concepts/cimd.mdx New — concept doc: what CIMD is, both usage directions, two-layer architecture (mermaid diagram), security model, caching, limitations
docs/toolhive/concepts/embedded-auth-server.mdx Updated — new "CIMD support" section with cross-links
docs/toolhive/guides-k8s/cimd-embedded-as.mdx New — how-to guide: enable CIMD via MCPExternalAuthConfig CRD, cache config, verification, troubleshooting
sidebars.ts Updated — add both new pages to navigation

Generated with Claude Code

Copilot AI review requested due to automatic review settings June 2, 2026 15:16
@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 2, 2026

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

Project Deployment Actions Updated (UTC)
docs-website Ready Ready Preview, Comment Jun 2, 2026 4:09pm

Request Review

Copy link
Copy Markdown
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 ToolHive documentation for Client ID Metadata Documents (CIMD), covering both ToolHive-as-client behavior (thv run) and ToolHive-as-server behavior (embedded authorization server in Kubernetes), and wires the new pages into the docs navigation.

Changes:

  • Add a new CIMD concept page describing the protocol, ToolHive behavior, architecture, and security model.
  • Add a new Kubernetes how-to guide for enabling CIMD on the embedded authorization server via MCPExternalAuthConfig.
  • Update embedded authorization server concept docs and the sidebar to cross-link and expose the new pages.

Reviewed changes

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

File Description
sidebars.ts Adds the new CIMD concept page and Kubernetes guide to the Concepts and Kubernetes Operator sidebars.
docs/toolhive/guides-k8s/cimd-embedded-as.mdx New how-to guide describing how to enable CIMD and tune caching for the embedded authorization server.
docs/toolhive/concepts/embedded-auth-server.mdx Adds a CIMD support section with links to the new concept and how-to pages.
docs/toolhive/concepts/cimd.mdx New concept doc explaining CIMD, ToolHive’s two usage directions, and the embedded AS security/caching model.

Comment on lines +108 to +110
kubectl port-forward svc/my-mcp-server 8443:443 &
curl -s https://localhost:8443/.well-known/oauth-authorization-server | \
python3 -m json.tool | grep client_id_metadata_document
Comment on lines +188 to +189
- The document declares `grant_types` that do not include `authorization_code`,
or declares a `response_type` other than `code`.

:::

## Troubleshooting
Comment thread docs/toolhive/concepts/cimd.mdx Outdated
Comment on lines +129 to +130
- The document must declare at least one `redirect_uri`, and all redirect URIs
must pass strict validation (RFC 8252).
- Fix namespace: default → toolhive-system to match operator convention
- Fix verification command: use correct proxy port (8080) and service
  name pattern instead of placeholder 8443/443
- Add version availability notice (cimd field requires specific operator
  version) to both the concept doc and the k8s guide
- Fix prerequisite anchor to match exact heading in auth-k8s.mdx
- Add -n toolhive-system to kubectl describe command in troubleshooting
Copy link
Copy Markdown
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.

Content here is accurate and well-written, but before the line-level notes, one process point that should gate the merge.

Hold this until CIMD is actually released. When the release is cut, the automated release-docs generation PR will fire, and if it correctly picks up the completed CIMD work it'll regenerate the MCPExternalAuthConfig CRD reference (adding the cimd, cacheMaxSize, and cacheFallbackTtl fields) and likely some accompanying prose. That will overlap with what's in this PR. Rather than merge now and reconcile later, this content should be laid on top of the release-docs PR when it lands, so we resolve any duplication once instead of fixing it twice. Right now the cimd block isn't in the committed schema (static/api-specs/crds/mcpexternalauthconfigs.schema.json) yet, which confirms we're ahead of the release.

With that settled, the content notes:

1. This is over-built for the feature; slim the concept rather than keep a full standalone guide. The one genuinely cross-cutting, homeless idea is the client-side direction (thv run against Linear, automatic with DCR fallback), plus the dual-direction / two-layer architecture diagram. That's the concept-worthy core (~400 words). Most of the rest is implementation detail that duplicates the how-to.

2. Cross-document duplication. The cache table, the document-validation rules, and the Cache-Control limitation are each documented in both cimd.mdx and cimd-embedded-as.mdx (the Cache-Control caveat appears in four places across the two files). Pick one home for each: cache config and validation belong in the how-to; the concept should summarize and link.

3. SSRF internals are too low-level for user docs. cimd.mdx lines 141-151 (keep-alive disabled, DNS-first resolution, body caps) read like engineering notes a reader can't act on. Cut to a sentence or move to reference.

4. Buried lede. For thv run users the headline is "it's automatic, nothing to configure." cimd.mdx opens with two paragraphs of IETF-draft definition first. Lead with what it does for the reader.

5. The how-to is missing a "Next steps" section, and its closing order is wrong. cimd-embedded-as.mdx ends Troubleshooting then Related information. The pattern is Next steps > Related information > Troubleshooting.

6. Cross-cutting content is only reachable through Kubernetes entry points. cimd.mdx is linked only from the embedded-AS concept and the K8s how-to, so a CLI user connecting to Linear has no path to it. Add an inbound link from a CLI remote-auth or backend-auth context.

Secondary: cimd.mdx description runs ~165 chars (over the 160 SEO limit); tighten. Otherwise the prose, the mermaid diagram, and the real Linear example all hold up well.

- Fix redirect_uri → redirect_uris (plural) in concept doc
- Fix response_type → response_types (plural) in guide troubleshooting
- Restructure guide closing sections to match established pattern:
  Next steps → Related information → Troubleshooting
- Add Next steps section with 3 links
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