π Build Custom MCP Servers πβοΈπ°
LocalAbout π Build Custom MCP Servers πβοΈπ°
A sample MCP server built with the Python MCP SDK for users who want note, weather, and news functions in MCP clients. It combines local note operations with external weather data and news search.
Key features
- 01Add, read, and summarize local notes
- 02Fetch current weather for a city
- 03Search news with Brave Search
- 04Configure API keys through .env
Use cases
- 01Save and review local notes
- 02Check current weather in a city
- 03Search for related news
MCP support
The server exposes note management, weather lookup, and news search tools to MCP clients. It is built with the `mcp[cli]` Python SDK.
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 READMEπ Build Custom MCP Servers πβοΈπ°
π Project Description
This project demonstrates a simple MCP Servers built using the MCP mcp[cli] Python SDK. It provides several tools exposed through the MCP server:
- Note Management: Add, read, retrieve the latest, and generate summaries of notes stored locally.
- Weather Information: Fetch current weather data for a specified city using the WeatherAPI.com service.
- News Search: Perform news searches using the Brave Search API.
It utilizes API keys stored in a .env file for external services.
π οΈ Setup Instructions
Follow these steps to get the FastMCP agent running:
-
Prerequisites:
- Python 3.12 installed.
- A virtual environment manager (like
venv,pipenv,poetry, oruv) is recommended.
-
Clone the Repository (if you haven't already):
# Make sure you are in the correct parent directory git clone https://github.com/sourangshupal/Build-Custom-MCP-Servers # Or use the current directory if already cloned cd Build-Custom-MCP-Servers -
Set up Virtual Environment & Install Dependencies:
- Install dependencies (assuming uv, based on uv.lock, otherwise adjust for pip/poetry):
uv sync uv lock source .venv/bin/activate # On Windows use `.venv\Scripts\activate` - OR
pip install uv # if you don't have uv uv pip install -r requirements.txt # Or uv sync if using pyproject.toml directly # If not using uv, likely: pip install -r requirements.txt or poetry install or pip install .
- Install dependencies (assuming uv, based on uv.lock, otherwise adjust for pip/poetry):
-
Configure Environment Variables:
- Copy the example environment file:
cp .env.example .env - Edit the newly created
.envfile and add your API keys:WEATHER_API_KEY="YOUR_WEATHER_API_KEY" BRAVE_API_KEY="YOUR_BRAVE_API_KEY"
- Copy the example environment file:
-
Run the Agent:
-
Execute the main script:
mcp install main.py -
The FastMCP server should be added to Claude Desktop.
mcp dev main.py -
Debug the MCP Server
-
β¨ Features
- Note-taking capabilities (add, read, latest, summarize) π
- Current weather fetching βοΈ
- Brave Search integration for news π°
- Configuration via
.envfile π - Built with
mcp[cli]βοΈ
π€ Contributing
Contributions are welcome! Please feel free to submit pull requests or open issues.
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.