Skip to content

test(mcp-proxy): add proxied tool coverage#272

Draft
huang-julien wants to merge 1 commit into
mainfrom
test/mcpè_proxy_tools_list_test

Hidden character warning

The head ref may contain hidden characters: "test/mcp\u00e8_proxy_tools_list_test"
Draft

test(mcp-proxy): add proxied tool coverage#272
huang-julien wants to merge 1 commit into
mainfrom
test/mcpè_proxy_tools_list_test

Conversation

@huang-julien

Copy link
Copy Markdown
Contributor

Adds upstream-coverage.test.ts, which guards that the proxy's hand-maintained tool catalog stays in sync with the upstream Storybook MCP packages.

Copilot AI review requested due to automatic review settings June 4, 2026 13:00
@netlify

netlify Bot commented Jun 4, 2026

Copy link
Copy Markdown

Deploy Preview for storybook-mcp-self-host-example canceled.

Name Link
🔨 Latest commit 449bfde
🔍 Latest deploy log https://app.netlify.com/projects/storybook-mcp-self-host-example/deploys/6a2176d9503c7900085323e4

@changeset-bot

changeset-bot Bot commented Jun 4, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 449bfde

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@pkg-pr-new

pkg-pr-new Bot commented Jun 4, 2026

Copy link
Copy Markdown
npx https://pkg.pr.new/storybookjs/mcp/@storybook/addon-mcp@272
npx https://pkg.pr.new/storybookjs/mcp/@storybook/mcp@272
npx https://pkg.pr.new/storybookjs/mcp/@storybook/mcp-proxy@272

commit: 449bfde

@codecov

codecov Bot commented Jun 4, 2026

Copy link
Copy Markdown

Bundle Report

Bundle size has no change ✅

@codecov

codecov Bot commented Jun 4, 2026

Copy link
Copy Markdown

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
651 1 650 1
View the top 1 failed test(s) by shortest run time
packages/mcp-proxy/src/tools/upstream-coverage.test.ts > proxy upstream tool coverage > registers every upstream tool that is not explicitly excluded
Stack Traces | 0.0261s run time
AssertionError: Upstream tool(s) ["get-stories-by-component"] are not registered in the proxy. Add them in src/tools/index.ts (and duplicate their schema in shared.ts), or add them to INTENTIONALLY_NOT_PROXIED with a reason.: expected [ 'get-stories-by-component' ] to deeply equal []

- Expected
+ Received

- []
+ [
+   "get-stories-by-component",
+ ]

 ❯ src/tools/upstream-coverage.test.ts:62:5

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a new Vitest suite in mcp-proxy to ensure the proxy’s hand-maintained tool registry stays synchronized with tool names exported by the upstream @storybook/mcp and @storybook/addon-mcp packages.

Changes:

  • Added upstream-coverage.test.ts to assert the proxy registers all upstream tools (with explicit allow/deny lists).
  • Added workspace devDependencies on @storybook/mcp and @storybook/addon-mcp for mcp-proxy tests.
  • Added a root tsconfig.json path alias to import addon tool-name constants from source.

Reviewed changes

Copilot reviewed 2 out of 4 changed files in this pull request and generated 1 comment.

File Description
tsconfig.json Adds a TS path alias for @storybook/addon-mcp/tool-names so tests can import tool name constants.
packages/mcp-proxy/src/tools/upstream-coverage.test.ts New test that compares proxied tool names vs upstream exported tool-name constants.
packages/mcp-proxy/package.json Adds upstream packages as devDependencies for the new test.
packages/mcp-proxy/pnpm-lock.yaml Updates package lockfile to reflect the new devDependencies.
Files not reviewed (1)
  • packages/mcp-proxy/pnpm-lock.yaml: Language not supported

Comment on lines +8 to +13
/** Pull every exported `*_TOOL_NAME` string constant out of a module namespace. */
function toolNamesOf(mod: Record<string, unknown>): string[] {
return Object.entries(mod)
.filter(([key, value]) => key.endsWith('TOOL_NAME') && typeof value === 'string')
.map(([, value]) => value as string);
}
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.

2 participants