MCP Servers Template

by gupta-ujjwal

193 downloads
Not rated
GitHub

About

This repository provides a template for setting up Model Context Protocol (MCP) servers for local development.

Details

Author
gupta-ujjwal
Downloads
193
Categories
Developer Tools

- Weather API server with get_alerts and get_forecast tools
- Calculator server supporting basic, advanced, and trigonometric operations
- Notes server with full CRUD and keyword search functionality
- Template structure with separate server files and documentation
- Uses FastMCP library and UV package manager for fast setup
- Ready-to-use VS Code integration configuration

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name MCP Servers Template
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Clone the repository, create a virtual environment (Python 3.10+ required), install dependencies with uv pip install -r requirements.txt, then run a server using mcp dev servers/<filename>.py. For VS Code integration, add the corresponding server configuration to your settings.json.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "mcp servers template": {
            "mcp-server-templates": {
                "command": "python",
                "args": [
                    "-m",
                    "venv",
                    "venv"
                ]
            }
        }
    }
}

McpServers

{
    "mcp-server-templates": {
        "command": "python",
        "args": [
            "-m",
            "venv",
            "venv"
        ]
    }
}

MCP 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:

1. Weather API - Provides weather alerts and forecasts
2. Calculator - Basic and advanced mathematical operations
3. 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

1. Clone the repository:

   git clone <repository-url>
cd mcp-server-templates

2. Set up a virtual environment (recommended):

   python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate

3. Install UV package manager (if not already installed):
``bash
pip install uv


4. Install dependencies with UV:
bash
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

bash mcp dev servers/weather.py
The Weather API provides the following tools:
- get_alerts: Get weather alerts for a US state
- get_forecast: Get weather forecast for a location based on latitude and longitude

Calculator Server

bash 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

bash mcp dev servers/notes.py

The Notes server provides note management functionality including:
- add_note: Create a new note with title and content
- list_notes: Get all saved notes
- get_note: Retrieve a specific note by ID
- delete_note: Remove a note by ID
- search_notes: Find notes containing a specific keyword
- update_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:

json
{
"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+

1. Check your Python version:

bash
python --version

2. Install Python 3.10 or higher if needed:
- macOS (using Homebrew):
bash
brew install python@3.10
   - Linux:
bash
sudo apt-get update
sudo apt-get install python3.10
   - Windows: Download installer from python.org

3. Use pyenv for managing multiple Python versions (recommended):

bash
# Install pyenv
brew install pyenv # macOS

# Install Python version
pyenv install 3.10.0

# Set local Python version
pyenv local 3.10.0

4. Using UV with pyenv:
bash
# After setting up pyenv and activating your environment
pip install uv
uv pip install -r requirements.txt
``

References and Further Reading

- MCP Introduction & Official Documentation
- MCP Python Package on PyPI

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.