mirror of
https://github.com/wu736139669/hapi.git
synced 2026-11-08 01:43:07 +00:00
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:
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user