mcp-server-sample-main

mcp-server-sample-main

0

This project is an educational MCP server implementation that integrates with external APIs to provide weather alerts and forecasts. It is designed with a layered architecture inspired by Domain-Driven Design principles.

Example MCP Server

Created for educational purposes on the Código Fonte TV channel, this project demonstrates how to build an MCP server with external API integration and data validation.

Features

  • Return active weather alerts for a state.
  • Provide weather forecasts for geographical coordinates.
  • Input validation using a library.
  • Integration with the NWS API.
  • Communication via stdio using the MCP protocol.

Architecture

  • Domain: Defines interfaces and data structures.
  • Infrastructure: External service implementations.
  • Application: Business logic and data processing.
  • Interface: Controllers for registering tools and returning results.
  • Entry Point: Initializes the server and listens to stdio.

Installation

Clone the repository, install dependencies, and build the project.

Usage

Run the server directly or as a binary.

Contribution

Pull requests are welcome. Feel free to discuss improvements.