MCP mcp-server-entity resolution scoped to the bound executor
Part of design: #1432 — per-component-executor-binding
Design document: https://github.com/JoshuaRowePhantom/Phantom.Workspaces/blob/design/docs/design/per-component-executor-binding.md
Scope
When a tool id is mcp-server-entity, evaluate the search prefixes (machine profile → ${USER}/mcp-servers → defaults/mcp-servers) against the bound executor's profile/user context instead of the resolving instance's.
Files
The mcp-server-entity resolution code — Phantom.Workspaces/McpServerEntityToolResourceFactory.cs (the IToolResourceFactory that implements the documented prefix search).
Detailed design
Requirement 8 — Entity resolution scoped to bound executor. mcp-server-entity resource resolution MUST resolve in the context of the tool's bound executor (search order: machine profile → ${USER}/mcp-servers → defaults/mcp-servers), not the resolving instance.
Verified starting state (evidence). McpServerEntityToolResourceFactory(IDataAccessLayer dataAccessLayer, IReadOnlyList<EntityName> searchPrefixes) (Phantom.Workspaces/McpServerEntityToolResourceFactory.cs:21-113) already searches an ordered list of prefixes — ResolveToolResourceAsync iterates this.searchPrefixes, appends the resource name to each prefix, and returns the first match (:45-67, TryGetMcpServerConfigAsync at :69-96). So "highest priority first" is already the contract; this issue makes the prefix list itself reflect the BOUND executor's machine, so the remote machine's profile prefix is FIRST.
Cohesion seam — the remote MCP host handler (from #1438) MUST use this scoped resolver
The production remote MCP host handler added in #1438 (RemoteMcpHostHandler.OpenAsync, registered on the production McpTransportListener in WorkspacesTransportComposition) resolves the MCP tool config on the remote host by calling McpServerEntityToolResourceFactory(IDataAccessLayer, IReadOnlyList<EntityName> searchPrefixes) with the bound executor's machine prefix FIRST — search order: machine profile → ${USER}/mcp-servers → defaults/mcp-servers. This item owns constructing that scoped searchPrefixes list (bound machine first) and threading the bound-executor context into resolution so the lookup uses the bound executor's profile/user context, not the resolving instance's.
#1438 ↔ #1439 touchpoint (make explicit)
This is a two-way touchpoint, not a change to the dependency direction:
Gap addressed: G5 — MCP mcp-server-entity resolution is not scoped to the bound executor's profile→user→defaults context.
Data flow (Commit 7):
12. When a tool's id is mcp-server-entity, the search prefixes (machine profile → ${USER}/mcp-servers → defaults/mcp-servers) are evaluated against the bound executor's profile/user context, not the resolving instance's — including when resolution happens inside #1438's remote host handler.
Tests
McpServerEntityBoundExecutorResolutionTests (Phantom.Workspaces.Llm.Core.Tests)
Testing strategy — MCP entity resolution scoped to bound executor: Resolves against the bound executor's machine profile first, then ${USER}/mcp-servers, then defaults/mcp-servers; correct fallback order; uses the bound executor's context, not the resolving instance's; and the remote-host-handler path (#1438) exercises the same machine-prefix-first ordering. → McpServerEntityBoundExecutorResolutionTests.
Dependencies
Depends on: #1438 — Per-tool MCP execution over transport + production remote MCP host (provides the RemoteMcpHostHandler / production McpTransportListener shell this scoped resolver is consumed by).
Touchpoint with #1438 — #1438's remote host handler CONSUMES this item's scoped McpServerEntityToolResourceFactory (machine prefix first). Two-way seam; dependency direction unchanged.
MCP
mcp-server-entityresolution scoped to the bound executorPart of design: #1432 — per-component-executor-binding
Design document: https://github.com/JoshuaRowePhantom/Phantom.Workspaces/blob/design/docs/design/per-component-executor-binding.md
Scope
When a tool
idismcp-server-entity, evaluate the search prefixes (machine profile →${USER}/mcp-servers→defaults/mcp-servers) against the bound executor's profile/user context instead of the resolving instance's.Files
The
mcp-server-entityresolution code —Phantom.Workspaces/McpServerEntityToolResourceFactory.cs(theIToolResourceFactorythat implements the documented prefix search).Detailed design
Requirement 8 — Entity resolution scoped to bound executor.
mcp-server-entityresource resolution MUST resolve in the context of the tool's bound executor (search order: machine profile →${USER}/mcp-servers→defaults/mcp-servers), not the resolving instance.Verified starting state (evidence).
McpServerEntityToolResourceFactory(IDataAccessLayer dataAccessLayer, IReadOnlyList<EntityName> searchPrefixes)(Phantom.Workspaces/McpServerEntityToolResourceFactory.cs:21-113) already searches an ordered list of prefixes —ResolveToolResourceAsynciteratesthis.searchPrefixes, appends the resource name to each prefix, and returns the first match (:45-67,TryGetMcpServerConfigAsyncat:69-96). So "highest priority first" is already the contract; this issue makes the prefix list itself reflect the BOUND executor's machine, so the remote machine's profile prefix is FIRST.Cohesion seam — the remote MCP host handler (from #1438) MUST use this scoped resolver
The production remote MCP host handler added in #1438 (
RemoteMcpHostHandler.OpenAsync, registered on the productionMcpTransportListenerinWorkspacesTransportComposition) resolves the MCP tool config on the remote host by callingMcpServerEntityToolResourceFactory(IDataAccessLayer, IReadOnlyList<EntityName> searchPrefixes)with the bound executor's machine prefix FIRST — search order: machine profile →${USER}/mcp-servers→defaults/mcp-servers. This item owns constructing that scopedsearchPrefixeslist (bound machine first) and threading the bound-executor context into resolution so the lookup uses the bound executor's profile/user context, not the resolving instance's.#1438 ↔ #1439 touchpoint (make explicit)
This is a two-way touchpoint, not a change to the dependency direction:
McpTransportListenerregistration,RemoteMcpHostHandler(steps a–e), and theMcpChannelClientTransportbridge. Its handler step (b) calls into the scoped resolver.mcp-server-entityresolution scoped to the bound executor #1439 (this item) delivers the scoped search-prefix wiring: building thesearchPrefixeswith the bound machine profile first and resolving in the bound executor's context.mcp-server-entityresolution scoped to the bound executor #1439's resolver semantics. [per-component-executor] - MCPmcp-server-entityresolution scoped to the bound executor #1439 remains depends-on [per-component-executor] - Per-tool MCP execution over transport + production remote MCP host #1438 (it needs the transport/host shell to run against); [per-component-executor] - Per-tool MCP execution over transport + production remote MCP host #1438 documents that it consumes this resolver. The dependency edges are unchanged.Gap addressed: G5 — MCP
mcp-server-entityresolution is not scoped to the bound executor's profile→user→defaults context.Data flow (Commit 7):
12. When a tool's
idismcp-server-entity, the search prefixes (machine profile →${USER}/mcp-servers→defaults/mcp-servers) are evaluated against the bound executor's profile/user context, not the resolving instance's — including when resolution happens inside #1438's remote host handler.Tests
McpServerEntityBoundExecutorResolutionTests(Phantom.Workspaces.Llm.Core.Tests)Resolve_BoundExecutorMachineProfile_WinsOverUserAndDefaultsResolve_FallsBackThroughUserThenDefaultsResolve_UsesBoundExecutorContext_NotResolvingInstanceResolve_ViaRemoteHostHandler_UsesMachinePrefixFirst— ([per-component-executor] - Per-tool MCP execution over transport + production remote MCP host #1438 touchpoint) when invoked through [per-component-executor] - Per-tool MCP execution over transport + production remote MCP host #1438'sRemoteMcpHostHandler, thesearchPrefixesplace the bound machine's profile ahead of${USER}/mcp-serversanddefaults/mcp-servers.Testing strategy — MCP entity resolution scoped to bound executor: Resolves against the bound executor's machine profile first, then
${USER}/mcp-servers, thendefaults/mcp-servers; correct fallback order; uses the bound executor's context, not the resolving instance's; and the remote-host-handler path (#1438) exercises the same machine-prefix-first ordering. →McpServerEntityBoundExecutorResolutionTests.Dependencies
Depends on: #1438 — Per-tool MCP execution over transport + production remote MCP host (provides the
RemoteMcpHostHandler/ productionMcpTransportListenershell this scoped resolver is consumed by).Touchpoint with #1438 — #1438's remote host handler CONSUMES this item's scoped
McpServerEntityToolResourceFactory(machine prefix first). Two-way seam; dependency direction unchanged.