Leave Management MCP Server
Enables natural language leave management, allowing users to check leave balances, apply for leave, and retrieve leave history via MCP tools.
README
Leave Management MCP Server
An AI-powered Leave Management System built using the Model Context Protocol (MCP).
This project demonstrates how a Large Language Model (LLM) can discover and invoke MCP tools to perform business operations such as checking leave balances, applying for leave, and retrieving leave history through natural language.
Features
- Built using the FastMCP framework
- Streamlit-based AI client
- Gemini API for intelligent tool selection
- SQLite database for persistent data storage
- Dynamic MCP tool discovery using
list_tools() - Natural language interface
Project Structure
.
├── app.py # Streamlit AI Client
├── main.py # MCP Server
├── llm.py # Gemini Integration
├── database.py # SQLite Helper Functions
├── init_db.py # Database Initialization
├── pyproject.toml
├── uv.lock
├── .python-version
├── .env.example
├── README.md
└── .gitignore
Available MCP Tools
get_leave_balanceapply_leaveget_leave_history
Tech Stack
- Python
- Model Context Protocol (MCP)
- FastMCP
- Streamlit
- Gemini API
- SQLite
- uv
Installation
1. Clone the repository
git clone https://github.com/ratankumarthakur/leave-management-mcp
cd leave-management-mcp
2. Install dependencies
uv sync
3. Configure the environment
Create a .env file in the project root.
GEMINI_API_KEY=YOUR_API_KEY
4. Initialize the database
python init_db.py
5. Run the application
streamlit run app.py
Example Queries
Try asking:
- Show leave balance for E001
- Apply leave for E002 on 2026-08-10
- Show leave history for E001
- Apply leave for E001 on 15 September 2026
Architecture
User
│
▼
Streamlit Client
│
▼
Gemini LLM
│
▼
MCP Client
│
▼
MCP Server
│
▼
SQLite Database
How It Works
- The user enters a natural language query.
- The Gemini model selects the appropriate MCP tool.
- The Streamlit client invokes the selected MCP tool.
- The MCP server executes the requested operation.
- Data is read from or written to the SQLite database.
- The result is returned to the client and displayed to the user.
Learning Objective
This project was built to understand the fundamentals of the Model Context Protocol (MCP), including:
- Building an MCP server
- Creating an MCP client
- Dynamic tool discovery
- LLM-driven tool invocation
- Database-backed tool execution
- Developing an AI-powered application using Streamlit
Screenshot
<img width="1919" height="868" alt="Screenshot 2026-08-03 232719" src="https://github.com/user-attachments/assets/12b8c9b2-6d64-415a-8618-64396af69d61" />
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.