feat(codex): support user-configured MCP servers in remote sessions (#1789)

* feat(codex): load user MCP servers in HAPI sessions

* feat(codex): proxy Windows MCP command shims

* fix(codex): address MCP review feedback

* fix(codex): use HAPI-owned MCP proxy

* fix(codex): preserve Windows MCP argv boundaries

* fix(codex): keep remote MCP placement unchanged
This commit is contained in:
Ananovo
2026-09-09 09:26:43 +08:00
committed by GitHub
parent 66ea35963e
commit 5c5c8b3a9f
18 changed files with 941 additions and 13 deletions
@@ -102,6 +102,40 @@ describe('appServerConfig', () => {
});
});
it('preserves user MCP transport fields when building thread config', () => {
const params = buildThreadStartParams({
cwd: '/workspace/project',
mode: { permissionMode: 'default', collaborationMode: 'default' },
mcpServers: {
'package-manager': {
command: 'uvx',
args: ['example-mcp', 'serve'],
env: { EXAMPLE_TOKEN: 'from-process-environment' }
},
remote: {
url: 'https://example.test/mcp',
bearer_token_env_var: 'REMOTE_MCP_TOKEN'
},
hapi: {
command: 'node',
args: ['mcp']
}
}
});
expect(params.config).toMatchObject({
'mcp_servers.package-manager': {
command: 'uvx',
args: ['example-mcp', 'serve'],
env: { EXAMPLE_TOKEN: 'from-process-environment' }
},
'mcp_servers.remote': {
url: 'https://example.test/mcp',
bearer_token_env_var: 'REMOTE_MCP_TOKEN'
}
});
});
it('ignores CLI overrides when permission mode is not default', () => {
const params = buildThreadStartParams({
cwd: '/workspace/project',