MCP-Server
A lightweight bridge connecting LLMs to real-world APIs like finance, weather, news, and GitHub through Anthropic's Model Context Protocol, enabling unified access and intelligent query routing.
README
Model Context Protocol (MCP) Server
This project is a lightweight, standardized bridge that connects Claude and other LLMs to real-world APIs through Anthropic's Model Context Protocol (MCP). This server enables seamless integration between AI applications and external data sources without requiring custom integration work for each API.
Project Overview
The MCP Server implements Anthropic's open standard protocol to expose multiple API capabilities (tools, resources, and prompts) through a unified interface. This allows any MCP-compatible AI application to interact with various external services including financial data, weather information, news feeds, and GitHub repositories.
Postman Collection : Postman Colletion Link
Video not included as the OpenAI API key became invalid before the loom video could be recorded
Architecture
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ Claude/LLM │◄──►│ MCP Server │◄──►│ External APIs │
│ Application │ │ (This Project) │ │ │
└─────────────────┘ └──────────────────┘ └─────────────────┘
│
▼
┌──────────────────┐
│ API Handlers │
│ ┌─────────────┐ │
│ │ Finance API │ │
│ │ Weather API │ │
│ │ News API │ │
│ │ GitHub API │ │
│ └─────────────┘ │
└──────────────────┘
Features
Multi-API Support
- Financial Data: Real-time stock prices, market data, and financial analytics
- Weather Services: Current conditions, forecasts, and weather alerts
- News Integration: Latest news articles, headlines, and content aggregation
- GitHub Integration: Repository data, commits, issues, and developer statistics
MCP Protocol Implementation
- Standardized tool exposure through MCP specification
- Resource management for external API data
- Prompt templates for common API interactions
- Unified request/response handling
Intelligent Request Routing
- Mixed Prompt Handler (
/mcp): Processes complex queries spanning multiple APIs - Dedicated Endpoints: Individual API access points for specific use cases
- Smart routing based on user intent and query analysis
Performance & Reliability
- Caching Strategies: Redis-based caching for frequently accessed data
- Rate Limiting: Built-in protection against API quota exhaustion
- Error Handling: Robust error recovery and graceful degradation
- Comprehensive Logging: Detailed request/response logging for debugging
Developer Experience
- Simple JSON-based request format
- Consistent API responses across all endpoints
- TypeScript implementation for type safety
- Comprehensive documentation and examples
Tech Stack
Core Technologies
- Node.js with TypeScript: Server runtime and type safety
- Express.js: Web framework and routing
- MCP Protocol: Anthropic's standardized AI-API bridge specification
External API Integrations
- Financial APIs: Yahoo Finance
- Weather APIs: OpenWeatherMap
- News APIs: NewsAPI
- GitHub API: GitHub Personal Access Token (PAT)
Infrastructure
- Redis: Caching layer for performance optimization
- Docker: Containerization for easy deployment
- Prometheus: Metrics collection and monitoring
- Grafana: Visualizes the metrics collected by Prometheus
Project Structure
src/
├── mcpHandler/ # MCP protocol handlers
│ ├── financeHandler.ts
│ ├── githubHandler.ts
│ ├── mcpHandler.ts # Mixed prompt processor
│ ├── newsHandler.ts
│ └── weatherHandler.ts
├── routes/ # API route definitions
│ ├── financeRoute.ts
│ ├── githubRoute.ts
│ ├── mcpRoute.ts # Main MCP endpoint
│ ├── newsRoute.ts
│ └── weatherRoute.ts
├── services/ # External API service clients
│ ├── financeService.ts
│ ├── githubService.ts
│ ├── mcpService.ts
│ ├── newsService.ts
│ ├── openai.ts
│ └── weatherService.ts
├── utils/
│ └── redis.ts # Redis configuration
└── index.ts # Application entry point
API Endpoints
Mixed Prompt Handler
POST /mcp
Processes complex queries that may require data from multiple APIs.
Individual API Endpoints
POST /news - News and article queries
POST /github - GitHub repository and developer data
POST /weather - Weather conditions and forecasts
POST /finance - Financial data and market information
Request Format
All endpoints accept a simple JSON payload:
{
"userMessage": "Your query or request here"
}
Running locally
The entire system can be run locally with a single command using Docker Compose.
# Build and run with Docker Compose
docker-compose up --build
# Run specific services
docker-compose up redis mcp-server
Configuration
Environment Variables
# Server Configuration
PORT=3000
# Redis Configuration
REDIS_URL=redis://localhost:6379
# API Keys
OPENAI_API_KEY=your_openai_key
ALPHA_VANTAGE_API_KEY=your_finance_key
WEATHER_API_KEY=your_weather_key
NEWS_API_KEY=your_news_key
GITHUB_TOKEN=your_github_token
Usage Examples
Financial Data Query
curl -X POST http://localhost:3000/finance \
-H "Content-Type: application/json" \
-d '{"userMessage": "What is the current price of AAPL stock?"}'
Mixed Query (Multiple APIs)
curl -X POST http://localhost:3000/mcp \
-H "Content-Type: application/json" \
-d '{"userMessage": "What is the weather like in New York and what are the latest tech news?"}'
GitHub Repository Analysis
curl -X POST http://localhost:3000/github \
-H "Content-Type: application/json" \
-d '{"userMessage": "Show me the latest commits in the React repository"}'
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。