Repository navigation
Conversation
…-default}
pi-mcp-adapter accepts `directTools: "search"` on a server and in
`settings`, and expands `${NAME:-default}` in a server's env, headers,
url, paths and bearer token before it hashes the server for its
metadata cache. pi-subagents handled neither:
- Its config validator accepted only a boolean or a string array for
`directTools`, so it dropped a "search" server from the loaded config
and reported every `mcp:<server>/<tool>` selector for it as
unresolved. A runtime snapshot of such a server failed the same way.
- It expanded only `${NAME}`, so a server that used a default never
matched the adapter's cache key and its selectors stayed unresolved.
A url that used a default failed to parse, which failed the launch.
Accept "search" in both places. Selector resolution does not read
`directTools`, and the child's MCP_DIRECT_TOOLS selection overrides it
in the adapter, so "search" needs no other handling. Use the adapter's
`${NAME:-default}` pattern in interpolateEnvVars, and do not report a
variable with a default as missing from a server url.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EDUMG8NLFeCSk6tpjb3zGL
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EDUMG8NLFeCSk6tpjb3zGL
Contributor
[Medium impact] No code findings remain, but merge readiness still depends on confirming required CI on the exact PR head.
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EDUMG4v2dQau5mdNkRBFkw
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EDUMG4v2dQau5mdNkRBFkw
This branch has not been deployed
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.
pi-subagents reads the configuration and the metadata cache of pi-mcp-adapter to resolve
mcp:<server>/<tool>selectors. To do this, it must accept the same configuration values as the adapter and hash each server the same way. Two adapter behaviors left selectors unresolved for servers that work in the parent session.First, a server or the
settingsblock can setdirectTools: "search". The configuration validator accepted only a boolean or a string array, so it dropped such a server from the loaded configuration and reported every selector for it as unresolved. A runtime snapshot of such a server failed validation the same way.Second,
env,headers,url, paths, and the bearer token can contain${NAME:-default}. The adapter expands this value before it hashes a server for its metadata cache, and it uses the default only whenNAMEis unset, as Claude Code does in.mcp.json(see nicobailon/pi-mcp-adapter#878). pi-subagents expanded only${NAME}, so its hashes never matched the cachedconfigHashand the selectors stayed unresolved. A URL that used a default did not parse, and the launch failed.Changes
isMcpServerDefinitionandparseSettingsaccept"search". Selector resolution does not readdirectTools, and in the adapter the child'sMCP_DIRECT_TOOLSselection overrides it, so nothing else changes.interpolateEnvVarsuses the adapter's${NAME:-default}pattern, and a variable that has a default is no longer reported as missing from a server URL. Both functions now match the adapter'sutils.ts."search"server resolves its selectors. For variables with defaults inenv,headers, andurlthat are set, empty, or unset,computeMcpServerHashreturns the same hash as the adapter'scomputeServerHashwith the same environment.🤖 Generated with Claude Code
https://claude.ai/code/session_01EDUMG8NLFeCSk6tpjb3zGL