About MCP Servers Template
MCP Servers Template is a Python template for developing MCP servers locally, aimed at developers who want concrete implementation examples. It includes weather, calculator, and local-file notes servers as starting points for different tool types.
Key features
- 01Weather alerts and forecast tools
- 02Basic and advanced math operations
- 03Local-file note management
- 04Three example server implementations
Use cases
- 01Use the weather example for location forecasts
- 02Build an MCP server with math operations
- 03Create and retrieve notes stored locally
MCP support
The template contains weather, calculator, and notes MCP server implementations, exposing weather queries, mathematical operations, and local note management tools to MCP clients.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMEMCP Servers Template
This repository provides a template for setting up Model Context Protocol (MCP) servers for local development. It includes examples of different MCP server implementations:
- Weather API - Provides weather alerts and forecasts
- Calculator - Basic and advanced mathematical operations
- Notes - Simple note-taking functionality with local file storage
Note: This project requires Python 3.10 or higher. See footnotes for instructions on using the correct Python version.
Project Structure
├── servers/ # MCP server implementations
│ ├── calculator.py # Calculator server implementation
│ ├── notes.py # Notes server implementation
│ └── weather.py # Weather API server implementation
├── docs/ # Documentation for the servers
├── requirements.txt # Python dependencies
└── README.md # This file
Requirements
- Python 3.10+
- FastMCP library
- Other dependencies as listed in
requirements.txt - UV package manager (recommended for faster installations)
Setup
-
Clone the repository:
git clone <repository-url> cd mcp-server-templates -
Set up a virtual environment (recommended):
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate -
Install UV package manager (if not already installed):
pip install uv -
Install dependencies with UV:
uv pip install -r requirements.txt
Usage
Running the MCP Servers
Each MCP server can be run using the MCP dev server command:
Weather API Server
mcp dev servers/weather.py
The Weather API provides the following tools:
get_alerts: Get weather alerts for a US stateget_forecast: Get weather forecast for a location based on latitude and longitude
Calculator Server
mcp dev servers/calculator.py
The Calculator provides mathematical operations including:
- Basic operations: add, subtract, multiply, divide
- Advanced operations: power, sqrt, cbrt, factorial, log, etc.
- Trigonometric functions: sin, cos, tan
Notes Server
mcp dev servers/notes.py
The Notes server provides note management functionality including:
add_note: Create a new note with title and contentlist_notes: Get all saved notesget_note: Retrieve a specific note by IDdelete_note: Remove a note by IDsearch_notes: Find notes containing a specific keywordupdate_note: Modify an existing note's title or content
VS Code Integration
These MCP servers can be integrated with Visual Studio Code for use with AI assistants. Configure your settings.json to include:
{
"mcp": {
"servers": {
"weather": {
"command": "bash",
"args": [
"-c",
"source {AbsolutePathToTheFolder}/venv/bin/activate && uv --directory {AbsolutePathToTheFolder} run servers/weather.py"
]
},
"calculator": {
"command": "bash",
"args": [
"-c",
"source {AbsolutePathToTheFolder}/venv/bin/activate && uv --directory {AbsolutePathToTheFolder} run servers/calculator.py"
]
},
"notes": {
"command": "bash",
"args": [
"-c",
"source {AbsolutePathToTheFolder}/venv/bin/activate && uv --directory {AbsolutePathToTheFolder} run servers/notes.py"
]
}
}
}
}
License
This project is licensed under the Apache License 2.0. See the LICENSE file for details.
Footnotes
Using Python 3.10+
-
Check your Python version:
python --version -
Install Python 3.10 or higher if needed:
- macOS (using Homebrew):
brew install [email protected] - Linux:
sudo apt-get update sudo apt-get install python3.10 - Windows: Download installer from python.org
- macOS (using Homebrew):
-
Use pyenv for managing multiple Python versions (recommended):
# Install pyenv brew install pyenv # macOS # Install Python version pyenv install 3.10.0 # Set local Python version pyenv local 3.10.0 -
Using UV with pyenv:
# After setting up pyenv and activating your environment pip install uv uv pip install -r requirements.txt
References and Further Reading
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.