Weather MCP Server

Weather MCP Server

Enables to get current weather conditions for any location via the Open-Meteo API, returning temperature, humidity, wind, and more.

Category
Visit Server

README

<p align="center"><a href="https://laravel.com" target="_blank"><img src="https://raw.githubusercontent.com/laravel/art/master/logo-lockup/5%20SVG/2%20CMYK/1%20Full%20Color/laravel-logolockup-cmyk-red.svg" width="400" alt="Laravel Logo"></a></p>

Weather MCP Server (Laravel)

A small learning/testing project for exploring the Model Context Protocol (MCP) using the laravel/mcp package. It exposes a Weather MCP server with a single get-weather tool, plus a browser-based console for connecting to the server and calling the tool by hand.

This repo exists purely to learn how Laravel MCP servers, tools, and the Streamable HTTP transport work — it is not a production service.

What's in here

  • WeatherServer (app/Mcp/Servers/WeatherServer.php) — an MCP server registered at /mcp/weather that exposes the get-weather tool and instructs the LLM on when to use it.
  • GetWeather (app/Mcp/Tools/GetWeather.php) — a read-only, open-world MCP tool that:
    • Accepts a location (required) and units (metric or imperial, defaults to metric).
    • Geocodes the location via the Open-Meteo Geocoding API.
    • Fetches live current conditions from the Open-Meteo Forecast API.
    • Returns structured content (temperature, apparent temperature, humidity, wind, condition, timezone, etc.) or a friendly error if the location can't be found or the provider is unreachable.
  • CrmServer (app/Mcp/Servers/CrmServer.php) — an empty scaffold server (registered at /mcp/crm) kept around for experimenting with a second server/tool set.
  • Weather MCP Console (resources/views/mcp-tester.blade.php) — a plain HTML/JS page served at / and /mcp-tester for connecting to the local Streamable HTTP MCP endpoint, discovering its tools, and calling get-weather interactively.
  • MCP routes (routes/ai.php) — registers the two servers with Mcp::web(...).

Requirements

  • PHP ^8.1
  • Composer
  • Node.js + npm (for the console's Vite assets)

Setup

composer install
npm install

cp .env.example .env
php artisan key:generate

npm run dev      # or: npm run build
php artisan serve

No database is required to use the weather tool itself, but the default Laravel .env still points at one if you want to run migrations.

Trying it out

  1. Start the app with php artisan serve and run npm run dev (or build assets) so the console's JS/CSS are available.
  2. Open http://127.0.0.1:8000/ (or /mcp-tester) in a browser.
  3. Point MCP endpoint at http://127.0.0.1:8000/mcp/weather and click Connect & discover to list the server's tools.
  4. Call get-weather with a location (e.g. Bengaluru) and an optional units value to see a live structured response.

You can also talk to the server directly as an MCP client (e.g. Claude Desktop, Claude Code, or another MCP-compatible client) by pointing it at the /mcp/weather Streamable HTTP endpoint.

Tests

php artisan test

tests/Feature/GetWeatherToolTest.php fakes the Open-Meteo HTTP calls and asserts the tool returns correctly structured weather data.

License

The Laravel framework is open-sourced software licensed under the MIT license.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured