Skip to main content
Glama
README.md
# EMS MCP Server

An MCP (Model Context Protocol) server that provides LLM access to the EMS (Event Management System) API for flight data analytics.

## Prerequisites

- **Python 3.11+**
- **[uv](https://docs.astral.sh/uv/)** package manager

## Installation

```bash
git clone <repo-url>
cd ems-mcp

# Create virtual environment
uv venv

# Activate virtual environment
# Windows (cmd):
.venv\Scripts\activate
# Windows (PowerShell):
.venv\Scripts\Activate.ps1
# macOS / Linux:
source .venv/bin/activate

# Install the package
uv pip install -e .
```

This creates an `ems-mcp` executable inside the virtual environment:
- **Windows:** `.venv\Scripts\ems-mcp.exe`
- **macOS / Linux:** `.venv/bin/ems-mcp`

## Configuration

All MCP clients need three values to connect to your EMS server:

| Variable | Description |
|----------|-------------|
| `EMS_BASE_URL` | EMS server URL (e.g. `https://your-ems-server.com`) -- do **not** include `/api` |
| `EMS_USERNAME` | Your EMS username |
| `EMS_PASSWORD` | Your EMS password |

### Claude Code (CLI)

Create a `.mcp.json` file in the project root:

```json
{
  "mcpServers": {
    "ems-mcp": {
      "command": "C:\\absolute\\path\\to\\ems-mcp\\.venv\\Scripts\\ems-mcp.exe",
      "args": [],
      "env": {
        "EMS_BASE_URL": "https://your-ems-server.com",
        "EMS_USERNAME": "your-username",
        "EMS_PASSWORD": "your-password"
      }
    }
  }
}
```

Claude Code reads `.mcp.json` automatically when you open the project directory.

### Claude Desktop

Edit `claude_desktop_config.json`:
- **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
- **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`

Add the server to the `mcpServers` block:

```json
{
  "mcpServers": {
    "ems-mcp": {
      "command": "C:\\absolute\\path\\to\\ems-mcp\\.venv\\Scripts\\ems-mcp.exe",
      "args": [],
      "env": {
        "EMS_BASE_URL": "https://your-ems-server.com",
        "EMS_USERNAME": "your-username",
        "EMS_PASSWORD": "your-password"
      }
    }
  }
}
```

On macOS/Linux, use the Unix-style path to the executable (e.g. `/home/user/ems-mcp/.venv/bin/ems-mcp`).

Restart Claude Desktop after saving changes.

### Gemini CLI

Create `.gemini/settings.json` in the project directory:

```json
{
  "mcpServers": {
    "ems-mcp": {
      "command": "C:\\absolute\\path\\to\\ems-mcp\\.venv\\Scripts\\ems-mcp.exe",
      "args": [],
      "env": {
        "EMS_BASE_URL": "https://your-ems-server.com",
        "EMS_USERNAME": "your-username",
        "EMS_PASSWORD": "your-password"
      }
    }
  }
}
```

## Available Tools

### Discovery
- `list_ems_systems` -- List available EMS systems (start here)
- `list_databases` -- Navigate the database hierarchy
- `find_fields` -- Find fields by keyword (`mode="search"`), browse the field group tree (`mode="browse"`), or BFS-traverse entity-type databases (`mode="deep"`); returns numbered `[N]` references usable directly in other tools
- `get_field_info` -- Get field metadata and discrete value mappings
- `search_analytics` -- Search for time-series analytics by name (altitude, airspeed, etc.)
- `get_result_id` -- (Deprecated) Resolve `[N]` references to full opaque IDs; no longer needed in the standard workflow

### Querying
- `query_database` -- Query flight records with filters, sorting, and aggregation
- `query_flight_analytics` -- Get time-series data for specific flights

### Assets
- `get_assets` -- Get reference data: `asset_type` of `fleets`, `aircraft` (optionally filtered by `fleet_id`), `airports`, or `flight_phases`
- `ping_system` -- Check whether an EMS system is online

## Resources

The server also exposes MCP resources for stable reference data:

- `ems://workflow-guide` -- Discovery-to-query workflow guide
- `ems://systems` -- List of available EMS systems (cached)
- `ems://systems/{system_id}/fleets` -- Fleet catalog for a system (cached)
- `ems://systems/{system_id}/airports` -- Airport reference data (cached)
- `ems://databases/common-fields` -- Index of databases with curated field vocabularies
- `ems://databases/{database_name}/common-fields` -- Curated common fields for a named database (e.g. `FDW Flights`)

## Prompts

Reusable templates that pre-encode multi-step EMS workflows:

- `analyze_flights` -- Discovery -> query -> analytics for a tail number / date range
- `compare_flights` -- Side-by-side time-series comparison between two flight IDs
- `search_flight_parameters` -- Discover available fields by keyword, with entity-database support

## Development

```bash
uv pip install -e ".[dev]"
pytest tests/
```

## Troubleshooting

**401 Unauthorized** -- Check that `EMS_USERNAME` and `EMS_PASSWORD` are correct and that the account has API access.

**Connection errors** -- Verify `EMS_BASE_URL` does **not** include a `/api` suffix. It should be just the server URL (e.g. `https://your-ems-server.com`).

**Server not found by MCP client** -- Make sure the path to the `ems-mcp` executable in your config is an absolute path and that the virtual environment has been created (`uv venv && uv pip install -e .`).

TDQS

A3.9/5.0

Scored across 10 tools

Disambiguation4/5

Most tools have distinct purposes, but there is some overlap between find_fields and search_analytics as both involve searching for metadata with similar arguments (search_text, group_id, max_results). However, their domains (database fields vs. flight analytics) are clearly separated, and the descriptions help clarify their distinct use cases.

Naming Consistency4/5

Tool names follow a consistent verb_noun pattern (e.g., find_fields, get_assets, list_databases), with minor deviations like ping_system (verb_noun but less standard) and get_result_id (deprecated, but fits the pattern). Overall, the naming is predictable and readable across the set.

Tool Count5/5

With 10 tools, the server is well-scoped for interacting with EMS systems, covering essential operations like listing systems, querying databases, retrieving metadata, and accessing flight analytics. Each tool serves a clear purpose without redundancy, making the count appropriate for the domain.

Completeness5/5

The tool set provides comprehensive coverage for flight data analysis, including system discovery (list_ems_systems, ping_system), database navigation (list_databases), field and analytic metadata retrieval (find_fields, get_field_info, search_analytics), asset reference data (get_assets), and core querying (query_database, query_flight_analytics). No obvious gaps exist for the intended workflows.

Maintenance

ActivityInactive
ResponsivenessNo issues