MCP server for querying the OpenCage geocoding API from within LLMs
Setup
Choose your client, copy the config, then fill in any required environment variables.
claude mcp add opencage-geocoding --env YOUR_API_KEY='<YOUR_API_KEY>' --env OPENCAGE_API_KEY='<OPENCAGE_API_KEY>' -- npx -y @opencage/mcp-opencage-server~/.codex/config.toml
[mcp_servers.opencage-geocoding]
command = "npx"
args = ["-y", "@opencage/mcp-opencage-server"]
env = { YOUR_API_KEY = "<YOUR_API_KEY>", OPENCAGE_API_KEY = "<OPENCAGE_API_KEY>" }
# codex mcp add opencage-geocoding --env YOUR_API_KEY='<YOUR_API_KEY>' --env OPENCAGE_API_KEY='<OPENCAGE_API_KEY>' -- npx -y @opencage/mcp-opencage-server~/.cursor/mcp.json
{
"mcpServers": {
"opencage-geocoding": {
"command": "npx",
"args": [
"-y",
"@opencage/mcp-opencage-server"
],
"env": {
"YOUR_API_KEY": "<YOUR_API_KEY>",
"OPENCAGE_API_KEY": "<OPENCAGE_API_KEY>"
}
}
}
}.vscode/mcp.json
{
"servers": {
"opencage-geocoding": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@opencage/mcp-opencage-server"
],
"env": {
"YOUR_API_KEY": "<YOUR_API_KEY>",
"OPENCAGE_API_KEY": "<OPENCAGE_API_KEY>"
}
}
}
}~/.gemini/settings.json
{
"mcpServers": {
"opencage-geocoding": {
"command": "npx",
"args": [
"-y",
"@opencage/mcp-opencage-server"
],
"env": {
"YOUR_API_KEY": "<YOUR_API_KEY>",
"OPENCAGE_API_KEY": "<OPENCAGE_API_KEY>"
}
}
}
}claude_desktop_config.json
{
"mcpServers": {
"opencage-geocoding": {
"command": "npx",
"args": [
"-y",
"@opencage/mcp-opencage-server"
],
"env": {
"YOUR_API_KEY": "<YOUR_API_KEY>",
"OPENCAGE_API_KEY": "<OPENCAGE_API_KEY>"
}
}
}
}.trae/mcp.json
{
"mcpServers": {
"opencage-geocoding": {
"command": "npx",
"args": [
"-y",
"@opencage/mcp-opencage-server"
],
"env": {
"YOUR_API_KEY": "<YOUR_API_KEY>",
"OPENCAGE_API_KEY": "<OPENCAGE_API_KEY>"
}
}
}
}Environment variables
YOUR_API_KEYOPENCAGE_API_KEY
Replace the placeholders with your own credentials and keep them out of version control.