-
Notifications
You must be signed in to change notification settings - Fork 333
feat(cli): add page-actions mcp-auth flag to docs.yml #17350
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| - summary: | | ||
| Add `page-actions.options.mcp-auth` to `docs.yml`, which opts an authenticated docs site into | ||
| the authenticated MCP endpoint (`/_mcp/authed/server`) so MCP clients can log in over OAuth | ||
| through the site's existing SSO or password auth. Defaults to `false`. | ||
| type: feat |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2816,6 +2816,7 @@ export class DocsDefinitionResolver { | |
| claudeCode: this.parsedDocsConfig.pageActions.options.claudeCode, | ||
| vscode: this.parsedDocsConfig.pageActions.options.vscode, | ||
| ...(!this.parsedDocsConfig.pageActions.options.mcp ? { mcp: false } : {}), | ||
| ...(this.parsedDocsConfig.pageActions.options.mcpAuth ? { mcpAuth: true } : {}), | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 warning Spreading a conditional object literal bypasses TypeScript's excess-property checking, so this compiles even if There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔵 suggestion What happens with |
||
| custom: this.parsedDocsConfig.pageActions.options.custom.map((customAction) => ({ | ||
| title: customAction.title, | ||
| subtitle: customAction.subtitle, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔴 Docs sites that turn on the new authenticated-MCP setting fail to build
The new
mcp-authsetting is accepted by the internal parser ("mcp-auth": z.boolean().optional()atpackages/cli/configuration/src/docs-yml/DocsYmlSchemas.ts:380) but was never added to the checked-in validation files the CLI uses first, so any site that sets it is rejected outright.Impact: Users who add the new option to their docs configuration get a hard "Failed to parse docs.yml" error and cannot build or publish their site at all.
JSON-schema validation runs before parsing and forbids unknown keys
packages/cli/workspace/loader/src/loadDocsWorkspace.ts:81validates the raw docs.yml against the generatedpackages/cli/workspace/loader/src/docs-yml.schema.jsonviavalidateAgainstJsonSchemaand throws aCliErrorwhen validation fails (packages/cli/workspace/loader/src/loadDocsWorkspace.ts:110-114).The
docs.PageActionOptionsdefinition in both generated schemas (docs-yml.schema.json:4487region and the copy underpackages/cli/workspace/loader/src/) still lists onlycopy-page,view-as-markdown,ask-ai,chatgpt,claude,claude-code,cursor,mcp,vscode,custom,skillsand ends with"additionalProperties": false. Ajv is compiled withallErrors: trueand noremoveAdditional, somcp-auth: trueproduces anadditionalPropertieserror →Unexpected property 'mcp-auth'.These two JSON schemas are generated from
fern/apis/docs-yml/definition/docs.ymlbypnpm docs-yml:jsonschema(seepackage.json:68), and CI enforces that they are regenerated and committed (.github/workflows/ci.yml:172-180). The previousmcpflag addition included the regenerated schemas; this PR does not.Prompt for agents
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed and fixed —
docs.PageActionOptionshas"additionalProperties": false, somcp-authwould have been rejected byloadDocsWorkspace's JSON-schema validation before parsing. Ranpnpm docs-yml:jsonschemaand committed both regenerated schemas.