Skip to content

Commit b2e6103

Browse files
author
LittleCoinCoin
committed
feat(mcp-models): map shared tool filtering flags to Codex
Added mapping in MCPServerConfigCodex.from_omni() to convert shared CLI tool filtering flags to Codex-specific field names: - includeTools -> enabled_tools - excludeTools -> disabled_tools This allows Codex to share the same --include-tools and --exclude-tools CLI arguments as Gemini, improving CLI consistency across hosts.
1 parent c2dde46 commit b2e6103

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

hatch/mcp_host_config/models.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,13 @@ def from_omni(cls, omni: 'MCPServerConfigOmni') -> 'MCPServerConfigCodex':
630630
supported_fields = set(cls.model_fields.keys())
631631
codex_data = omni.model_dump(include=supported_fields, exclude_unset=True)
632632

633+
# Map shared CLI tool filtering flags (Gemini naming) to Codex naming.
634+
# This lets `--include-tools/--exclude-tools` work for both Gemini and Codex.
635+
if getattr(omni, 'includeTools', None) is not None and codex_data.get('enabled_tools') is None:
636+
codex_data['enabled_tools'] = omni.includeTools
637+
if getattr(omni, 'excludeTools', None) is not None and codex_data.get('disabled_tools') is None:
638+
codex_data['disabled_tools'] = omni.excludeTools
639+
633640
# Map universal 'headers' to Codex 'http_headers'
634641
if hasattr(omni, 'headers') and omni.headers is not None:
635642
codex_data['http_headers'] = omni.headers

0 commit comments

Comments
 (0)