test(cli): add MCP client config regression coverage - #37
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7053b27c33
ℹ️ 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".
| assert(markdownJsonBlocks.length >= 3, "expected JSON snippets in MCP config examples"); | ||
| const parsedMarkdownConfigs = markdownJsonBlocks.map((block) => JSON.parse(block)); | ||
| assert( | ||
| parsedMarkdownConfigs.some((config) => getAgentbridgeServer(config).command === "npx"), |
There was a problem hiding this comment.
Filter non-config JSON blocks before MCP assertions
This validation treats every fenced json block in examples/mcp-client-config/README.md and examples/http-client-config/README.md as an MCP server config, so adding any unrelated JSON example (for instance a JSON-RPC payload) will make getAgentbridgeServer(...) throw and fail the check even though the MCP config snippets are still correct. That makes the regression gate brittle and can block doc updates unrelated to client config; parse the blocks, then only apply MCP-specific assertions to objects that actually contain mcpServers.agentbridge.
Useful? React with 👍 / 👎.
Summary
Adds regression coverage for MCP client configuration examples after the v0.4.0 HTTP transport release.
npm run validate:mcp-config-examplesto exercise the built CLImcp-configoutput against the checked-in examples.Context
Parallel safety
This PR does not touch SDK signing paths, core signing paths, manifest spec files, signed-manifest design docs, or MCP runtime files. It is examples/docs/test coverage around existing MCP client configuration shapes only.
Files added
packages/cli/src/tests/mcp-config-examples.test.tsscripts/validate-mcp-config-examples.mjsFiles modified
CHANGELOG.mdexamples/README.mdexamples/http-client-config/README.mdexamples/mcp-client-config/README.mdpackage.jsonpackages/cli/README.mdConfig formats covered
config.tomlblocks and checked-in TOML filesagentbridge mcp-configoutputValidation
npx vitest run packages/cli/src/tests— passed, 3 files / 32 testsnpm run typecheck:clean— passednpm test— passed, 21 files / 302 testsnpm run build— passednpm run pack:dry-run— passed, all packages OKnpm run validate:mcp-config-examples— passednpm run validate:examples— passednode packages/cli/dist/bin.js mcp-config— passed; includes stdio and HTTP blocks with placeholder auth onlySafety confirmations