MCP Server Example

MCP Server Example

This project is a very basic MCP server ready to be consumed by Cursor or other tools.

Modify index.ts and add any tools you want, or keep the default ones.

Then build the project:

pnpm run build

And run it:

pnpm run start

Now add a .cursor/mcp.json file in your project, and paste the following;

{ "mcpServers":{ "weather":{ "command": "node", "args": ["[path]/build/index.js"] } } }

Replace [path] with the absolute path to this project. Run pwd in the project folder for that. For example, in my case it is:

{ "mcpServers":{ "weather":{ "command": "node", "args": ["/Users/ivanbtrujillo/Development/mcp-server-spike/build/index.js"] } } }

Now go to "Settings" in cursor. You should be able to see the MCP server there. Enable it (click on the top right)

Now go to the chat, switch to Agent mode and select claude-3.7-sonnet as your model.

Type the following:

What is the weather in Texas?

It will use the MCP to get first the weather alerts, and then the forecast Here is an example of how the chat interface looks when querying the weather in Texas:

You must be authenticated.

A
security – no known vulnerabilities
F
license - not found
A
quality - confirmed to work

A basic MCP server template that can be integrated with Cursor to enable AI tools like weather information retrieval using Claude-3.7-sonnet model.

Related MCP Servers

  • -
    security
    F
    license
    -
    quality
    A simple MCP service that allows users to query weather conditions for cities worldwide through the Cursor AI assistant.
    Last updated -
    JavaScript
  • -
    security
    F
    license
    -
    quality
    An MCP server implementation that allows users to fetch and display weather information for specified cities, including temperature, humidity, wind speed, and weather descriptions.
    Last updated -
    Python
    • Linux
    • Apple
  • -
    security
    F
    license
    -
    quality
    An MCP-based project that integrates Zhipu AI and Tencent Map APIs to provide weather queries, geocoding, and web search functionality through both command-line and web interfaces.
    Last updated -
    2
    Python
  • A
    security
    A
    license
    A
    quality
    An MCP server that allows retrieving meteorological and climate data from Spain's State Meteorological Agency (AEMET) API directly from Claude AI and other MCP-compatible clients.
    Last updated -
    7
    2
    Python
    MIT License
    • Apple
    • Linux

View all related MCP servers

ID: 5t633u3mtn