Skip to main content
Glama
AniketDonode

Leave Manager

by AniketDonode

Leave Manager MCP Server

이 프로젝트는 SQLite로 직원, 휴가 잔액, 휴가 요청을 관리하는 Python MCP 서버입니다.

1. 프로젝트 만들기

PowerShell을 열고 프로젝트 디렉터리를 만듭니다:

mkdir D:\Coding\mcpserver\LeaveManager
cd D:\Coding\mcpserver\LeaveManager

leave_manager_server 안에 uv Python 프로젝트를 만듭니다:

uv init leave_manager_server
cd leave_manager_server
uv add "mcp[cli]>=2.1.1"

이 프로젝트는 Python 3.14 이상이 필요합니다. uv는 pyproject.toml, uv.lock, 그리고 서버를 실행하는 데 사용되는 가상 환경을 만듭니다.

Related MCP server: leave_manager

2. 서버 구현

server.py를 만들고 다음 부분들을 추가합니다:

  1. mcp.server.mcpserver에서 MCPServer를 가져옵니다.

  2. MCPServer("Leave Manager")로 서버를 생성합니다.

  3. Employee 및 LeaveRequest 데이터 모델을 정의합니다.

  4. 절대 경로를 사용하여 server.py 옆에 SQLite 데이터베이스를 만듭니다.

  5. employees 및 leave_requests 테이블을 초기화하고 시작 시 샘플 데이터를 삽입합니다.

  6. 직원 디렉터리 및 휴가 요청에 대한 리소스를 추가합니다.

  7. 휴가 제출 및 승인, 잔액 확인, 대기 중인 승인 목록, 데이터베이스 통계 조회, 직원 추가를 위한 도구를 추가합니다.

  8. __main__ 블록에서 서버를 시작합니다:

if __name__ == "__main__":
		init_database()
		mcp.run()

이 프로젝트는 MCP 2.x를 사용합니다. 이전 MCP 1.x import는 이 종속성에서 작동하지 않습니다:

from mcp.server.fastmcp import FastMCP

작동하는 MCP 2.x 형식은 다음과 같습니다:

from mcp.server.mcpserver import MCPServer

mcp = MCPServer("Leave Manager")

3. 서버 직접 실행

프로젝트 디렉터리에서:

cd D:\Coding\mcpserver\LeaveManager\leave_manager_server
uv run server.py

서버는 MCP 통신에 표준 입력/출력을 사용하므로 MCP 클라이언트가 연결되어 있는 동안 계속 실행됩니다. Ctrl+C를 눌러 중지하세요.

장기 실행 서버를 시작하지 않고 모듈이 올바르게 임포트되는지 확인합니다:

uv run python -c "import server; print('Server import valid')"

4. MCP Inspector로 테스트

지원되는 개발 명령은 다음과 같습니다:

cd D:\Coding\mcpserver\LeaveManager\leave_manager_server
uv run mcp dev server.py

MCP Inspector는 Node.js를 사용합니다. 최신 Inspector를 사용하기 전에 Node.js 22.19.0 이상을 설치하세요. 버전을 확인하는 명령은 다음과 같습니다:

node --version
npm --version

이 Python 프로젝트 디렉터리에는 package.json이 없으므로 npm i를 실행하지 마세요. Inspector에서 네이티브 바인딩 누락을 보고하면 임시 npx 캐시를 지우고 다시 시도하세요:

Remove-Item "$env:LOCALAPPDATA\npm-cache\_npx" -Recurse -Force
uv run mcp dev server.py

5. Claude Desktop 연결

Claude Desktop은 다음 위치에서 구성을 읽습니다:

%APPDATA%\Claude\claude_desktop_config.json

이 서버 항목을 추가하세요. 프로젝트가 다른 위치에 저장된 경우 경로를 바꾸세요:

{
	"mcpServers": {
		"leave-manager": {
			"command": "uv",
			"args": [
				"run",
				"--directory",
				"D:\\Coding\\mcpserver\\LeaveManager\\leave_manager_server",
				"server.py"
			]
		}
	}
}

구성을 저장한 후 Claude Desktop을 다시 시작하세요. 서버는 처음 시작할 때 server.py 옆에 leave_manager.db를 만듭니다.

사용 가능한 MCP 기능

리소스:

  • employees://all

  • employee://{employee_id}

  • leave-requests://all

  • leave-requests://employee/{employee_id}

  • leave-requests://status/{status}

