The Travel Impact Model (TIM) API supports the Model Context Protocol (MCP),
an open standard designed for AI agents and Large Language Models (LLMs) to
interact with APIs and tools. By using the MCP endpoint, AI agents can
dynamically discover and use the TIM API's capabilities to calculate flight
emissions.

For more information about the protocol, see the [Model Context Protocol Specification](https://modelcontextprotocol.io/).

## Endpoint

The MCP endpoint for the Travel Impact Model API is:

    https://travelimpactmodel.googleapis.com/mcp

All MCP interactions are conducted by sending JSON-RPC 2.0 POST requests to this
endpoint.

## Authentication

The MCP endpoint uses the same authentication methods as the standard Travel
Impact Model API. You must provide a [valid API key](https://docs.cloud.google.com/docs/authentication/api-keys)
from your Google Cloud project, ensuring the "Travel Impact Model API" is
enabled.

## Core MCP Methods

Interactions with the MCP endpoint primarily use two methods:

- `tools/list`: Discovers the available tools, their descriptions, and their input/output JSON schemas.
- `tools/call`: Executes a specific tool with the given arguments.

### Available Tools

The following functionalities are exposed as tools:

- `compute_detailed_flight_emissions`: Retrieves detailed emissions and provides comprehensive data attribution for specific upcoming flights.
- `compute_flight_emissions`: Retrieves detailed emissions for specific upcoming flights.
- `compute_typical_flight_emissions`: Retrieves typical emissions between airport pairs, without requiring specific flight details.
- `compute_scope3_flight_emissions`: Retrieves emissions for historical flights, suitable for Scope 3 reporting.

The exact schemas for inputs and outputs are provided in the `tools/list`
response.

## Integrate with AI Agents

Configure popular AI applications using these instructions. Replace
`YOUR_API_KEY` with your Travel Impact Model API key.

### Gemini CLI

To configure [Gemini CLI](https://docs.cloud.google.com/gemini/docs/codeassist/gemini-cli),
follow these steps:

1. Create an extension file at `~/.gemini/extensions/travel-impact-model/gemini-extension.json`.
2. Save the following content in the file:

       {
         "name": "travel-impact-model",
         "version": "3.0.0",
         "mcpServers": {
           "travel-impact-model": {
             "httpUrl": "https://travelimpactmodel.googleapis.com/mcp",
             "headers": {
               "X-Goog-Api-Key": "YOUR_API_KEY"
             }
           }
         }
       }

3. Launch Gemini CLI by running `gemini` in your terminal.

4. Run `/mcp list` to verify that the `travel-impact-model` server is
   configured and its tools are available.

### Antigravity

To configure [Antigravity](https://antigravity.google/) to use the MCP
server:

1. In Antigravity, click the **Additional options** menu in the Agent pane \> **MCP Servers** \> **Manage MCP Servers**.
2. At the top of the Manage MCP Servers pane that opens, click
   **View raw config** to edit the `mcp_config.json` file:

       {
         "mcpServers": {
           "TravelImpactModel": {
             "serverUrl": "https://travelimpactmodel.googleapis.com/mcp",
             "headers": {
               "X-Goog-Api-Key": "YOUR_API_KEY"
             }
           }
         }
       }

3. Return to **Manage MCP servers** and click **Refresh**.

## Example Interactions

Once configured, you can interact with the TIM API through your AI agent using
natural language.
> **User:** What is the emissions for flight LX 52 from Zurich to Boston?
>
> **Agent:** The projected carbon emissions per passenger for Swiss
> International Air Lines flight LX 52 from Zurich (ZRH) to Boston (BOS) for
> today, March 25, 2026, are as follows:
>
> - **Economy:** 354.10 kg CO2e
> - **Premium Economy:** 531.14 kg CO2e
> - **Business:** 1,416.38 kg CO2e
> - **First:** 1,770.48 kg CO2e
>
> This flight has a moderate projected contrails impact.
> **User:** What is the typical emissions from Zurich to Boston?
>
> **Agent:** The typical carbon emissions per passenger for a flight from Zurich
> (ZRH) to Boston (BOS) are as follows:
>
> - **Economy:** 415.41 kg CO2e
> - **Premium Economy:** 582.00 kg CO2e
> - **Business:** 1,473.95 kg CO2e
> - **First:** 1,817.35 kg CO2e