Leave Management MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Leave Management MCP ServerShow leave balance for E001"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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
Related MCP server: leave-manager-mcp
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
└── .gitignoreAvailable 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-mcp2. Install dependencies
uv sync3. Configure the environment
Create a .env file in the project root.
GEMINI_API_KEY=YOUR_API_KEY4. Initialize the database
python init_db.py5. Run the application
streamlit run app.pyExample 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 DatabaseHow 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
Available Tools
3 toolsapply_leaveD
| Name | Required | Description | Default |
|---|---|---|---|
| employee_id | Yes | ||
| leave_dates | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Tool has no description.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Tool has no description.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Tool has no description.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Tool has no description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Tool has no description.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Tool has no description.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_leave_balanceD
| Name | Required | Description | Default |
|---|---|---|---|
| employee_id | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Tool has no description.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Tool has no description.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Tool has no description.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Tool has no description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Tool has no description.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Tool has no description.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_leave_historyD
| Name | Required | Description | Default |
|---|---|---|---|
| employee_id | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Tool has no description.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Tool has no description.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Tool has no description.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Tool has no description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Tool has no description.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Tool has no description.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
3 tool updates
v0.1.0- First observed
apply_leave - First observed
get_leave_balance - First observed
get_leave_history
TDQS
Scored across 3 tools
Each tool covers a distinct aspect: balance inquiry, leave application, and history lookup. There is no overlap or ambiguity between them.
All tool names follow the consistent verb_noun pattern: get_leave_balance, apply_leave, get_leave_history. The naming is clear and predictable.
Three tools are well-scoped for a simple leave management server, covering the core employee-facing actions without unnecessary bloat.
Core leave lifecycle is covered (check balance, apply, view history), but missing operations like cancel or update leave applications are notable gaps.
Maintenance
Related MCP Connectors
- AstrocalOAuthdev.astrocal
AI-native scheduling: check availability, book meetings, cancel and reschedule via MCP
An AI concierge that turns static forms into adaptive AI conversations. From any MCP client.
Let AI agents query data and act across all your business apps via MCP.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables employees to check leave balance, apply for leave, and view leave history through natural language using Claude Desktop.-
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to manage employee leave by checking balances, applying for leave, and viewing history via MCP tools.-
- FlicenseNot gradedqualityCmaintenanceEnables natural-language-based employee leave management including leave balance checks, leave applications, approvals, and history retrieval through an MCP-compatible client.-
- FlicenseBqualityCmaintenanceEnables LLMs to manage employee leave by checking balances, applying for leave, and viewing history.3-