This repository contains a comprehensive demonstration solution for Model Context Protocol (MCP) showcasing all three core MCP capabilities: Tools, Prompts, and Resources. Built with Python and designed for Azure deployment.
Workshop: Step-by-step labs for deploying APIs, MCP servers, and the chat client (Option 1) are in
docs/index.md
. When published with GitHub Pages, the workshop is available athttps://prwani.github.io/mcp_demo_app_python/
.
- Leave Management: Apply for leave, check balances
- Timesheet Management: Log hours, list entries
- Interactive tool discovery and execution
- Leave Prompts: Email templates, policy summaries, calendar planning
- Timesheet Prompts: Submission reminders, project summaries, overtime analysis
- Dynamic prompt generation with user arguments
- Leave Resources: Policies, forms, holiday calendars, team status
- Timesheet Resources: Submission guidelines, project codes, templates, utilization reports
- Rich content delivery in multiple formats (text, JSON)
- REST API: FastAPI with SQLAlchemy ORM
- Database: Azure SQL DB (serverless) with leave balances and requests
- MCP Server: Full MCP implementation with tools, prompts, and resources
- Web UI: Interactive leave management interface
- REST API: FastAPI with timesheet entry management
- Database: Azure SQL DB (serverless) with employee time tracking
- MCP Server: Complete MCP server with timesheet-specific capabilities
- Web UI: Simple timesheet logging interface
- Smart Chat: Azure OpenAI integration with intent detection
- MCP Discovery: Automatic discovery of server capabilities
- Multi-Protocol: Supports tools, prompts, and resources from both servers
- Web UI: Enhanced interface showcasing all MCP features
leave_app/
api/ # FastAPI REST API for leave management
mcp_server/ # Complete MCP server (tools, prompts, resources)
web/ # Interactive web UI for leave operations
sql/ # Database schema and seed data
timesheet_app/
api/ # FastAPI REST API for timesheet management
mcp_server/ # Full MCP server implementation
web/ # Timesheet logging web interface
sql/ # Database schema and seed data
chat_client/
api/ # Enhanced chat client with MCP discovery
web/ # Rich web UI showcasing all MCP capabilities
requirements.txt # Python dependencies
.dockerignore # Docker build optimization
*/Dockerfile.* # Containerization for each service
# 1. Setup Python environment
python -m venv .venv
source .venv/bin/activate # Linux/Mac
pip install -r requirements.txt
# 2. Run services locally (separate terminals)
uvicorn leave_app.api.main:app --port 8001 --reload
uvicorn leave_app.mcp_server.server:app --port 8011 --reload
uvicorn timesheet_app.api.main:app --port 8002 --reload
uvicorn timesheet_app.mcp_server.server:app --port 8012 --reload
uvicorn chat_client.api.main:app --port 8000 --reload
# 3. Open http://localhost:8000 for the enhanced chat interface
- Tools: "Apply leave 2025-08-20 to 2025-08-22" or "Log 8 hours on 2025-08-20"
- Prompts: "Generate leave request email" or "Create timesheet reminder"
- Resources: "Show leave policy" or "Get project codes list"
- Discovery: Click "Discover MCP Capabilities" to see all available features
POST /mcp/tools/apply_leave
- Submit leave requestsGET /mcp/tools/get_balance
- Check leave balancesPOST /mcp/tools/add_timesheet_entry
- Log work hoursGET /mcp/tools/list_timesheet_entries
- Retrieve timesheet data
GET /mcp/prompts/list
- Discover available promptsPOST /mcp/prompts/get
- Generate customized content- Examples: leave_request_email, timesheet_reminder, policy_summary
GET /mcp/resources/list
- Browse available resourcesPOST /mcp/resources/read
- Access specific content- Examples: leave policies, project codes, best practices, reports
- Containers: Docker images built with Azure Container Registry
- Hosting: Azure Web Apps for Containers with Linux
- Databases: Azure SQL DB (serverless) with automatic scaling
- AI: Azure OpenAI for intelligent chat interactions
- Security: Managed Identity with role-based access control
Set these environment variables for full functionality:
# Database connections
LEAVE_DATABASE_URL="azure-sql-connection-string"
TIMESHEET_DATABASE_URL="azure-sql-connection-string"
# MCP server URLs
LEAVE_MCP_URL="https://leave-mcp.azurewebsites.net"
TIMESHEET_MCP_URL="https://timesheet-mcp.azurewebsites.net"
# Azure OpenAI (optional for enhanced chat)
AZURE_OPENAI_ENDPOINT="https://your-aoai.openai.azure.com/"
AZURE_OPENAI_KEY="your-api-key"
AZURE_OPENAI_DEPLOYMENT="gpt-4o-mini"
- Complete MCP Implementation: First demo showcasing tools, prompts, AND resources
- Real-World Use Cases: Practical workplace scenarios with actual business logic
- Intelligent Chat: Azure OpenAI integration with intent detection and fallback heuristics
- Auto-Discovery: Dynamic MCP capability discovery and presentation
- Production Ready: Containerized with Azure deployment, security, and monitoring
MIT
For detailed Azure deployment steps, see Azure_setup.md.
- The full MCP Workshop (Labs 1–4, concepts-first then commands) is available at
docs/index.md
and on GitHub Pages when enabled.- Quick link in this repo: docs/index.md
- GitHub Pages URL (after enabling Pages for /docs): https://.github.io//