도구:

  • submit_leave_request

  • approve_leave_request

  • check_leave_balance

  • get_pending_approvals

  • get_database_stats

  • add_employee

  • This will add my Config file automatic uv run mcp install server.py --name "leave_manager"

Available Tools

6 tools
add_employeeC

Add a new employee to the system with duplicate checking

NameRequiredDescriptionDefault
nameYes
managerYes
departmentYes
force_createNo
sick_leave_balanceNo
annual_leave_balanceNo

Output Schema

NameRequiredDescription
resultYes

TDQS

C2.6/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full disclosure burden. It reveals one behavioral trait ('duplicate checking'), but does not state what happens when a duplicate is found, whether force_create bypasses that check, what permissions are needed, or whether the operation is reversible. For a mutation tool with zero annotation coverage this is thin.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single front-loaded sentence with no filler. It is efficient, though its brevity borders on under-specification for a six-parameter mutation tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return values need not be described. But with six undocumented parameters, no annotations, and a state-changing operation, the definition leaves major gaps an agent needs before calling it safely.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% across six parameters, so the description is expected to compensate but does not. None of name, manager, department, force_create, sick_leave_balance, or annual_leave_balance are explained, and the vague 'duplicate checking' phrase never connects to force_create.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb ('Add') and resource ('employee'), which is enough to separate it from the leave-management siblings listed. However, it does not explicitly contrast itself with any sibling, so it lands just short of the top band.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no when-to-use guidance, no prerequisites, and no mention of alternatives. The agent learns what the tool does but not the context or conditions for invoking it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

approve_leave_requestD

Approve a leave request

NameRequiredDescriptionDefault
request_idYes
approver_nameYes

Output Schema

NameRequiredDescription
resultYes

TDQS

D1.8/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full behavioral burden, yet it discloses nothing about authorization requirements (who may approve), irreversibility of the state change, side effects such as notifications to the requester, or failure modes for already-decided requests. It only implies a mutation via the word 'Approve'.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness2/5

Is the description appropriately sized, front-loaded, and free of redundancy?

It is short, but that brevity reflects under-specification rather than conciseness: the single phrase duplicates the tool name and earns no additional place in the definition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness1/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a state-changing approval operation with an output schema but zero annotation coverage and zero parameter documentation, the definition omits everything an agent needs — required permissions, effect of approval, idempotency, and the meaning of both required inputs.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% for both parameters, so the description must compensate, but it says nothing about request_id (format, source, where to obtain it) or approver_name (whether it must match an authenticated identity). The two required parameters are entirely undocumented.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose2/5

Does the description clearly state what the tool does and how it differs from similar tools?

The text 'Approve a leave request' is a verbatim human-readable restatement of the tool name approve_leave_request, adding no scope, object detail, or distinguishing information. It does not distinguish this tool from siblings like submit_leave_request or get_pending_approvals beyond the obvious verb.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no when-to-use guidance, no prerequisites, and no reference to alternatives such as get_pending_approvals (which presumably surfaces the requests worth approving). The agent must infer the entire workflow context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

check_leave_balanceC

Check leave balance for an employee

NameRequiredDescriptionDefault
employee_idYes

Output Schema

NameRequiredDescription
resultYes

TDQS

C2.8/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must disclose behavior. It only states the action; it does not mention read-only nature, permissions required, side effects, or whether it returns current or accrued balance. The output schema covers return values, but behavioral traits are absent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single front-loaded sentence with no filler. It is arguably too terse given missing guidance, but from a pure conciseness standpoint it avoids waste.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple one-param read tool, the description covers the core purpose, and the output schema handles return values. Still missing parameter semantics and usage context, leaving an agent to infer format and when to call.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0% for the single employee_id parameter. The phrase 'for an employee' merely restates the parameter name and adds no format, source, or validation detail (e.g., whether it is a UUID or email). It fails to compensate for the coverage gap.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb 'check' and resource 'leave balance' scoped to an employee, making the action clear. It does not explicitly differentiate from siblings like submit_leave_request or approve_leave_request, though the verb implies a read-only query.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No indication of when to use this tool versus alternatives, no prerequisites (e.g., employee must exist), and no mention of related tools. Usage is only implied by the verb.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_database_statsC

Get database statistics

NameRequiredDescriptionDefault

No parameters

Output Schema

NameRequiredDescription
resultYes

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It does not clarify whether this is read-only, what scope of statistics is returned, or any performance/caching considerations, though the verb "Get" weakly implies a read.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single front-loaded sentence with no filler. It is appropriately terse for a zero-parameter call, though the brevity comes at the cost of detail rather than being maximally informative.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return values need not be explained. For a zero-param read tool this is minimally adequate, but the description omits what the statistics cover, which the agent cannot recover from a generic schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool takes zero parameters, so the baseline is 4. The description correctly implies no input is required, and there are no parameter semantics to document.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a generic verb and resource ("Get database statistics"), which is understandable but essentially restates the tool name with no differentiation from siblings and no indication of which statistics or for what entity.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no guidance on when to use this tool, what triggers it, or how it relates to the leave-management siblings. The agent must infer usage entirely.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_pending_approvalsA

Get all pending leave requests that need approval

NameRequiredDescriptionDefault

No parameters

Output Schema

NameRequiredDescription
resultYes

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden. 'Get all' usefully discloses an unfiltered, complete read with no parameters, but it says nothing about required permissions (approver role), scope (own team vs. all), or freshness of results. Adequate but not rich.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single, front-loaded sentence with no filler. Every word contributes to defining the resource and its scope.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple, zero-parameter read tool with an output schema (which covers return values), the description supplies enough to select and invoke it. Only minor gaps around authorization context remain.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool takes zero parameters, so per the baseline there is nothing for the description to disambiguate; the description correctly conveys that no input filtering is available.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb ('Get') and resource ('all pending leave requests that need approval'), and the name/siblings make the scope distinct from approve_leave_request or submit_leave_request. It is clear but relies on the tool name rather than explicit contrast with alternatives.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The phrase 'need approval' implies the usage context (an approver looking at their queue), but there is no explicit when-to-use statement, no mention of prerequisites, and no routing toward alternatives. Usage is only implied.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

submit_leave_requestC

Submit a new leave request

NameRequiredDescriptionDefault
reasonYes
end_dateYes
leave_typeYes
start_dateYes
employee_idYes
days_requestedYes

Output Schema

NameRequiredDescription
resultYes

TDQS

C2.4/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure, but it only implies a mutation ('Submit') without stating permissions required, validation rules, whether approval is triggered, or what happens to existing data. It reveals that a write occurs but nothing about side effects or constraints.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The single sentence is front-loaded and free of filler, but it is under-specified relative to the tool's complexity. Brevity here functions as omission rather than efficiency, since the sentence adds almost nothing beyond the tool name.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return values need not be described, but the input side is severely under-documented: six required parameters with no schema descriptions and no annotation coverage. For a mutation tool that likely interacts with leave balances and approval workflows, the description should convey more context to prevent malformed calls.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters1/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0% and there are six required parameters, yet the description adds no meaning for any of them. It does not explain formats for dates, allowable values for leave_type, the relationship between start_date/end_date and days_requested, or the employee_id semantics.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb ('Submit') and resource ('a new leave request'), making the tool's core action immediately clear. It does not explicitly differentiate itself from siblings like approve_leave_request or check_leave_balance, so an agent must rely on tool names to disambiguate.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description offers no when-to-use guidance, no prerequisites, and no mention of alternatives such as checking leave balance first. It simply restates the action, leaving the agent to infer the appropriate context without help.

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.

  1. 6 tool updatesv0.1.0
    • First observedadd_employee
    • First observedapprove_leave_request
    • First observedcheck_leave_balance
    • First observedget_database_stats
    • First observedget_pending_approvals
    • First observedsubmit_leave_request

TDQS

B3/5.0

Scored across 6 tools

Disambiguation5/5

Each tool has a clearly distinct action and target resource; there is no overlap between submitting, approving, checking balance, listing pending approvals, adding employees, or retrieving stats.

Naming Consistency5/5

All tool names follow a consistent snake_case verb_noun pattern (submit_leave_request, approve_leave_request, etc.), making the set predictable and easy to parse.

Tool Count5/5

Six tools is well within the typical 3-15 range for a focused domain. Each tool earns its place, though get_database_stats is somewhat generic.

Completeness3/5

The leave lifecycle lacks key operations like reject_leave_request, cancel_leave_request, or get_leave_history. Approval without rejection is a notable gap, and employee management only supports addition.

Maintenance

ActivityStale
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers