Overview
What is MCP Servers 项目?
A collection of services built on the Model Context Protocol (MCP) to support smart features in Cursor IDE. It currently includes an example (demo) service and a weather service, each following a three‑layer architecture (config, controllers, service).
How to use MCP Servers 项目?
Clone the repository, run npm install, then build all services with npm run build or individual services with npm run build:weather / npm run build:demo. Configure the MCP by editing ~/.cursor/mcp.json with the appropriate command, args, and env (e.g., OPENWEATHER_API_KEY). Start a service with npm run start:weather or npm run start:demo.
Key features of MCP Servers 项目
- Three‑layer architecture: config, controllers, and service layers.
- Modular structure with separate directories for each service.
- Demo service for learning MCP service development.
- Weather service with real‑time queries and 5‑day forecasts.
- Support for multi‑city weather queries.
- TypeScript – strong typing and source maps for debugging.
Use cases of MCP Servers 项目
- Learning how to build MCP services for Cursor IDE by studying the demo service.
- Retrieving current weather and 5‑day forecast for one or multiple cities.
- Extending the collection by creating new services following the provided template.
FAQ from MCP Servers 项目
Service won’t start. What should I check?
Check for port conflicts, confirm environment variables are set, and verify the build output.
API calls are failing. What can I do?
Ensure your API key is correctly configured, verify network connectivity, and review error logs.
Cursor IDE can’t recognize the service. How to fix?
Check the MCP configuration file (~/.cursor/mcp.json), restart Cursor IDE, and confirm the service is running.
What are the runtime requirements?
Node.js ≥ 16.0.0, npm ≥ 8.0.0, TypeScript ≥ 4.5.0, and Cursor IDE (latest version).
How do I create a new service?
Create a new directory under src/ with the same structure (config, controllers, service), implement each layer, add build/start scripts to package.json, and register the service in the entry file index.ts.