feat(mcp): add JSON Schema for MCP/CLI configuration files#40025
Closed
lennondotw wants to merge 1 commit intomicrosoft:mainfrom
Closed
feat(mcp): add JSON Schema for MCP/CLI configuration files#40025lennondotw wants to merge 1 commit intomicrosoft:mainfrom
lennondotw wants to merge 1 commit intomicrosoft:mainfrom
Conversation
1c0ed3e to
a5531e9
Compare
lennondotw
added a commit
to lennondotw/playwright-mcp
that referenced
this pull request
Apr 2, 2026
- Add $schema example to the Configuration file section in README - Extend roll.js copyConfig() to also copy mcp-config.schema.json from playwright-core, so the schema ships with the npm package Depends on: microsoft/playwright#40025
lennondotw
added a commit
to lennondotw/playwright-cli
that referenced
this pull request
Apr 2, 2026
Add JSON Schema reference and SchemaStore mention to the Configuration file section in README. Depends on: microsoft/playwright#40025
a5531e9 to
1ffb319
Compare
lennondotw
added a commit
to lennondotw/playwright-cli
that referenced
this pull request
Apr 2, 2026
Add JSON Schema reference and SchemaStore mention to the Configuration file section in README. Depends on: microsoft/playwright#40025
Author
|
@microsoft-github-policy-service agree |
1ffb319 to
e631dfd
Compare
Auto-generate a JSON Schema (draft-07) from config.d.ts using the TypeScript compiler API. The schema covers all Config fields including recursively expanded LaunchOptions and BrowserContextOptions. - Add utils/generate_mcp_config_schema.js generator script - Output mcp-config.schema.json alongside config.d.ts - Register in build.js onChanges and flint for CI staleness checks - Add config-schema.spec.ts with structural assertion tests - Fix config.d.ts / configIni.ts drift: add saveTrace, remove dead saveVideo, add timeouts.expect to longhandTypes - Document $schema usage in getting-started-mcp.md and getting-started-cli.md
e631dfd to
b090074
Compare
Member
|
We discussed the approach with the team, and decided agains the JSON schema approach. Thanks for taking the time to contribute though! We'll see what we can do to give the config proper IDE support. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
config.d.tsusing the TypeScript compiler API, recursively expandingLaunchOptionsandBrowserContextOptionsutils/generate_mcp_config_schema.jsgenerator, integrated intobuild.jsandflintdescriptionis plain text per spec, and Markdown renders as raw syntax noise in editors that don't support itconfig.d.ts/configIni.tsdrift: add missingsaveTrace,outputMode; remove deadsaveVideo; addtimeouts.expecttolonghandTypes; fix/*→/**JSDoc; fiximageResponsesJSDoctests/mcp/config-schema.spec.tsincluding markdown stripping and drift detection$schemausage ingetting-started-mcp.mdandgetting-started-cli.mdHow to test
Use this temporary raw URL to try the schema in your config file before merge:
{ "$schema": "https://raw.githubusercontent.com/lennondotw/playwright/e631dfd1a/packages/playwright-core/src/tools/mcp/mcp-config.schema.json" }After merge, the canonical URL will be:
Related PRs