Client Auto-Installer

Configuring MCP servers manually by hunting down JSON configuration files on disk, copying absolute file paths, and formatting JSON strings is tedious and error-prone.

mcponce provides a built-in Client Auto-Installer that discovers your local AI client configuration files and configures your server in a single command.


1. Quick Installation from Server Script #

You can install any mcponce server directly using its own script:

node server.js install

Auto-configures both Claude Desktop and Cursor to run with --background mode.

Output:

✔ Configured "my-tools" in MCP client(s):

  claude: /Users/username/Library/Application Support/Claude/claude_desktop_config.json
    Command: node /Users/username/projects/agent/server.js --background

  cursor: /Users/username/Library/Application Support/Cursor/User/globalStorage/mcp.json
    Command: node /Users/username/projects/agent/server.js --background

2. Global CLI Installation (mcponce install) #

If using the global mcponce CLI, you can point to any local script file or registered server name:

BASH
# Install by script path
npx mcponce install ./server.ts claude

# Install from a registered central server
npx mcponce install my-agent cursor
TypeScript Auto-Detection

When targeting a .ts file (e.g. server.ts), the installer automatically configures npx tsx <path> --background so your server runs natively without requiring manual compilation.


3. Supported Clients & Configuration Paths #

The auto-installer automatically resolves paths according to your operating system:

ClientPlatformStandard Location
Claude DesktopmacOS~/Library/Application Support/Claude/claude_desktop_config.json
Windows%APPDATA%\Claude\claude_desktop_config.json
Linux~/.config/Claude/claude_desktop_config.json
Cursor (Global)macOS~/Library/Application Support/Cursor/User/globalStorage/mcp.json
Windows%APPDATA%\Cursor\User\globalStorage\mcp.json
Linux~/.config/Cursor/User/globalStorage/mcp.json
Cursor (Project)All<project-root>/.cursor/mcp.json (via --project)
Claude CodeAll~/.claude.json (global) or <project-root>/.mcp.json (--project)
CodexAll~/.codex/config.toml (global) or <project-root>/.codex/config.toml (--project)
VS CodeAllGlobal Code/User/globalStorage/mcp.json or <project-root>/.vscode/mcp.json
WindsurfAll~/.codeium/windsurf/mcp_config.json or <project-root>/.codeium/windsurf/mcp_config.json
AntigravityAll~/.gemini/antigravity-ide/mcp_config.json
Remote Streamable HTTP Installation

You can also install a remote HTTP MCP endpoint programmatically with installClientConfig({ client: 'codex', serverName: 'remote-api', url: 'https://mcp.example.com/mcp', headers: { Authorization: 'Bearer ...' } }). For Codex (config.toml), mcponce cleanly upserts or removes [mcp_servers.<name>] sections while preserving the rest of your TOML file.


4. Uninstalling Servers #

Remove a server from your client configuration with uninstall:

# Remove from all clients
node server.js uninstall

Remove from Claude Desktop only

node server.js uninstall claude


5. CLI Flags & Options #

FlagDescription
--dry-runPreview what would be written without modifying any files on disk.
--projectTarget the local workspace .cursor/mcp.json instead of global settings.
--no-backgroundDisables the default --background flag on the server command.
--config-path <path>Override target file with a custom config path.

6. Programmatic API #

You can also install or inspect client configurations programmatically in test suites or deployment scripts:

TYPESCRIPT
import {
  installClientConfig,
  uninstallClientConfig,
  getClientConfigPath
} from 'mcponce';

// Get config path for Claude Desktop on current OS
const claudePath = getClientConfigPath('claude');

// Programmatically install
const results = installClientConfig({
  serverName: 'custom-db-agent',
  entrypoint: './dist/server.js',
  client: 'all',
  background: true,
  env: {
    NODE_ENV: 'production',
    DB_PORT: '5432'
  }
});

// Programmatically remove
uninstallClientConfig({
  serverName: 'custom-db-agent',
  client: 'claude'
});
Updated