Skip to content

CollinDex/prime-ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 Prime-AI Server

A Model Context Protocol (MCP) server built with Python, and fastmcp. This server provides a some practical tools for AI models, ranging from real-time weather data to financial calculations.

🛠️ Tools Included

  1. 🧮 Calculator: Basic arithmetic operations (Add, Subtract, Multiply, Divide).
  2. 🌤️ Weather: Real-time weather forecasts using the wttr.in API.
  3. 🕒 Time: Timezone conversion and current time lookup (IANA compliant).
  4. 💱 Currency: Real-time exchange rates via Open Exchange Rates (Supports NGN, USD, EUR, etc.).
  5. 📏 Unit Converter: Physics-based unit conversions using the pint library.

⚙️ Setup Instructions

Prerequisites

  • Python 3.11 or higher
  • uv (Python package manager)
  • make (Optional, for running shortcuts)

Installation

  1. Clone the repository:

    git clone <YOUR_REPO_URL_HERE>
    cd <YOUR_REPO_NAME>
  2. Install dependencies: This project uses uv for fast dependency management.

    make install

🚀 How to Run

The easiest way to test the tools is using the built-in Makefile command, which launches the MCP Inspector.

make dev

Alternatively: uv run fastmcp dev main.py

📖 Usage & Examples

Below are example inputs for testing the tools in the MCP Inspector.

1. Weather Tool (get_weather)

Gets real-time weather data.

  • Input:
    {
      "location": "Lagos",
      "location_identifier": "city"
    }
  • Response: {"temp_C": "32", "weatherDesc": [{"value": "Sunny"}], ...}

2. Currency Converter (convert_currency)

Converts money using live market rates.

  • Input:
    {
      "amount": 100,
      "from_currency": "USD",
      "to_currency": "NGN"
    }
  • Response:
    {
      "result": "165400.50 NGN",
      "exchange_rate": "1 USD = 1654.005 NGN"
    }

3. Unit Converter (convert_units)

Converts physical quantities (e.g., length, weight, temp).

  • Input:
    {
      "amount": 100,
      "from_unit": "celsius",
      "to_unit": "fahrenheit"
    }
  • Response: "100 celsius = 212.0000 fahrenheit"

4. Time Tool (convert_time)

Converts time between timezones.

  • Input:
    {
      "source_timezone": "UTC",
      "target_timezone": "Africa/Lagos",
      "time_string": "2026-01-10 12:00:00"
    }
  • Response: "2026-01-10 13:00:00 WAT"

5. Calculator (add, subtract, multiply, divide)

Performs basic arithmetic operations.

  • Input (Example: Addition):
    {
      "a": 10,
      "b": 5,
      "operation": "add"
    }
  • Response: 15

📦 Dependencies

  • fastmcp: For MCP server architecture.
  • httpx: For async API requests.
  • pint: For unit conversions.
  • zoneinfo: For timezone handling.

🔐 API Keys

No private API keys are required!

  • Weather: Uses wttr.in (Open Source).
  • Currency: Uses open.er-api.com (Open Source).

About

A Model Context Protocol (MCP) server built with Python, and fastmcp.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors