flight-mcp
✈️ Flight MCP Server — SQLite Demo
완전한 기능을 갖춘 Model Context Protocol (MCP) 데모 서버로, 시레이션된 항공편 검색 및 예약 기능을 제공합니다.
[!WARNING] 시레이션 전용: 이 시스템의 모든 항공편, 재고, 예약은 가상/샘플 데이터를 사용하는 순수 시레이션입니다. 이 프로젝트는 실제 항 част공사 API와 연동하지 않으며, 실제 항공편을 예약하지 않습니다.
이 프로젝트는 무엇인가요?
이 프로젝트는 Model Context Protocol (MCP)의 기초를 익히기 위해 설계된 간결하고 모듈라인 Python 애플리케이션입니다. 로컬 백엔드 서버로 동작하여 Claude Desktop에 원활하게 연결되며, AI가 로컬 SQLite 데이터베이스에 안전하고 제어된 접근을 통해 데모 항공편을 탐색하고 예약할 수 있게 합니다.
Related MCP server: SQLite MCP Server
MCP란 무엇인가요?
**Model Context Protocol (MCP)**는 AI 모델(예: Claude)이 로컬 또는 원격 데이터 소스, 도구, 서비스에 안전하게 연결할 수 있게 하는 오린 표준입니다. MCP는 LLM?지 데터를 추측하거나 환각하는 대신, 결정론적인 백엔드 시스템을 조의할 수 있게 합니다.
Architecture
아키텍처
시스템 아키텍처는 깔끄하고 계층화된 접근법을 따ȅ니다:
Claude Desktop (Client)
↓ (stdio JSON-RPC)
Python Flight MCP Server
↓
Services Layer (Business Logic)
↓
SQLite Database (Data Store)기술 스택
Language: Python 3.11+
패키지 관리자:
uv프레임워크: MCP 공식 Python SDK (
mcp)데이터베이스: SQLite (로컬 파일)
클라이언트: Claude Desktop
6가지 Available tools
서버는 AI에게 정확히 여섯 가지 안정한 MCP 도구를 노출합니다:
search_flights: 출발지, 목적지, 날짜로 이용 가능한 항공편을 검색합니다.
get_flight: 특정 항공편의 전체 정보와 메타데이터를 조회합니다.
check_seats: 항공편의 실시간 좌석 가능 여부를 조회합니다.
book_flight: 새 시레이션 예약을 생성합니다(사용자 확정이 필요).
get_booking: PNR `참조로 기존 예약 정보를 조회합니다.
cancel_book: 예약 예약을 취소하고 좌석 매대를 회복합니다.
SQLite DB Demo
시스템은 로컬 SQLite 데이더베이스 (조지/data/flightmcp.db)을 사용하여 항공편 재고와 예약 상태를 저장합니다.
참고: 실제 .db 파일은 버전 관리에서 제외되어, 나중에 발생할 "stale state" 이슈를 방지합니다.
데이터베이스를 데모 데이터로 초기화하려면:
uv run python scripts/seed_database.py설치 및 설정
q가 설치되어 있는지 확인하고, 의존성을 동기화하려면:
uv sync테스트 실행
프로젝트를 포함한 강력한 pytest로 하여 백엔드를 검증합니다.
uv run pytestRunning MCP Server
서버가 정확하게 실행되는지 수동으로 확정하려면(서버는 차단되고 stdio 신호를 대비):
uv run flight-mcp(애플리케이션 로고는 stdout의 MCP 프로토콜 출력이 깨끄하게 할 수 있도록 반드시 stderr로 라우팅됩니다.)
Configuration of Claude
이 MCP 서버를 Claude Desktop에 연결하려면, Claude Desktop 구성 파일(macOS에서 일반 ~/Library/Application Support/Claude/claude_desktop_config.json 위치)을 수명해야 합니다.
프로젝트 "Claude Desktop" 설정 예시:
{
"mcpServers": {
"flight-mcp": {
"command": "/opt/homebrew/bin/uv",
"args": [
"run",
"--directory",
"/Users/baratharjun/Desktop/medai",
"flight-mcp"
],
"cwd": "/Users/baratharjun/Desktop/medai"
}
}
}참고: 절대 경로를 로컬 프로젝트 디렉토리와 uv 설치 경로에 맞게 조정하세요.
시용 예시
Claude Desktop에 연결되어 있으면 자연 중:
사용자: "2026-09-05에 Chennai에서 델리가는 항공편을 찾아 주세요."
Claude가 search_flights를 호출하고 SQLite 데이터베이스에서 영는 합니다.
사용자: "1번 항공편에 남은 좌성이 다음 몇 개인가요?"
Claude가 check_seats를 호출합니다.
사용자: "1번 항공편 예약하고 시프다. 제 이름은 Test User, 이메일 test@example.com, 전화번호 9999999999입니다." Claude는 요청을 요약하며 명확하게 자인을 요청합니다.
사용자: "확인했습니다."
Claude가 book_flight를 호출하고, 가상[가상]의 booking "예: FLM-XXXXXX" 를 반환합니다.
Available Tools
6 toolsbook_flightA
Create a simulated flight booking in the local SQLite database. This does NOT purchase a real airline ticket or process payment. Use this ONLY after receiving explicit user confirmation to book.
| Name | Required | Description | Default |
|---|---|---|---|
| flight_id | Yes | ||
| seat_number | No | ||
| passenger_name | Yes | ||
| passenger_email | Yes | ||
| passenger_phone | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure. It explicitly states the simulation nature and lack of real payment, which is crucial for agents to avoid misunderstanding. It does not describe side effects such as persistence details, return values, or error conditions, but the key behavioral caveat is clearly disclosed.
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?
The description is two sentences with no wasted words. The core action and destination are front-loaded, and the critical caveat about simulation follows immediately. That is optimal structure for an agent scanning rapidly.
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?
For a mutation tool with 5 parameters, no annotations, and no output schema, the description is adequate but incomplete. It tells what it does and the confirmation requirement, but does not mention expected return values, handling of invalid flight_id, or any side effects beyond the simulation note. An agent would likely need to infer or make extra calls to handle errors.
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?
Schema description coverage is 0%, so the description must compensate by explaining parameter meanings. It mentions zero parameters. Although the names (flight_id, passenger_name, passenger_email, passenger_phone, seat_number) are self-explanatory, the description adds no semantic value beyond the schema, failing to clarify requiredness, formats, or relationships between parameters.
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?
The description starts with a clear verb-object pair: 'Create a simulated flight booking in the local SQLite database.' It immediately distinguishes itself from a real purchase by stating 'This does NOT purchase a real airline ticket or process payment.' This specificity differentiates it from siblings like search_flights, get_booking, and cancel_booking, making the tool's role unambiguous.
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?
The description provides an explicit precondition: 'Use this ONLY after receiving explicit user confirmation to book.' This is a clear 'when-to-use' rule. However, it does not mention when not to use (beyond the implied no-real-purchase) or point to alternative tools for scenarios like searching or checking seats, so it lacks the full set of alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
cancel_bookingB
Cancel a simulated booking and restore the seat availability.
| Name | Required | Description | Default |
|---|---|---|---|
| booking_reference | Yes |
TDQS
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 mentions the effect on seat availability, but does not explain what happens to the booking record, whether the operation is idempotent, what error conditions exist, or any authentication requirements. For a mutation tool, this is a minimal disclosure.
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?
The description is one concise sentence with no redundant information. It is front-loaded with the core action and outcome, making it efficient for an agent to parse quickly.
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?
The description is sparse for a tool with no annotations and no output schema. It does not mention what happens on success (e.g., confirmation, return value), how to handle invalid references, or what state changes occur beyond seat availability. An agent would need additional context to call it correctly and interpret the result.
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?
The schema has zero description coverage, and the description does not explain the booking_reference parameter at all. It gives no indication of the expected format, source, or context of this identifier. The agent is left entirely to infer its purpose from the parameter name alone, which is insufficient.
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?
The description states a specific verb ('cancel'), a resource ('booking'), and an explicit outcome ('restore the seat availability'). It clearly distinguishes itself from siblings like book_flight and get_booking, leaving no ambiguity about its function.
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?
The usage is implied by the verb 'cancel' and the sibling list, but the description does not explicitly state when to use this tool versus alternatives, nor does it mention any prerequisites or exclusion conditions. It provides no direct guidance beyond the inherent meaning of the operation.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
check_seatsB
Check currently available seats for a demo flight.
| Name | Required | Description | Default |
|---|---|---|---|
| flight_id | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations exist, so the description carries the full burden. It only says 'Check currently available seats', which implies a read-only operation but does not disclose side effects, return format, error conditions, or rate limiting. For a tool with zero annotation coverage, this is insufficiently transparent.
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?
The description is a single, compact sentence that conveys the essential action without fluff. Every word earns its place, and the core purpose is front-loaded.
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?
For a single-parameter read tool with no output schema, the description provides the core functionality. It misses a note on return values (e.g., count vs. list) and any usage context, but is largely adequate for an agent to call correctly. The absence of annotations and output schema makes it slightly incomplete, but not severely.
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?
The schema has no description for flight_id (0% coverage), so the description must clarify it. The phrase 'for a demo flight' adds a qualifier but does not explicitly state that flight_id identifies the flight. It partially compensates by linking the parameter to the flight context, but omits details like expected format or examples.
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?
The description clearly states the task: checking currently available seats for a flight, with a specific verb and resource. However, it does not explicitly differentiate from sibling tools like get_flight or book_flight, though the involvement of seats is unique enough that this is minor.
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?
No guidance is provided on when to use this tool versus alternatives. There is no mention of prerequisites (e.g., must have a valid flight ID) or context like 'use before booking'. The intended use is only implied by the verb 'check'.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_bookingA
Retrieve a simulated booking by its reference code (e.g. FLM-XXXXXX).
| Name | Required | Description | Default |
|---|---|---|---|
| booking_reference | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
The only behavioral information is the word 'simulated', which describes the data nature, not the operation. It does not disclose read-only status, error behavior, or side effects. With no annotations, the description carries the full burden and falls short.
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?
One sentence, front-loaded with the action and scope, zero waste. The format example is embedded efficiently.
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?
For a single-parameter retrieval tool, it is mostly adequate, but it omits any mention of the return shape or error cases (e.g., not-found behavior). Given no output schema and no annotations, a bit more detail would help, but the low complexity mitigates the gap.
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?
Schema coverage is 0%, but the description provides a concrete example format 'FLM-XXXXXX' which gives the agent a template for the booking_reference parameter, adding value beyond the schema's bare type.
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?
States a specific verb (Retrieve), resource (booking), and method (by reference code). It clearly distinguishes from book_flight and cancel_booking based on the action.
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?
Implies usage when you have a booking reference code, but does not explicitly contrast with siblings or mention when not to use it. The condition (having a reference) is clear enough, but no alternatives are named.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_flightA
Retrieve complete information for one fictional flight by its ID.
| Name | Required | Description | Default |
|---|---|---|---|
| flight_id | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It indicates a read operation ('Retrieve') and adds 'fictional' to set expectations about data context, but it doesn't disclose error behavior, response format, or any side effects beyond that. For a simple get-by-id tool, this is adequate but minimal; it doesn't go beyond what the name implies.
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?
The description is a single, front-loaded sentence that efficiently communicates the tool's purpose without redundant words. Every word adds value, and it is immediately clear what the tool does.
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?
Given there is no output schema and no annotations, the description should explain what 'complete information' entails and any prerequisites. It says the flight is fictional, which sets expectations, but it doesn't describe the structure of the returned flight data or any potential errors (e.g., not found). For a tool with one simple parameter, this is minimally acceptable but not comprehensive.
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?
The schema has 0% coverage for the only parameter, flight_id. The description says 'by its ID,' which clarifies that flight_id is the identifier, but it doesn't provide format, constraints, or an example. This partially compensates for the schema gap but doesn't fully clarify what values are acceptable or how to obtain a valid ID (e.g., via search_flights).
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?
The description states a specific verb ('Retrieve'), a resource ('flight'), and the key discriminator (by ID). This clearly distinguishes it from sibling tools like search_flights (which finds flights) and get_booking (which retrieves bookings). No ambiguity exists.
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?
The description implies when to use the tool: when you have a flight_id and want its complete information. It doesn't explicitly mention alternatives or exclusions, but the context is clear enough that an agent would know to use this over search_flights when an identifier is already known. However, it lacks an explicit statement like 'use this when you have an ID, use search_flights to find flights.'
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_flightsB
Search the local sample flight inventory. This tool returns fictional/demo flight options and is not connected to live airline availability.
| Name | Required | Description | Default |
|---|---|---|---|
| date | Yes | ||
| origin | Yes | ||
| airline | No | ||
| max_price | No | ||
| destination | Yes | ||
| preferred_time | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations are absent, so the description carries the full burden. It honestly discloses that results are fictional and not connected to live availability, which is valuable. However, it omits other behavioral details like error handling, pagination, or read-only status. Given that the key caveat is present, a 3 is appropriate.
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?
Two concise sentences with no redundancy. The action is front-loaded, and the demo disclaimer is clearly stated. Every word adds value, making it a model of conciseness.
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?
For a search tool with an output schema, the description covers the core purpose and the crucial fake-data caveat. However, it lacks guidance on when to use this tool versus fetching a specific flight (get_flight), and does not mention search result behavior. This is adequate but with clear gaps, so a 3 is justified.
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?
Schema description coverage is 0%, and the description provides no parameter-level meaning beyond what the parameter names already suggest (origin, destination, date, etc.). The description does not compensate for the lack of schema descriptions, so it earns a 2.
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?
The description states a clear verb ('Search') and a specific resource ('the local sample flight inventory'), and clarifies the fictional/demo nature. It distinguishes itself from live booking systems but does not explicitly differentiate from sibling tools like get_flight, so it earns a 4 rather than a 5.
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?
No guidance is provided on when to use this tool versus the siblings (e.g., get_flight for a specific flight). The 'local sample' phrasing implies a demo/testing context, but there is no explicit when-to-use or when-not-to-use guidance, resulting in a score of 2.
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.
6 tool updates
v0.1.0- First observed
book_flight - First observed
cancel_booking - First observed
check_seats - First observed
get_booking - First observed
get_flight - First observed
search_flights
TDQS
Scored across 6 tools
Each tool addresses a distinct resource and action: flight search, flight detail, seat availability, booking creation, booking retrieval, and booking cancellation. There is no ambiguity between tool purposes.
All tool names follow a consistent snake_case verb_noun pattern (search_flights, get_flight, check_seats, book_flight, get_booking, cancel_booking). Naming is uniform and predictable.
With 6 tools covering search, inspection, seat checking, booking, retrieval, and cancellation, the count is well-scoped for a demo flight booking server. Each tool earns its place without excess.
The core booking lifecycle is covered (search, read, book, retrieve, cancel). Minor gaps exist, such as no update booking or list bookings, but these are not critical for the demo scope and agents can work around them.
Maintenance
Related MCP Connectors
Search award flights and cash fares, optimize points, and predict fares inside ChatGPT and Claude.
Flight search MCP server providing search, pagination, and itinerary details for AI assistants.
Search and compare flight offers through a cache-aware Streamable HTTP MCP server for AI agents.
Plan trips directly into TravelOwl from a conversation with Claude.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceProvides Claude Desktop with secure access to multiple database connections, allowing users to query MySQL, PostgreSQL, SQLite, and SQL Server databases directly through natural language.-
- AlicenseNot gradedqualityDmaintenanceEnables natural language interaction with local SQLite databases through Claude Desktop, translating plain English queries into SQL for data analysis and exploration.3MIT
- AlicenseNot gradedqualityDmaintenanceEnables natural language querying of SAP flight data (airlines, flights, bookings) using Claude Code, with 19 tools for model introspection, SQL queries, and analytics.1-
- FlicenseNot gradedqualityDmaintenanceEnables querying and managing a CRM database through natural language conversations with Claude Desktop.-