Content
# Weather Query MCP Service
This is a simple Weather Query MCP (Model Completion Plugin) service that allows you to check the weather conditions of cities around the world through the Cursor AI assistant.
## Prerequisites
1. Register and obtain an OpenWeatherMap API key:
- Visit the [OpenWeatherMap](https://openweathermap.org/) website
- Sign up for a free account
- Get your API key
2. Configure environment variables:
- Locate the `.env` file in the root directory of the project
- Fill in your API key as `OPENWEATHER_API_KEY=your_api_key_here`
## Running Locally
1. Install dependencies:
```
npm install
```
2. Start the service:
```
npm start
```
Or use development mode (auto-restart):
```
npm run dev
```
3. The service will run at http://localhost:3001
- MCP Manifest: http://localhost:3001/mcp-manifest.json
- OpenAPI Specification: http://localhost:3001/openapi.json
## Deploying to the Public
To allow Cursor to use this MCP service, you need to deploy it to a publicly accessible address. Here are a few simple methods:
### Using ngrok for Temporary Public Access (for Development Testing)
1. Install ngrok:
- Visit [ngrok.com](https://ngrok.com/) to register and download
- Set up ngrok according to the official guide
2. Start your service locally:
```
npm start
```
3. In another terminal window, start ngrok:
```
ngrok http 3001
```
4. ngrok will provide a public URL (e.g., `https://abc123.ngrok.io`)
- Use this URL to configure the MCP service in Cursor
### Deploying to Render.com (Free Plan)
1. Register for a [Render.com](https://render.com/) account
2. Create a new Web Service:
- Connect your GitHub repository
- Set the build command: `npm install`
- Set the start command: `npm start`
- Add the environment variable: `OPENWEATHER_API_KEY`
3. Once deployed, Render will provide a URL similar to `https://your-service-name.onrender.com`
- Use this URL to configure the MCP service in Cursor
## Configuring MCP Service in Cursor
1. Open the Cursor editor
2. Click on the settings icon
3. Select "MCP Service"
4. Click "Add MCP Service"
5. Enter your MCP manifest URL (e.g., `https://your-service.onrender.com/mcp-manifest.json`)
6. Save the settings
Now you can query the weather through the Cursor AI assistant, for example:
- "What's the weather like in Beijing today?"
- "Check the temperature in Shanghai"
- "What's the current weather in New York?"
## API Usage
If you want to call the API directly, you can use the following endpoint:
```
GET /weather?city={city_name}
```
Example response:
```json
{
"city": "北京",
"temperature": 25.6,
"description": "Sunny",
"humidity": 45,
"wind_speed": 5.7
}
```
## License
MIT
Connection Info
You Might Also Like
awesome-mcp-servers
A collection of MCP servers.
git
A Model Context Protocol server for Git automation and interaction.
Appwrite
Build like a team of hundreds
TrendRadar
TrendRadar: Your hotspot assistant for real news in just 30 seconds.
oh-my-opencode
Background agents · Curated agents like oracle, librarians, frontend...
chatbox
User-friendly Desktop Client App for AI Models/LLMs (GPT, Claude, Gemini, Ollama...)