MCP ExplorerExplorer

Buildingcustommcpserver

@GOURAVRISHIon 8 days ago
1Β MIT
FreeCommunity
AI Systems
A project for building custom MCP Servers with note management, weather info, and news search.

Overview

What is Buildingcustommcpserver

This project is a demonstration of Building Custom MCP Servers using the MCP mcp[cli] Python SDK. It offers various functionalities such as note management, weather information retrieval, and news searches, all integrated into a single server application.

Use cases

Possible use cases include personal note management where users can add, read, and summarize their notes. Additionally, it provides real-time weather updates for any specified city and facilitates news searches, making it useful for users seeking to stay informed about current events.

How to use

To use this project, you need to set up a virtual environment, install the required dependencies, and configure the API keys in the .env file. Once set up, you can run the MCP server using the provided mcp commands, allowing for interaction with its features.

Key features

Key features include the ability to manage notes (add, read, summarize), fetch current weather data from WeatherAPI.com, and perform news searches utilizing the Brave Search API, all while keeping sensitive information secure through the use of environment variables.

Where to use

This MCP server can be utilized in personal applications, productivity tools, and custom integration solutions where the user needs to manage notes, access weather data, or perform news searches in a streamlined manner within a development environment.

Content

πŸš€ 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:

  1. Prerequisites:

    • Python 3.12 installed.
    • A virtual environment manager (like venv, pipenv, poetry, or uv) is recommended.
  2. 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 
    
  3. 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 .
      
  4. Configure Environment Variables:

    • Copy the example environment file:
      cp .env.example .env
      
    • Edit the newly created .env file and add your API keys:
      WEATHER_API_KEY="YOUR_WEATHER_API_KEY"
      BRAVE_API_KEY="YOUR_BRAVE_API_KEY"
      
  5. 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 .env file πŸ”‘
  • Built with mcp[cli] βš™οΈ

🀝 Contributing

Contributions are welcome! Please feel free to submit pull requests or open issues.

Tools

No tools

Comments