MCP Hub
Back to servers

mcpx-cli

Interactive CLI to configure MCP servers for multiple AI providers

Stars
4
Forks
1
Updated
Feb 6, 2026
Validated
Feb 13, 2026

πŸ”Œ MCPX

One config to rule them all. Configure your MCP servers once, deploy to every AI CLI automatically.

Node.js TypeScript License: MIT


😩 The Problem

Each AI CLI tool uses a different file format for configuring MCP (Model Context Protocol) servers:

AI CLIConfig FileFormat
Claude Code.mcp.jsonJSON
Gemini CLI.gemini/settings.jsonJSON
Kimi CLI~/.kimi/mcp.jsonJSON
OpenAI Codex.codex/config.tomlTOML
OpenCodeopencode.jsonJSON
GitHub Copilot CLI.copilot/mcp-config.jsonJSON
VS Code.vscode/mcp.jsonJSON
IntelliJ IDEA.idea/mcp.jsonJSON

If you use multiple AI tools (and you probably do), you need to manually maintain 8 different config files with different structures, field names, and quirks. For every single project.


✨ The Solution

MCPX maintains a single canonical config file (.mcpx.json) per project and automatically generates the correct config file for each AI CLI provider you use.

.mcpx.json  ──────►  .mcp.json                     (Claude Code)
    β”‚       ──────►  .gemini/settings.json          (Gemini CLI)
    β”‚       ──────►  ~/.kimi/mcp.json               (Kimi CLI)
    β”‚       ──────►  .codex/config.toml             (OpenAI Codex)
    β”‚       ──────►  opencode.json                  (OpenCode)
    β”‚       ──────►  .copilot/mcp-config.json       (Copilot CLI)
    β”‚       ──────►  .vscode/mcp.json               (VS Code)
    └─────  ──────►  .idea/mcp.json                 (IntelliJ IDEA)

πŸš€ Quick Start

πŸ“¦ Installation

npm install -g mcpx-cli

⚑ First Setup

Navigate to your project directory and run:

mcpx

The interactive wizard will guide you through:

  1. πŸ” Detection β€” Automatically detects existing MCP configs in your project
  2. πŸ“₯ Import β€” Offers to import servers from detected configs
  3. βž• Add servers β€” Interactive wizard to configure new MCP servers
  4. 🎯 Select providers β€” Choose which AI CLIs you want to generate configs for
  5. βš™οΈ Generate β€” Creates .mcpx.json and all provider config files

πŸ“‹ Commands

CommandDescription
mcpx or mcpx initπŸ§™ Interactive setup wizard
mcpx add [name]βž• Add a new MCP server
mcpx remove [name]βž– Remove an MCP server
mcpx listπŸ“„ List configured MCP servers
mcpx syncπŸ”„ Regenerate all provider config files
mcpx import [provider]πŸ“₯ Import config from an existing provider
mcpx statusπŸ“Š Show sync status of all providers

🏳️ Global Flags

FlagDescription
--dir, -d <path>πŸ“ Project directory (defaults to current)
--verboseπŸ”Š Show detailed logs
--version, -V🏷️ Show version
--help, -h❓ Show help

πŸ“ Canonical Format

MCPX uses a single .mcpx.json file as the source of truth:

{
  "version": 1,
  "providers": ["claude-code", "gemini-cli", "openai-codex", "copilot-cli"],
  "servers": {
    "jira": {
      "description": "Jira Atlassian",
      "transport": "stdio",
      "command": "uvx",
      "args": ["mcp-atlassian"],
      "env": {
        "JIRA_URL": "https://myorg.atlassian.net",
        "JIRA_USERNAME": "user@example.com",
        "JIRA_API_TOKEN": "your-token"
      }
    },
    "github": {
      "description": "GitHub MCP Server",
      "transport": "stdio",
      "command": "npx",
      "args": ["-y", "@anthropic-ai/mcp-github-server"],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "ghp_xxx"
      }
    }
  }
}

πŸ“ Server Fields

FieldTypeRequiredDescription
transport"stdio" | "http"βœ… YesTransport protocol
commandstringstdioExecutable command
argsstring[]β€”Command arguments
envRecord<string, string>β€”Environment variables
cwdstringβ€”Working directory
urlstringhttpServer URL
headersRecord<string, string>β€”HTTP headers
descriptionstringβ€”Human-readable description
enabledbooleanβ€”Enable/disable (default: true)

πŸ€– Supported Providers

πŸ“ Project-Scoped Providers

These providers generate config files inside your project directory. Each project has its own independent config.

🟣 Claude Code

AspectDetail
File.mcp.json
FormatJSON
Root keymcpServers
Requires typeYes "stdio"

πŸ”΅ Gemini CLI

AspectDetail
File.gemini/settings.json
FormatJSON
Root keymcpServers
Requires typeNo

🟒 OpenAI Codex

AspectDetail
File.codex/config.toml
FormatTOML
Root keymcp_servers
Smart mergeYes β€” Preserves existing Codex settings (model, approval_mode, etc.)

🟠 OpenCode

AspectDetail
Fileopencode.json
FormatJSON
Root keymcp
Quirkscommand is an array (command + args merged), uses environment instead of env, type: "local"

