Used for secure API key management through environment variables, enabling configuration of the server's connections to external services.
Provides data validation and type safety for API requests and responses, ensuring consistent data structures across all tool integrations.
Used for testing the MCP server and its tool integrations, ensuring reliable API connections and proper error handling.
The core language used to implement the MCP server, with support for async/await for high-performance API operations.
Provides structured logging capabilities for monitoring API interactions and troubleshooting integration issues.
API Aggregator MCP Server
A Model Context Protocol (MCP) Server that provides unified access to multiple external APIs through a single, consistent interface. Built for AI agents and LLMs, this server aggregates weather, news, and financial data into standardized tool calls.
Features
- ✅ MCP Protocol Compliant: Full JSON-RPC 2.0 support with proper tool discovery
- ✅ Multiple API Integrations: Weather, news, and stock market data
- ✅ Unified Error Handling: Consistent error responses across all APIs
- ✅ Type-Safe: Full type hints and Pydantic validation
- ✅ Async Support: High-performance async/await throughout
- ✅ Structured Logging: Rich, structured logs for monitoring
- ✅ Environment-Based Config: Secure API key management
Quick Start
1. Installation
2. Configuration
Create a .env
file with your API keys:
3. Get API Keys
- OpenWeatherMap: Get free API key
- News API: Get free API key
- Alpha Vantage: Get free API key
4. Run the Server
The server will start at http://localhost:8000
Available Tools
🌤️ Weather Tool: get_weather
Get current weather information for any city.
Parameters:
city
(required): City namecountry
(optional): Country code (e.g., "US", "GB")units
(optional): Temperature units - "metric" (default), "imperial", or "kelvin"
Example:
Response:
📰 News Tool: get_news
(Coming Soon)
Get latest news headlines by topic or region.
📈 Stock Tool: get_stock_price
(Coming Soon)
Get current stock prices and financial data.
API Endpoints
Health Check
List Available Tools
Invoke Tool (REST)
MCP Protocol Endpoint
Development
Project Structure
Running Tests
Code Quality
Adding New Tools
- Create a new file in
src/tools/
- Implement the service class and handler function
- Define the tool schema
- Register in
src/main.py
Example tool template:
Error Handling
All errors are returned in JSON-RPC format:
Common error codes:
-32001
: API key missing-32002
: API key invalid-32003
: External API error-32004
: Rate limit exceeded-32602
: Invalid parameters
Contributing
- Fork the repository
- Create a feature branch
- Add tests for new functionality
- Ensure all tests pass
- Submit a pull request
License
MIT License - see LICENSE file for details.
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
A Model Context Protocol (MCP) Server that provides unified access to multiple external APIs (weather, news, financial data) through a single, consistent interface for AI agents and LLMs.
Related MCP Servers
- -securityAlicense-qualityAn open-source implementation of the Model Context Protocol (MCP) that bridges AI agents with enterprise systems, enabling secure access to real-world data and capabilities.Last updated -1PythonApache 2.0
- AsecurityFlicenseAqualityAn all-in-one Model Context Protocol (MCP) server that connects your coding AI to numerous databases, data warehouses, data pipelines, and cloud services, streamlining development workflow through seamless integrations.Last updated -2Python
- -securityAlicense-qualityModel Context Protocol (MCP) server that provides AI assistants with advanced web research capabilities, including Google search integration, intelligent content extraction, and multi-source synthesis.Last updated -272TypeScriptMIT License
- AsecurityAlicenseAqualityA Model Context Protocol (MCP) server that provides AI-powered security analysis and safety instruction tools. This server helps protect AI agents by providing security guidelines, content analysis, and cautionary instructions when interacting with various MCPs and external services.Last updated -323JavaScriptISC License