关于地区天气查询的mcp server
Setup
Choose your client, copy the config, then fill in any required environment variables.
claude mcp add weather --env OPENWEATHER_API_KEY='<OPENWEATHER_API_KEY>' -- npx @chenxming/mcp-weather-server~/.codex/config.toml
[mcp_servers.weather]
command = "npx"
args = ["@chenxming/mcp-weather-server"]
env = { OPENWEATHER_API_KEY = "<OPENWEATHER_API_KEY>" }
# codex mcp add weather --env OPENWEATHER_API_KEY='<OPENWEATHER_API_KEY>' -- npx @chenxming/mcp-weather-server~/.cursor/mcp.json
{
"mcpServers": {
"weather": {
"command": "npx",
"args": [
"@chenxming/mcp-weather-server"
],
"env": {
"OPENWEATHER_API_KEY": "<OPENWEATHER_API_KEY>"
}
}
}
}.vscode/mcp.json
{
"servers": {
"weather": {
"type": "stdio",
"command": "npx",
"args": [
"@chenxming/mcp-weather-server"
],
"env": {
"OPENWEATHER_API_KEY": "<OPENWEATHER_API_KEY>"
}
}
}
}~/.gemini/settings.json
{
"mcpServers": {
"weather": {
"command": "npx",
"args": [
"@chenxming/mcp-weather-server"
],
"env": {
"OPENWEATHER_API_KEY": "<OPENWEATHER_API_KEY>"
}
}
}
}claude_desktop_config.json
{
"mcpServers": {
"weather": {
"command": "npx",
"args": [
"@chenxming/mcp-weather-server"
],
"env": {
"OPENWEATHER_API_KEY": "<OPENWEATHER_API_KEY>"
}
}
}
}.trae/mcp.json
{
"mcpServers": {
"weather": {
"command": "npx",
"args": [
"@chenxming/mcp-weather-server"
],
"env": {
"OPENWEATHER_API_KEY": "<OPENWEATHER_API_KEY>"
}
}
}
}Environment variables
OPENWEATHER_API_KEY
Replace the placeholders with your own credentials and keep them out of version control.