Add MCP servers from JSON configuration
If you have a JSON configuration for an MCP server, you can add it directly:
```bash theme=\{null\}
# Basic syntax
claude mcp add-json <name> '<json>'
# Example: Adding an HTTP server with JSON configuration
claude mcp add-json weather-api '\{"type":"http","url":"https://api.weather.com/mcp","headers":\{"Authorization":"Bearer token"}}'
# Example: Adding a stdio server with JSON configuration
claude mcp add-json local-weather '\{"type":"stdio","command":"/path/to/weather-cli","args":["--api-key","abc123"],"env":\{"CACHE_DIR":"/tmp"}}'
# Example: Adding an HTTP server with pre-configured OAuth credentials
claude mcp add-json my-server '\{"type":"http","url":"https://mcp.example.com/mcp","oauth":\{"clientId":"your-client-id","callbackPort":8080}}' --client-secret
```
```bash theme=\{null\}
claude mcp get weather-api
```
Tips:
- Make sure the JSON is properly escaped in your shell
- The JSON must conform to the MCP server configuration schema
- You can use
--scope userto add the server to your user configuration instead of the project-specific one