feat(config): support repeated --mcp-config flags#29
Draft
ghul0 wants to merge 2 commits intonicobailon:mainfrom
Draft
feat(config): support repeated --mcp-config flags#29ghul0 wants to merge 2 commits intonicobailon:mainfrom
ghul0 wants to merge 2 commits intonicobailon:mainfrom
Conversation
added 2 commits
March 30, 2026 12:22
Allow passing multiple MCP config files in a single invocation: pi -e ./index.ts --mcp-config a.json b.json pi -e ./index.ts --mcp-config a.json --mcp-config b.json Changes: - utils.ts: add getConfigPathsFromArgv() and parseConfigFlag() for multi-path argv parsing with tilde expansion - config.ts: loadMcpConfig() and getServerProvenance() accept string | string[] with ordered shallow merge (later file wins) - index.ts, init.ts, commands.ts: wire all call sites to use getConfigPathsFromArgv() for consistent repeated-flag support Merge strategy: - mcpServers: shallow merge by key, later file wins - settings: shallow merge, later wins - imports: union with dedup - project config (.pi/mcp.json) overrides all Missing/invalid files are skipped with a warning.
…Path param - index.ts: fix runtime error 'earlyConfigPath is not defined' in /mcp command - commands.ts: remove configOverridePath parameter from openMcpPanel() since it now reads argv internally via getConfigPathsFromArgv()
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.
Problem
The adapter only preserved a single
--mcp-configvalue end-to-end even though layered MCP configuration is useful for combining shared and project-specific definitions.Root Cause
The config loading path still treated
--mcp-configas a single string in key wiring points:/mcppanel wiring still relied on the stale single-path flowFix
--mcp-configflags from argv in orderloadMcpConfig()merge multiple config files in order before project-local overridesgetServerProvenance()track multiple user config sources/mcppanel wiring to usegetConfigPathsFromArgv()directly so repeated flags survive end-to-endSummary
getConfigPathsFromArgv()inutils.tsconfig.tsto accept multiple override paths for config loading and provenanceindex.ts,init.ts, andcommands.tsto use the repeated-flag path flowTesting
Targeted tests for this change
Maintainer note
upstream/maincurrently does not trackexamples/interactive-visualizer/dist/app.htmlordist/server.js, so the unrelated__tests__/interactive-visualizer-server.test.tsfails on a full-suite run before this PR's changes are involved.