MCP Server Example
About
MCP Server Example is a basic, template MCP (Model Context Protocol) server designed to be used with Cursor or other MCP‑compatible tools. It provides a starting point for developers to add their own tools and integrate with AI agents.
Details
- Author
- ivanbtrujillo
- Downloads
- 336
- Categories
- Other
Jump to
- Simple, customizable MCP server template
- Ready to use with Cursor and other tools
- Default weather tool included for demonstration
- Build and run with pnpm commands
- Easy configuration via .cursor/mcp.json
Modify index.ts to add your own tools, then build the project with pnpm run build and run it with pnpm run start. Add a .cursor/mcp.json file in your project with the server configuration (pointing to the built build/index.js), enable the MCP server in Cursor Settings, switch to Agent mode with claude-3.7-sonnet, and then query the weather to test the default tools.
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:

Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.



