Skip to main content
Glama

✈️ Flight MCP Server — SQLite Demo

このサーバーはPromise完全に機能する**Model Context Protocol(MCP)**のデモンストレーション・サーバーで、シミュレーションによるフライト検索・予約機能を提供します。

[!WARNING] シミュレーション専み: このシステム内のフライト、在庫、予約はすべて架空・サンプル・データによる完全なシミュレーションです。このプロジェクトは実際の航空会社APIとは連携しておらず、実際のフライトの予約を行うことはありません。

プロジェクトとは何か?

このプロジェクトは、Model Context Protocol(MCP)の基礎を理解するために作られた、コンパクトにまとめられたモジュール式Pythonアプリュです。Claude Desktopとシームレスー接続、安全かつ制限されたアクセスでローカルのSQLiteデータベースを参照し、デモ用のフライト検索・予約するバックエンド・サーバーです。

このプロジェクトは、Model Context Protocol (MCP)の基本を学ぶために設計された、クリーンでモジュールのみなPythonアプリであり、Claude Desktop之間にはーバーとして機能し、ローカルのSQLiteデータベースへのアクセスを安全で管理されたAIに提供して、デモ・フライトの検索・予約をします。

Related MCP server: SQLite MCP Server

MCPとは何か?

構簡UnitModel Context Protocol(MCP) は、AIモデル(例:Claude)がローカルまたはリモートのデータソース、ツール、およびサービスに安全に接続できるようにするオープンプロトコルです。LLMがデータを推測・記憶したり現実に並しないことをするのではなく、MCPは決定的なバックエンド・システムにクエリを送れます。

アーキテクチャ

システムのアーキテクチャは、Clean & クリーンな層構造を採りれています。

Claude Desktop (Client)
        ↓ (stdio JSON-RPC)
Python Flight MCP Server
        ↓
Services Layer (Business Logic)
        ↓
SQLite Database (Data Store)

技術スタック

  • 言語: Python 3.11+

  • パッケージ管理者: uv

  • **フレームワーク:**公式MCP Python SDK(mcp)

  • データベース: SQLite(ローカルファイル)

  • クラアント: Claude Desktop

利用可能な6つのツール

サーバーはAIに堅牢な6つのMCPツールを公開します。

  1. search_flights: 出発地・到着地・日付で、利用可能なフライトを検索します。

  2. get_flight: 特定フライトの詳細情報とメタデータを取得します。

  3. check_seats: 座席の空席状況を取得します。

  4. book_flight: 新しいシミュレーション予約を作成します(ユーザーの確認が必要)。

  5. get_booking: PNRを参照して既存の予約詳細を取得します。

  6. cancel_booking: 予約をキャンセルして、座席の在庫を復元します。

SQLite デモデータベース

このサーバーは、ローカルSQLiteデータベース(data/flightmcp.db)にフライト本数・予約状態を保存しています。 注記: 状態の古い問題を防ぐため、実際の .db ファイルは バージョン管理の対象外です。

新しいデータでデモデータを初期化するには、以下のコマンドを実行します:

uv run python scripts/seed_database.py

インストールとセットアップ

uv がインストールしてあることを確認し、依存関係を同期します:

uv sync

テストの実行

プロジェクトには、バックエンドの検証用の堅牢な pytest スイートが含まれています。

uv run pytest

MCPサーバーの起動

サーバーが正しく起動することを手動で確認します(サーバーはプロックして stdio 通信を待機します):

uv run flight-mcp

(アプリケーションのログは stderr の出力専用であり、MCPプロトコルの出力を stdout でクリーンに保ちます。)

Claude Desktop の設定

この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 のインストールパスに合わせて調整してください。)

ツールの利用例

Clade Desktopに接続すると、次の召に口径な対話でやりとりできます。

ユーザー: 「2026-09-05 にチェンナイからデリー行便(デリ)はありますか?」

  • Claude が search_flights を呼ブ出ями、SQLite データべースを照会します。*

ユーザー: 「フライト1の空席は何席ですか?」

  • Claude が check_seats を呼出します。*

ユーザー: 「便1を予約したいです。私はTest User、e-mailは test@example.com、電話は9999です。」 Claude が予約のコンテンに要約し、明示的に確認を求めます。

ユーザー: 「確認しました。」 Claude が book_flight を呼出し、架空の予約参照符(例:111-XXXXXX)を返します。

Available Tools

6 tools
book_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.

NameRequiredDescriptionDefault
flight_idYes
seat_numberNo
passenger_nameYes
passenger_emailYes
passenger_phoneYes

TDQS

A4/5.0
Behavior4/5

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.

Conciseness5/5

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.

Completeness3/5

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.

Parameters2/5

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.

Purpose5/5

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.

Usage Guidelines4/5

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.

NameRequiredDescriptionDefault
booking_referenceYes

TDQS

B3.1/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 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.

Conciseness5/5

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.

Completeness2/5

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.

Parameters1/5

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.

Purpose5/5

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.

Usage Guidelines3/5

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.

NameRequiredDescriptionDefault
flight_idYes

TDQS

B3.2/5.0
Behavior2/5

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.

Conciseness5/5

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.

Completeness4/5

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.

Parameters3/5

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.

Purpose4/5

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.

Usage Guidelines2/5

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).

NameRequiredDescriptionDefault
booking_referenceYes

TDQS

A3.7/5.0
Behavior2/5

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.

Conciseness5/5

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.

Completeness3/5

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.

Parameters4/5

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.

Purpose5/5

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.

Usage Guidelines3/5

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.

NameRequiredDescriptionDefault
flight_idYes

TDQS

A3.9/5.0
Behavior3/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. 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.

Conciseness5/5

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.

Completeness3/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines4/5

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.

NameRequiredDescriptionDefault
dateYes
originYes
airlineNo
max_priceNo
destinationYes
preferred_timeNo

Output Schema

NameRequiredDescription
resultYes

TDQS

B3.1/5.0
Behavior3/5

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.

Conciseness5/5

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.

Completeness3/5

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.

Parameters2/5

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.

Purpose4/5

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.

Usage Guidelines2/5

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.

  1. 6 tool updatesv0.1.0
    • First observedbook_flight
    • First observedcancel_booking
    • First observedcheck_seats
    • First observedget_booking
    • First observedget_flight
    • First observedsearch_flights

TDQS

A3.7/5.0

Scored across 6 tools

Disambiguation5/5

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.

Naming Consistency5/5

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.

Tool Count5/5

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.

Completeness4/5

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.

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    Provides Claude Desktop with secure access to multiple database connections, allowing users to query MySQL, PostgreSQL, SQLite, and SQL Server databases directly through natural language.
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables natural language interaction with local SQLite databases through Claude Desktop, translating plain English queries into SQL for data analysis and exploration.
    3
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables natural language querying of SAP flight data (airlines, flights, bookings) using Claude Code, with 19 tools for model introspection, SQL queries, and analytics.
    1
    -
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables querying and managing a CRM database through natural language conversations with Claude Desktop.
    -