⚫ GitHub Copilot CLI

AspectDetail
File.copilot/mcp-config.json
FormatJSON
Root keymcpServers
QuirksRequires tools: ["*"] field, needs shell alias for project-level config

πŸ“Œ Note: Copilot CLI does not natively auto-discover project-level MCP configs. MCPX automatically configures a shell alias (copilot='copilot --additional-mcp-config @.copilot/mcp-config.json') in your .zshrc, .bashrc, or config.fish so the project config is loaded automatically when you run copilot.

πŸ”· VS Code

AspectDetail
File.vscode/mcp.json
FormatJSON
Root keyservers
Quirkstype field required ("stdio" or "sse"), HTTP mapped as "sse"

🟧 IntelliJ IDEA

AspectDetail
File.idea/mcp.json
FormatJSON
Root keymcpServers
QuirksNo type field, infers from command vs url

🌍 Global Providers

These providers use a single global config file shared across all projects. Running mcpx sync overwrites the global file with the current project's servers.

πŸ”΄ Kimi CLI

AspectDetail
File~/.kimi/mcp.json
FormatJSON
Root keymcpServers
ScopeGlobal β€” affects all projects

πŸ”„ Sync & Provider Management

πŸ” Syncing

After modifying .mcpx.json (manually or via commands), regenerate all provider configs:

mcpx sync

πŸ”€ Changing Providers

Use the interactive wizard to add or remove providers:

mcpx init
# Select "Alterar providers"

When a provider is removed, MCPX deletes the corresponding config file. For global providers, legacy project-level files are also cleaned up.

πŸ“₯ Importing from Existing Configs

Already have MCP servers configured in one of your AI tools? Import them:

mcpx import

MCPX detects existing project-level configs (.mcp.json, .gemini/settings.json, etc.) and lets you select which servers to import into .mcpx.json.


πŸ—οΈ Architecture

src/
β”œβ”€β”€ cli.ts                    # Commander setup & routing
β”œβ”€β”€ types/
β”‚   β”œβ”€β”€ canonical.ts          # McpConfigFile, McpServerConfig (Zod schemas)
β”‚   β”œβ”€β”€ providers.ts          # Provider interface
β”‚   └── common.ts             # CommandContext, SyncResult
β”œβ”€β”€ commands/
β”‚   β”œβ”€β”€ init.ts               # Interactive wizard
β”‚   β”œβ”€β”€ add.ts / remove.ts    # Server management
β”‚   β”œβ”€β”€ list.ts / status.ts   # Display info
β”‚   β”œβ”€β”€ sync.ts               # Regenerate configs
β”‚   └── import.ts             # Import from providers
β”œβ”€β”€ providers/
β”‚   β”œβ”€β”€ base.ts               # Provider interface
β”‚   β”œβ”€β”€ registry.ts           # Provider registry (factory)
β”‚   β”œβ”€β”€ claude-code.ts        # .mcp.json
β”‚   β”œβ”€β”€ gemini-cli.ts         # .gemini/settings.json
β”‚   β”œβ”€β”€ kimi-cli.ts           # ~/.kimi/mcp.json
β”‚   β”œβ”€β”€ openai-codex.ts       # .codex/config.toml
β”‚   β”œβ”€β”€ opencode.ts           # opencode.json
β”‚   β”œβ”€β”€ copilot-cli.ts        # .copilot/mcp-config.json
β”‚   β”œβ”€β”€ vscode.ts             # .vscode/mcp.json
β”‚   └── intellij.ts           # .idea/mcp.json
β”œβ”€β”€ core/
β”‚   β”œβ”€β”€ config-store.ts       # .mcpx.json read/write
β”‚   β”œβ”€β”€ detector.ts           # Detect existing configs
β”‚   └── merger.ts             # Smart sync with merge support
β”œβ”€β”€ wizard/
β”‚   β”œβ”€β”€ main-wizard.ts        # Main interactive flow
β”‚   β”œβ”€β”€ server-wizard.ts      # Server creation wizard
β”‚   β”œβ”€β”€ provider-wizard.ts    # Provider selection
β”‚   └── step-runner.ts        # Step navigation (back support)
└── utils/
    β”œβ”€β”€ fs.ts                 # File system helpers
    β”œβ”€β”€ logger.ts             # Logger with colors
    └── validation.ts         # Zod validation

πŸ§ͺ Testing

# Run all tests
npm test

# Run once (CI)
npm run test:run

# Type checking
npm run typecheck

πŸ› οΈ Tech Stack

CategoryLibrary
πŸ’» LanguageTypeScript 5.x (ESM)
πŸ“¦ Buildtsup (esbuild)
⌨️ CLI Frameworkcommander
πŸ’¬ Interactive Prompts@clack/prompts
🎨 Colorspicocolors
πŸ“„ TOMLsmol-toml
βœ… Validationzod
πŸ§ͺ Testsvitest
🟒 Min Node>= 20

πŸ“„ License

MIT


πŸ‡§πŸ‡· Leia em PortuguΓͺs (pt-BR)

Reviews

No reviews yet

Sign in to write a review

mcpx-cli β€” MCP Server | MCP Hub