Skip to main content
The openground install-mcp command generates and installs MCP (Model Context Protocol) server configuration for various AI agents.

Usage

Options

boolean
default:"false"
Automatically install to Claude Code using the claude CLI.Requirements: Claude Code CLI must be installed and available in PATH.
boolean
default:"false"
Automatically install to Cursor by modifying the MCP configuration file.Config Location:
  • macOS: ~/.cursor/mcp.json
  • Linux: ~/.cursor/mcp.json
  • Windows: %APPDATA%\Cursor\mcp.json
boolean
default:"false"
Automatically install to OpenCode by modifying the configuration file.Config Location: ~/.config/opencode/opencode.json
boolean
default:"false"
Generate WSL-compatible configuration (uses wsl.exe wrapper).Note: Only applicable when showing JSON output (no agent flag specified).

Behavior

Default (No Flags)

Shows the MCP configuration JSON that you can manually copy:
Output:

Automatic Installation

When using agent-specific flags, the command:
  1. Creates a backup of existing configuration (timestamped)
  2. Reads current configuration
  3. Adds/updates the openground entry
  4. Writes atomically to prevent corruption
  5. Validates the JSON

Safety Features

  • Backups: Creates timestamped backups before modifying config files
  • Validation: Validates JSON before writing
  • Atomic Writes: Uses temporary files to prevent corruption
  • Error Handling: Provides clear error messages and recovery instructions

Examples

Install to Claude Code

Output:
Requirements:

Install to Cursor

Output:

Install to OpenCode

Output:

Generate WSL Configuration

Output:

Configuration Formats

Claude Code

Uses the claude CLI:

Cursor

JSON format in ~/.cursor/mcp.json:

OpenCode

JSON format in ~/.config/opencode/opencode.json:

WSL (Windows Subsystem for Linux)

For running OpenGround in WSL from Windows:

Troubleshooting

Claude Code: ‘claude’ CLI Not Found

Error:
Solution:
  1. Install Claude Code CLI: https://code.claude.com/docs/en/cli
  2. Or use manual installation: openground install-mcp (without flags)

Invalid JSON in Config File

Error:
Solution:
  1. Fix the JSON syntax manually
  2. Or delete the file and reinstall: rm ~/.cursor/mcp.json && openground install-mcp --cursor

Permission Denied

Error:
Solution: Check file permissions:

After Installation

  1. Restart your agent (Claude Code, Cursor, or OpenCode)
  2. Verify installation:
    • Claude Code: claude mcp list
    • Cursor/OpenCode: Check MCP settings in the UI
  3. Test the connection:
    • Ask the agent to search your documentation
    • Example: “Search my OpenAI docs for authentication”