Repository navigation
fix(config): require a command on a local MCP server entry - #819
Merged
Ishaan Gangwani (ishaan1124) merged 4 commits intoSep 29, 2026
Conversation
ANIRUDDHA ADAK (aniruddhaadak80)
requested review from
Aayam Bansal (aayambansal) and
Ishaan Gangwani (ishaan1124)
as code owners
September 28, 2026 23:02
|
ANIRUDDHA ADAK (@aniruddhaadak80) is attempting to deploy a commit to the InkVell Team on Vercel. A member of the Team first needs to authorize it. |
ANIRUDDHA ADAK (aniruddhaadak80)
force-pushed
the
fix/mcp-command-empty-array
branch
from
September 29, 2026 04:56
b1b3040 to
83d42bf
Compare
z.string().array() accepts an empty list, and the connection is then launched from `const [cmd, ...args] = mcp.command`, so an entry with no command started a server with no executable. Reject it at the entry with an example instead.
ANIRUDDHA ADAK (aniruddhaadak80)
force-pushed
the
fix/mcp-command-empty-array
branch
from
September 29, 2026 10:56
83d42bf to
cf8c32c
Compare
The `minItems: 1` added to a local MCP server's `command` reaches the OpenAPI contract, and the compatibility job fails when the committed specification is not what the generator produces. `./tooling/repo/generate.ts` regenerates it; only `tooling/sdk/openapi.json` changes, by that one line.
…e config Putting .min(1) on McpLocal.command made one incomplete entry a config parse error, so the whole file stopped loading (CLI exit, config-error page) where before only that connector failed; and [""] still passed. Revert the schema and SDK change and check at launch instead: an empty command, or one whose program is blank, marks that server failed with a message naming it, without spawning anything. The CLI's `mcp add` prompt also no longer accepts a blank command or splits one into empty words. Co-authored-by: Cursor <cursoragent@cursor.com>
Member
|
I pushed one commit (bb7387b) on top of yours. |
# Conflicts: # CHANGELOG.md
Ishaan Gangwani (ishaan1124)
merged commit Sep 29, 2026
f0ff327
into
synthetic-sciences:main
8 of 9 checks passed
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.
What
Config.McpLocaldeclared the command asz.string().array(), which accepts an empty list:The connection is then started from
src/mcp/index.ts:918:With
command: [],cmdisundefined, so the launch is attempted withfile: undefined— a sandbox-wrapped spawn of nothing.Why it matters
An MCP entry with an empty
commandis a configuration mistake with no valid reading: there is no executable to run. It should be rejected where the mistake is, not converted into a spawn attempt that fails somewhere else in the MCP layer.McpRemotevalidates itsurlin the schema. A local server'scommandis the equivalent required field, and it is the only part of the entry with nothing to fall back on.Verification
test/config/mcp-command-schema.test.tsis new. Two of five fail before the fix:After:
The three pre-existing rejection cases are pinned alongside the new one so the constraint is known to be the length, not a change in how the element type is handled. The last test asserts the issue path mentions
command, so a silent skip is not a way to pass it.The change
command: z.string().array().describe("Command and arguments to run the MCP server"), + command: z + .string() + .array() + .min(1, 'A local MCP server needs a command to run, for example ["npx", "-y", "my-mcp-server"]') + .describe("Command and arguments to run the MCP server"),The message names the problem and shows a working example, matching the style of the other schema messages in this file.
On the surrounding suites
test/config/config.test.ts,test/config/mcp-secrets.test.tsandtest/mcp/were run before and after: 125 pass / 13 fail onmain, 124/14 with the change. The one extra failure isa resumed exact flow restarts its callback listener without creating a replacement, which passes 3/3 in isolation with the change applied and is pre-existing order-dependent flakiness: repeated runs of the wholetest/mcp/suite give 55 pass / 10 fail and then 56/9 — identically with and without the change.bun run typecheckclean; touched files are Prettier-clean (checked on LF-normalized copies — this checkout hascore.autocrlf=true, which makes Prettier flag every file in the repo).Fixes #818