
python mcp server
Weather MCP server in python
Repository Info
About This Server
Weather MCP server in python
Model Context Protocol (MCP) - This server can be integrated with AI applications to provide additional context and capabilities, enabling enhanced AI interactions and functionality.
Documentation
MCP Server
Weather MCP server in python
docs
python-sdk
# Create a new directory for our project
uv init
# Create virtual environment and activate it
uv venv
source .venv/bin/activate
# Install dependencies
uv add "mcp[cli]" httpx
# Create our server file
touch weather.py
Testing
This project includes a comprehensive test suite for the weather service API. The tests use pytest and pytest-asyncio to test the asynchronous functions that interact with the National Weather Service API.
Test Requirements
- Python 3.12+
- pytest
- pytest-asyncio
- pytest-cov
- httpx
Installing Development Dependencies
You can install all development dependencies using:
# Using uv
uv pip install -e ".[dev]"
# Or using pip
pip install -e ".[dev]"
Running the Tests
To run the tests:
# Run all tests
pytest
# Run with verbose output
pytest -v
# Run with code coverage
pytest --cov=weather
Test Coverage
The test suite covers:
-
Unit Tests for Helper Functions
format_alertfunction for formatting alert data- Error handling in
make_nws_request
-
API Function Tests
get_alerts: Testing successful retrieval, empty results, and API failuresget_forecast: Testing successful forecast retrieval and error handling for both API endpoints
-
Mock Responses
- All HTTP requests are mocked using
httpx.AsyncMock - Multiple test scenarios with different API responses
- All HTTP requests are mocked using
Continuous Integration
When adding new features to the weather service, please ensure all tests pass by running the test suite before submitting changes.
Quick Start
Clone the repository
git clone https://github.com/aquental/python-mcp-serverInstall dependencies
cd python-mcp-server
npm installFollow the documentation
Check the repository's README.md file for specific installation and usage instructions.
Repository Details
Recommended MCP Servers
Discord MCP
Enable AI assistants to seamlessly interact with Discord servers, channels, and messages.
Knit MCP
Connect AI agents to 200+ SaaS applications and automate workflows.
Apify MCP Server
Deploy and interact with Apify actors for web scraping and data extraction.
BrowserStack MCP
BrowserStack MCP Server for automated testing across multiple browsers.
Zapier MCP
A Zapier server that provides automation capabilities for various apps.