Multi-Server MCP FastAPI Project
A FastAPI application that hosts multiple MCP servers for weather, news, currency, and quotes APIs.
README
Multi-Server MCP FastAPI Project
A comprehensive FastAPI application that hosts multiple Model Context Protocol (MCP) servers, each providing access to different public APIs and services.
Work Demo
🚀 Features
This project includes 5 different MCP servers:
- Weather Server – OpenWeatherMap API integration for weather data
- News Server – NewsAPI integration for latest news articles
- Currency Server – Exchange rates and currency conversion
- Quote Server – Inspirational quotes and random facts
📋 Prerequisites
- Python 3.13+
- UV package manager
- API keys for external services (see Configuration section)
📁 Project Structure
fastapi-multi-server-mcp/
├── main.py # FastAPI application entry point
├── requirements.txt # Python dependencies
├── pyproject.toml # UV project configuration
├── .env.example # Environment variables template
├── README.md # This file
├── servers/ # MCP servers directory
│ ├── __init__.py
│ ├── weather_server.py # Weather API MCP server
│ ├── news_server.py # News API MCP server
│ ├── currency_server.py # Currency API MCP server
│ └── quote_server.py # Quotes API MCP server
├── utils/ # Utility modules
│ ├── __init__.py
│ ├── api_clients.py # HTTP client utilities
│ └── config.py # Configuration management
├── tests/ # Test suite
│ ├── __init__.py
│ ├── test_weather.py
│ ├── test_news.py
│ ├── test_currency.py
│ └── test_quote.py
└── docs/ # Documentation
├── api_reference.md
└── deployment.md
🛠️ Installation
Using UV (Recommended)
# Clone the repository
git clone <your-repo-url>
cd fastapi-multi-server-mcp
# Create virtual environment and install dependencies
uv venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
uv pip install -r requirements.txt
Using pip
pip install -r requirements.txt
🔧 Configuration
Create a .env file in the root directory with your API keys:
# Weather API (OpenWeatherMap)
OPENWEATHER_API_KEY=your_openweather_api_key
# News API
NEWS_API_KEY=your_news_api_key
# Exchange Rates API
EXCHANGE_RATES_API_KEY=your_exchange_rates_api_key
# Server Configuration
PORT=10000
HOST=0.0.0.0
Getting API Keys
- OpenWeatherMap: Register at openweathermap.org
- NewsAPI: Get free API key at newsapi.org
- Exchange Rates: Register at exchangerate-api.com
- Quote API: Get free API key at quotesapi.com
🏃♂️ Running the Application
Development
# Using UV
uv run uvicorn main:app --reload --host 0.0.0.0 --port 10000 --reload
# Using `npx` to debug the running application,
npx @modelcontextprotocol/inspector uv run uvicorn main:app
To connect specific server to inspector,
Set,
-
Transport Type:
StreamableHTTP -
URLs:
- for news: http://localhost:10000/news/mcp/
- for weather: http://localhost:10000/weather/mcp/
- for currency: http://localhost:10000/currency/mcp/
- for quotes: http://localhost:10000/quotes/mcp/
- Click connect, it will open inspector window like this:
Quotes server:

News server:

Weather server:

Currency server:

As of June 2025, Windsurf and Cursor supports two transport types for MCP servers: stdio and /sse, but not StreamableHTTP. So using stdio or /sse as transport type is recommended. But with inspector, you can connect to the MCP server running on FastAPI with any transport type.
Production
# Using Gunicorn
gunicorn main:app -w 4 -k uvicorn.workers.UvicornWorker --bind 0.0.0.0:10000
📚 API Endpoints
Once running everything successfully,
Your FastAPI server will be available at: http://localhost:10000, docs at http://localhost:10000/docs and your MCP servers will be available at:
- Weather Server: http://localhost:10000/weather
- News Server: http://localhost:10000/news
- Currency Server: http://localhost:10000/currency
- Quote Server: http://localhost:10000/quotes
🧪 Testing
# Run all tests
pytest
# Run with coverage
pytest --cov=.
# Run specific server tests
pytest tests/test_weather.py
🛠️ Available Tools by Server
<details> <summary>🖼️ Click to see the tool details</summary>
Weather Server (/weather)
get_current_weather - Get current weather for a city
get_weather_forecast - Get 5-day weather forecast
get_weather_by_coordinates - Get weather by latitude/longitude
News Server (/news)
get_top_headlines - Get top news headlines
search_news - Search news articles by keyword
get_news_by_category - Get news by category (business, tech, sports, etc.)
Currency Server (/currency)
get_exchange_rates - Get current exchange rates
convert_currency - Convert between currencies
get_supported_currencies - List all supported currencies
Quote Server (/quotes)
get_random_quote - Get a random inspirational quote
get_quote_by_category - Get quotes by category
get_random_fact - Get a random interesting fact
</details>
🚀 Deployment
Docker
You can deploy this project using Docker. Example Dockerfile is included:
FROM python:3.11-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
EXPOSE 10000
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "10000"]
Environment Variables for Production
PORT=10000
HOST=0.0.0.0
LOG_LEVEL=info
WORKERS=4
📝 License
This project is licensed under the MIT License - see the LICENSE.md file for details.
📚 Support & Documentation
- Check the documentation in the
docs/directory - Review the test files for usage examples
🔄 Updates and Roadmap
- Add WebSocket support for real-time data
- Implement caching for API responses
- Add rate limiting and authentication
- Create web dashboard for monitoring
- Add more API integrations (Spotify, Twitter, etc.)
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。