This folder contains MCP setup utility and some scripts for Claude Desktop, ChatGPT/Codex CLI, and VS Code.
For the full repository script catalog (all non-MCP scripts included), see
../docs/scripts.md.
mcp/*.pyPython entry points and packaging metadata live at the top of themcpfolder.mcp/scripts/Shell, PowerShell, and cmd wrappers live here so platform scripts are kept separate from Python sources.mcp/src/opamp_mcp_config/Installable Python package implementation.
configure_mcp_clients.pyMenu-driven Python CLI that reads JSON defaults, supports source/package/python-env deployment modes, and can configure Claude, Codex, VS Code, LibreChat, and Gemini.build_mcp_config_tool.pyBuilds the installable MCP configuration CLI wheel/sdist, can pip install the wheel, and writes a CycloneDX SBOM for the deployable artifact.remove_legacy_mcp_scripts.cmdLocal Windows cleanup helper that can remove the legacy shell/PowerShell/cmd MCP configure wrappers after the Python CLI is available.
Wrappers forward arguments to the canonical script and only change defaults and naming compatibility. The Python CLI is the preferred path when you want a guided workflow or need targets beyond the legacy shell/PowerShell scripts.
The canonical shell/PowerShell script configures one or more targets from
claude, chatgpt, and vscode.
The Python CLI configures one or more targets from claude, codex,
vscode, librechat, and gemini.
- Claude Desktop:
writes
mcpServersentry in Claude config using remote transport:mcp-remote <http://host:port/sse>or fallbacknpx -y mcp-remote <http://host:port/sse>. - ChatGPT/Codex:
creates a stdio MCP entry via
codex mcp add ... uv run ... fastmcp run .... - VS Code:
generates/merges
.vscode/mcp.jsonserversentry using FastMCP JSON output. - LibreChat:
writes or merges an
mcpServersentry inlibrechat.yaml. - Gemini CLI:
writes or merges an
mcpServersentry in~/.gemini/settings.jsonor a configured settings path. - Legacy cleanup:
known old names (
OpAMP Server,opamp-server,opampServer) are removed except for the active configured name. - Validation:
options requiring values fail fast when missing (for example
--opamp-server-ipwithout a value).
FastMCP is used for local stdio-style MCP process wiring:
- Required for ChatGPT/Codex registration path (
fastmcp run ...). - Required for VS Code JSON generation path (
fastmcp install mcp-json ...). - Not required for Claude Desktop remote setup, because Claude uses
mcp-remoteto connect to the provider SSE endpoint.
In short:
- Claude path: remote transport (
mcp-remote). - ChatGPT/Codex and VS Code paths: local stdio tooling (
fastmcp+uv). - LibreChat and Gemini can use local stdio tooling or remote SSE entries, depending on the selected target transport.
The Python utility reads defaults from
mcp-client-defaults.json, opens a small menu,
and writes client configs from the selected values. Source-tree execution
defaults to repo-local source mode; the packaged wheel defaults to package
mode so installed entry points do not assume repository paths exist. The root
defaults file is the single checked-in source of truth; the build helper creates
a temporary packaged resource with deployment.mode set to package while
building the wheel/sdist.
Run the guided menu:
python3 mcp/configure_mcp_clients.pyIf installed from the wheel, use either entry point:
opamp-mcp-config
python3 -m opamp_mcp_configRun without prompts using defaults:
python3 mcp/configure_mcp_clients.py --yesPreview without writing:
python3 mcp/configure_mcp_clients.py --preview
python3 mcp/configure_mcp_clients.py --yes --dry-run --clients claude,codex,vscode,geminiSelect clients and provider endpoint:
python3 mcp/configure_mcp_clients.py --yes --clients claude,codex,vscode --server-host localhost --server-port 8080Use a wheel or pip package instead of repo source paths:
python3 mcp/configure_mcp_clients.py --yes --clients codex,vscode,gemini --deployment-mode package --package-spec dist/provider/opamp_server-0.4.0-py3-none-any.whlPackage mode uses uv run --with <package-or-wheel> --with fastmcp ... and
the import server spec opamp_provider.mcptool.routes:mcpserver. Source mode
uses the repo-local file spec under provider/src.
Build the MCP Python tool as a wheel and source distribution:
./mcp/scripts/build_mcp_config_tool.shPowerShell:
.\mcp\scripts\build_mcp_config_tool.ps1Windows cmd:
mcp\scripts\build_mcp_config_tool.cmdBy default the build writes:
- wheel and sdist artifacts under
dist/mcp/ - CycloneDX SBOM under
dist/sbom/opamp_mcp_config.cyclonedx.json
The canonical repo-side SBOM helper implementation lives in:
dev-tools/src/opamp_dev_tools/sbom.py
The MCP package vendors the helper under mcp/src/opamp_build_tools/ so the
standalone wheel remains self-contained after installation.
During the build, build_mcp_config_tool.py copies
mcp-client-defaults.json into the package resource area and changes only
deployment.mode to package. The generated resource is removed again after
the build, keeping the repository defaults file as the only committed copy.
Build and install the wheel into the current Python environment with pip:
./mcp/scripts/build_mcp_config_tool.sh --installUseful options:
--out-dir <path>: choose the wheel/sdist output directory.--sbom-path <path>: choose the SBOM output file.--skip-sbom: build artifacts without writing the SBOM.--no-clean: keep existingopamp_mcp_config-*build artifacts.--python <path>: choose the Python executable used for build and install.
After installation, run:
opamp-mcp-config --preview
opamp-mcp-config --yes --clients claude,codex,vscodeOnce configure_mcp_clients.py exists in this folder, or the packaged
opamp-mcp-config command is installed on PATH, the older target-specific
MCP configure wrappers are redundant.
Preview the files that would be removed:
mcp\remove_legacy_mcp_scripts.cmdDelete the legacy wrappers:
mcp\remove_legacy_mcp_scripts.cmd --yesThe cleanup script removes only the legacy configure wrappers:
configure-claude-desktop-fastmcp.*configure-codex-fastmcp.*configure-mcp-clients-fastmcp.*
It does not remove configure_mcp_clients.py, mcp-client-defaults.json, the
Python package files, or the build/SBOM scripts. Use --force only if you need
to remove wrappers before the replacement CLI can be detected.
The defaults file controls:
- provider host, port, scheme, and SSE path
- enabled client targets
- per-client server names and config paths
- remote versus stdio transport choices
- deployment mode:
source,package, orpython-env - package or wheel specs used by package deployment mode
claude: writesmcpServersin Claude Desktop config using remote SSE viamcp-remote.codex: runscodex mcp add ...with a generated stdio FastMCP command.vscode: writes.vscode/mcp.jsonusing the VS Codeserversschema.librechat: writesmcpServersinlibrechat.yaml; installPyYAMLif you need to merge an existing YAML file.gemini: writesmcpServersin Gemini CLIsettings.json.
To add another LLM client:
- Add default client settings under
clientsinmcp-client-defaults.json. - Add the client key to
SUPPORTED_CLIENTSinconfigure_mcp_clients.py. - Implement a small target class with
apply(settings, dry_run). - Register it in the
TARGETSmap.
Most new stdio clients can reuse build_stdio_server_entry(). Remote clients
can reuse build_remote_server_entry().
The opamp-cli project should treat opamp-mcp-config as the specialist MCP
configuration tool rather than duplicating this menu and client-specific logic.
Recommended detection order:
- Explicit command override from the user or config, for example an
OPAMP_MCP_CONFIG_COMMANDenvironment variable or futureopamp-clisetting. - Installed console script found on
PATH:opamp-mcp-config. - Installed Python module probe:
python -m opamp_mcp_config --preview. - Workspace fallback when running from source:
python mcp/configure_mcp_clients.py.
Recommended delegation behavior:
opamp-clikeeps the conversation context and detects MCP setup intent such as “configure MCP”, “set up Claude MCP”, or “add Gemini”.- Once intent is clear,
opamp-clilaunches the MCP tool in the same terminal for interactive mode, preserving stdin/stdout so the menu feels native. - For non-interactive flows,
opamp-clipasses explicit flags such as--yes,--clients,--server-host,--server-port,--deployment-mode, and--package-spec. - The MCP tool remains the owner of target schema knowledge, config file merge behavior, and source/package/python-env deployment command construction.
- If the tool is missing,
opamp-clishould explain the install/build command:python mcp/build_mcp_config_tool.py --install. - If the user explicitly says which tool to use,
opamp-clishould honor that command path before auto-detection.
This keeps opamp-cli as the conversational router and workflow shell, while
the MCP package stays independently testable, installable, and extendable for
future LLM clients.
The repository includes provider/uv.lock so uv run --project provider ...
resolves the same dependency graph across machines and over time.
This matters for MCP setup because ChatGPT/Codex and VS Code script paths depend
on uv + fastmcp execution consistency.
Benefits:
- reproducible installs and execution for MCP client registration
- fewer environment-specific breakages from transitive dependency drift
- better CI/local parity when validating MCP behavior
Always pass server host (and usually port) so scripts do not prompt:
- Bash:
--opamp-server-ip <host-or-ip>and optional--opamp-server-port <port> - PowerShell:
-OpAMPServerIp <host-or-ip>and optional-OpAMPServerPort <port>
These values set:
OPAMP_SERVER_IPOPAMP_SERVER_URL(http://<host-or-ip>:<port>, default8080)OPAMP_MCP_SSE_URL(http://<host-or-ip>:<port>/sse, default8080)
configure-claude-desktop-fastmcp wrapper:
--name/-Name: Claude display/server name (defaultOpAMP Server)--clients/-Clients: optional override target list (defaultclaude)--opamp-server-ip/-OpAMPServerIp: OpAMP server host/IP--opamp-server-port/-OpAMPServerPort: OpAMP server port (default8080)--server-spec/-ServerSpec: forwarded for compatibility (not used by Claude remote transport setup)--project/-Project: forwarded for compatibility--no-editable/-NoEditable: forwarded for compatibility--help/-Help: show usage
configure-codex-fastmcp wrapper:
--name/--server-name/-ServerName: ChatGPT/Codex server name (defaultopamp-server)--clients/-Clients: optional override target list (defaultchatgpt)--opamp-server-ip/-OpAMPServerIp: OpAMP server host/IP--opamp-server-port/-OpAMPServerPort: OpAMP server port (default8080)--server-spec/-ServerSpec: Python server spec passed tofastmcp run--project/-Project: project path used byuv run --project--no-editable/-NoEditable: skip--with-editable--help/-Help: show usage
configure-mcp-clients-fastmcp canonical script:
--clients/-Clients: comma-separated targets (claude,chatgpt,vscode)--claude-name/-ClaudeName: Claude entry name (defaultOpAMP Server)--chatgpt-name/--server-name/-ChatGPTName: Codex entry name (defaultopamp-server)--vscode-name/-VSCodeName: VS Code server key (defaultopampServer)--vscode-config/-VSCodeConfigPath: VS Code MCP config path (default.vscode/mcp.json)--claude-config(bash only): Claude config path override--server-spec/-ServerSpec: Python server spec passed tofastmcp run--project/-Project: project path used byuv run --project--opamp-server-ip/-OpAMPServerIp: OpAMP server host/IP--opamp-server-port/-OpAMPServerPort: OpAMP server port (default8080)--no-editable/-NoEditable: skip--with-editable-h/--help/-Help: show usage
PowerShell:
& ".\mcp\configure-claude-desktop-fastmcp.ps1" -OpAMPServerIp localhost -OpAMPServerPort 8080
& ".\mcp\configure-codex-fastmcp.ps1" -OpAMPServerIp localhost -OpAMPServerPort 8080
& ".\mcp\configure-mcp-clients-fastmcp.ps1" -Clients "claude,chatgpt" -OpAMPServerIp localhost -OpAMPServerPort 8080Bash:
./mcp/configure-claude-desktop-fastmcp.sh --opamp-server-ip localhost --opamp-server-port 8080
./mcp/configure-codex-fastmcp.sh --opamp-server-ip localhost --opamp-server-port 8080
./mcp/configure-mcp-clients-fastmcp.sh --clients claude,chatgpt --opamp-server-ip localhost --opamp-server-port 8080Python menu CLI:
python3 mcp/configure_mcp_clients.py --yes --clients claude,codex,vscode
python3 mcp/configure_mcp_clients.py --yes --clients librechat,gemini --deployment-mode package --package-spec opamp-server
opamp-mcp-config --yes --clients claude,codex,vscodeClaude Desktop (Windows):
Get-Content "$env:APPDATA\Claude\claude_desktop_config.json"Claude Desktop (Linux/macOS):
cat "${XDG_CONFIG_HOME:-$HOME/.config}/Claude/claude_desktop_config.json"Confirm mcpServers contains your configured server (default wrapper name: OpAMP Server) and that the command is mcp-remote (or npx with mcp-remote args).
ChatGPT/Codex CLI:
codex mcp list
codex mcp get opamp-serverVS Code (only when using the canonical multi-client script with vscode target):
cat .vscode/mcp.jsonLibreChat:
cat librechat.yamlGemini CLI:
cat ~/.gemini/settings.json- Script catalog:
../docs/scripts.md - Auth and MCP bearer-token behavior:
../docs/authentication.md - Endpoint definitions (
/sse,/messages,/mcp):../docs/endpoints.md - LibreChat MCP server config reference: https://www.librechat.ai/docs/configuration/librechat_yaml/object_structure/mcp_servers
- Gemini CLI MCP server config reference: https://github.com/google-gemini/gemini-cli/blob/main/docs/tools/mcp-server.md