Skip to content

fix(mcp): point generated mcp config at the @pandacss/dev binary#3563

Open
Adebesin-Cell wants to merge 2 commits into
chakra-ui:mainfrom
Adebesin-Cell:fix/mcp-npx-command
Open

fix(mcp): point generated mcp config at the @pandacss/dev binary#3563
Adebesin-Cell wants to merge 2 commits into
chakra-ui:mainfrom
Adebesin-Cell:fix/mcp-npx-command

Conversation

@Adebesin-Cell

Copy link
Copy Markdown
Collaborator

what

panda init-mcp generated a server config that runs npx panda mcp. that command can't run: panda is an unrelated package on npm with no bin. the generated config now runs npx -y --package @pandacss/dev panda mcp.

why

AI clients spawn the generated command to start the mcp server. with npx panda mcp they fail with could not determine executable to run, so the server never starts. came in as a user report. bunx panda mcp fails the same way.

notes

  • the same args work under bunx. npx ships with node, so pnpm/yarn users still get a runnable command without per-manager handling.
  • this is the npx half of the report. the other half (config loading throwing Please pass in filename to use require under bun) is a separate bundle-n-require/node-eval issue and is not in this PR.

test plan

  • pnpm test packages/mcp (new clients.test.ts, 2 tests)
  • npx -y --package @pandacss/dev panda mcp resolves the binary in a clean dir (only fails on the missing config, as expected)
  • bunx --package @pandacss/dev panda mcp and pnpm --package=@pandacss/dev dlx panda mcp resolve too; npx panda mcp / bunx panda mcp reproduce the original failure

`panda init-mcp` wrote a config that runs `npx panda mcp`, but `panda` is an
unrelated package on npm with no bin, so AI clients failed to start the
server with "could not determine executable to run" (`bunx panda mcp` hits
the same).

generate `npx -y --package @pandacss/dev panda mcp` instead. it resolves the
right binary and falls back to the local install when one is present.
@changeset-bot

changeset-bot Bot commented Jun 4, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 6acc2be

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 24 packages
Name Type
@pandacss/mcp Patch
@pandacss/dev Patch
@pandacss/astro-plugin-studio Patch
@pandacss/config Patch
@pandacss/core Patch
@pandacss/extractor Patch
@pandacss/generator Patch
@pandacss/is-valid-prop Patch
@pandacss/logger Patch
@pandacss/node Patch
@pandacss/parser Patch
@pandacss/plugin-lightningcss Patch
@pandacss/plugin-svelte Patch
@pandacss/plugin-vue Patch
@pandacss/postcss Patch
@pandacss/preset-atlaskit Patch
@pandacss/preset-base Patch
@pandacss/preset-open-props Patch
@pandacss/preset-panda Patch
@pandacss/reporter Patch
@pandacss/shared Patch
@pandacss/studio Patch
@pandacss/token-dictionary Patch
@pandacss/types Patch

Not sure what this means? Click here to learn what changesets are.

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

@vercel

vercel Bot commented Jun 4, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
panda-docs Ready Ready Preview Jun 4, 2026 7:28pm

Request Review

@vercel

vercel Bot commented Jun 4, 2026

Copy link
Copy Markdown

@Adebesin-Cell is attempting to deploy a commit to the Chakra UI Team on Vercel.

A member of the Team first needs to authorize it.

the mcp server reads its config from cwd, and clients don't reliably spawn it
in the project. set `cwd` on the generated server entry to the project dir so
the config is always found, instead of relying on a client-specific env var.
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.

1 participant