π― A powerful, scalable Model Context Protocol (MCP) server built with modern Python technologies
RL-MCP is a robust Model Context Protocol server designed to provide AI models with structured access to external data and services. Think of it as a bridge π that allows AI assistants to interact with your applications, databases, and APIs in a standardized, secure way.
- π Secure Authentication - Built-in auth system to protect your endpoints
- π RESTful API - Clean, well-documented API endpoints with FastAPI
- ποΈ PostgreSQL Integration - Robust database layer with SQLModel/SQLAlchemy
- π³ Docker Ready - Fully containerized development and deployment
- π Database Migrations - Alembic-powered schema management
- π Health Monitoring - Built-in health checks and connection monitoring
- π¨ Interactive Docs - Auto-generated API documentation
- π οΈ Development Tools - Pre-commit hooks, linting, and formatting
π Transform your applications with AI-powered financial intelligence
RL-MCP includes a comprehensive Stock Market Intelligence API that combines cutting-edge AI with real-time financial data:
- π Vector Search: Semantic search across news, analysis, and market data using advanced NLP
- π Sentiment Analysis: Real-time sentiment scoring for news and market content
- π€ Smart Analysis: AI-driven stock analysis with confidence scoring and recommendations
- π― Relevance Scoring: Intelligent content ranking and filtering
- π Live Pricing: Current stock prices with change indicators and market metrics
- π° News Intelligence: Latest financial news with sentiment analysis from multiple sources
- π Market Overview: Comprehensive market summaries with top movers and trends
- π₯ Trending Analysis: Most active and discussed stocks based on data volume
- π Intelligent Caching: Multi-layer caching for lightning-fast responses
- π Background Processing: Async data ingestion and processing
- π Performance Monitoring: Built-in health checks and cache statistics
- π‘οΈ Enterprise-Ready: Secure, scalable, and production-ready
- π€ AI Trading Assistants - Portfolio analysis and trading signals
- π Financial Research - Market research and competitive intelligence
- π± Investment Apps - Smart notifications and educational content
- π’ Enterprise Systems - Risk management and client reporting
Explore our detailed stock market API documentation:
- π Stock API Overview - Complete guide to stock market features
- π Vector Search Guide - Advanced semantic search capabilities
- π‘ Use Cases & Examples - Real-world applications and code samples
- π API Reference - Complete endpoint documentation
This MCP server is designed to be the foundation for AI-powered applications that need:
- π€ AI Model Integration - Seamless connection between AI models and your data
- π Plugin Architecture - Extensible system for adding new capabilities
- π‘ Real-time Communication - WebSocket support for live data streaming
- π Multi-tenant Support - Serve multiple clients with isolated data
- π Advanced Search - Vector search and semantic querying capabilities
- π Analytics Dashboard - Monitor usage, performance, and insights
- π Backend: Python 3.12 + FastAPI
- ποΈ Database: PostgreSQL with SQLModel
- π³ Containerization: Docker + Docker Compose
- π Migrations: Alembic
- π§ͺ Code Quality: Black, isort, pylint, pre-commit hooks
- π Documentation: Auto-generated OpenAPI/Swagger docs
- π§ AI/ML: Sentence Transformers, Vector Search, Sentiment Analysis
- π³ Docker and Docker Compose
- π Python 3.12+ (for local development)
- πΊ Homebrew (macOS) or equivalent package manager
Get up and running in seconds! Our setup script handles everything:
make setup-environmentThis magical command will:
- π§ Install all required dependencies
- π Create and configure a Python virtual environment
- π³ Set up Docker containers
- π¦ Install all Python packages
- β Verify everything is working
# Build and start all services
make up
# Or run in background
docker compose up -dYour services will be available at:
- π API Server: http://localhost:8000
- π API Docs: http://localhost:8000/docs
- π Stock API: http://localhost:8000/v1/stock
- ποΈ Database Admin: http://localhost:8080 (Adminer)
# Activate virtual environment
source venv/bin/activate
# Start the api and db at port 8000
make upOnce running, explore the interactive API documentation:
- π Swagger UI: http://localhost:8000/docs
- π ReDoc: http://localhost:8000/redoc
- π OpenAPI Spec: http://localhost:8000/openapi.json
All API endpoints require authentication. Include your auth token in requests:
curl -H "Authorization: Bearer YOUR_TOKEN" http://localhost:8000/v1/item# Search for Tesla battery technology insights
curl -X POST "http://localhost:8000/v1/stock/search" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"query": "Tesla battery technology innovations",
"symbols": ["TSLA"],
"similarity_threshold": 0.8,
"limit": 10
}'
# Get current Apple stock price
curl -H "Authorization: Bearer YOUR_TOKEN" \
"http://localhost:8000/v1/stock/price/AAPL"
# Get market summary
curl -H "Authorization: Bearer YOUR_TOKEN" \
"http://localhost:8000/v1/stock/market/summary"When you modify database models:
MSG="Add new awesome feature" make migration# Start the api and db at port 8000
make up
# Check database health
curl http://localhost:8000/health# Regenerate requirements.txt with latest versions
make regen-requirements# Remove all containers and volumes
make cleanPre-commit hooks automatically run:
- π¨ Black - Code formatting
- π isort - Import sorting
- π Pylint - Code linting
rl-mcp/
βββ π app/ # Main application code
β βββ π api/ # API layer
β β βββ π v1/ # API version 1
β β βββ π base/ # Base models and tables
β β βββ π item/ # Item management endpoints
β β βββ π stock/ # π Stock market intelligence
β β βββ π services/ # AI services (vector search, market data)
β β βββ π routes_stock.py # Stock API endpoints
β β βββ π models_stock.py # Data models
β β βββ π controllers_stock.py # Business logic
β βββ π databases/ # Database configuration
β βββ π main.py # Application entry point
βββ π docs/ # π Comprehensive documentation
β βββ π stock/ # Stock API documentation
βββ π docker/ # Docker configurations
βββ π migrations/ # Database migrations
βββ π scripts/ # Utility scripts
βββ π utilities/ # Helper utilities
βββ π Makefile # Development commands
We welcome contributions! π
- π΄ Fork the repository
- πΏ Create a feature branch
- β¨ Make your changes
- π§ͺ Run tests and linting
- π Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
Having issues? π€
- π Check the API Documentation
- π Explore Stock API Documentation
- π Open an Issue
- π¬ Start a Discussion
π Built with β€οΈ for the future of AI-powered applications
Ready to revolutionize how AI models interact with your data? Let's build something amazing together! β¨
π Featuring comprehensive stock market intelligence with AI-powered semantic search, real-time data, and intelligent caching π€πΉ