MCP Server logo

MCP Server

by Abhinavexists

A command-line tool providing US weather data via a client-server architecture using Model Context Protocol (MCP) and Google's Gemini AI. It allows users to query weather information using natural language.

View on GitHub

Last updated: N/A

What is MCP Server?

This is a Python-based server application that uses the Model Context Protocol (MCP) to connect a client application with a weather data server. It allows users to query weather information using natural language powered by Google's Gemini AI.

How to use MCP Server?

First, clone the repository and install the dependencies. Then, set up your Gemini API key in a .env file. Start the server and client using python client.py server.py. Once connected, you can ask questions about weather information, such as weather alerts or forecasts for specific locations. Type quit to exit.

Key features of MCP Server

  • Query weather alerts for US states using state codes

  • Get detailed weather forecasts for specific locations using latitude and longitude

  • Natural language interface powered by Google's Gemini AI

  • Client-server architecture using Model Context Protocol (MCP)

Use cases of MCP Server

  • Accessing weather alerts for specific US states

  • Obtaining weather forecasts for specific locations based on latitude and longitude

  • Integrating natural language weather queries into applications

  • Demonstrating a client-server architecture using MCP and Gemini AI

FAQ from MCP Server

What is MCP?

Model Context Protocol (MCP) is a protocol used for communication between a client and a server, enabling the exchange of information and execution of tools.

What API does the server use for weather data?

The server communicates with the National Weather Service API to retrieve weather alerts and forecasts.

What is the purpose of the Gemini API key?

The Gemini API key is required to use Google's Gemini AI for natural language processing of user queries.

How do I specify a location for a weather forecast?

You need to provide the latitude and longitude coordinates of the location you are interested in.

What are some potential future improvements for this project?

Future improvements include adding additional weather data endpoints, implementing caching, supporting location name lookup, and creating a web interface.