# OpenSky MCP

> OpenSky provides access to global flight tracking data. Your AI agent can pull real-time aircraft state vectors, map historical flight trajectories, and analyze airport traffic patterns. Use it to monitor cargo movements, track specific planes by ICAO24, or check arrival/departure logs for any major hub.

## Overview
- **Category:** data-analytics
- **Price:** Free
- **Tags:** flight-tracking, ads-b, aviation-data, aircraft-states, historical-flights

## Description

**You're dealing with global air traffic?** This server connects your AI agent directly to a massive, real-time dataset of worldwide flight intelligence. You don't need specialized databases or complex APIs; your agent handles it all. It lets you pull actionable data on everything from cargo movements to specific plane routes. **### Real-Time Tracking & State Analysis**
You can monitor where aircraft are right now, anywhere in the world. Use `get_states` to pull current or near-real-time vectors—that means altitude, speed, and exact position—for any plane globally, or you can narrow the search down to a specific geographic box or time range. When you need to see the full journey of one jet, `get_tracks` maps out the entire sequence of coordinates that define its path.

**Analyzing Historical Movement**
When you're doing historical deep dives, your options are solid. If you need comprehensive logs for a specific window, use `get_flights_all` to pull every flight record within a defined date and time range. For airport activity, the server handles both ends of the trip: `get_flights_by_arrival` fetches records of all planes that landed at any major hub during a given period, while `get_flights_by_departure` gets logs for everything that took off from that same spot over time.

**Focusing on Specific Aircraft**
If you're tracking one specific airframe—say, following a particular cargo plane by its ICAO identifier—you can limit the historical data retrieval using `get_flights_by_aircraft`. This tool gives you the complete record for that single aircraft over time.

**How Your Agent Uses It**
Your AI client doesn't need to know which tool is best; it just needs to know what you want. When you ask, 'Show me all planes near JFK right now,' your agent identifies the intent and runs `get_states`. If you ask, 'What was the flight path of Delta 123 last week?' it calls `get_tracks` using the necessary identifiers. The server executes the call and returns clean, structured data directly to your agent for immediate analysis. You're getting actionable intelligence on air traffic patterns and movement logs without writing a single line of SQL.

## Tools

### get_flights_by_aircraft
Gets the historical flight record for one specific aircraft using its ICAO identifier.

### get_flights_all
Retrieves a list of all flights that occurred within a specified date and time range.

### get_flights_by_arrival
Fetches records of all flights that landed at a particular airport during a given period.

### get_flights_by_departure
Retrieves logs for all flights that took off from a specific airport over time.

### get_states
Pulls current or near-real-time data points on an aircraft's location, velocity, and altitude. It can filter by time range, ICAO24, or geographic box.

### get_tracks
Maps the entire path and sequence of coordinates for one specific flight over its duration.

## Prompt Examples

**Prompt:** 
```
Get the current state vectors for aircraft with ICAO24 'a80c3b'.
```

**Response:** 
```
I've retrieved the state for aircraft a80c3b. It is currently at an altitude of 35,000ft, traveling at 450 knots, with a heading of 270 degrees.
```

**Prompt:** 
```
List all flights departing from Paris Charles de Gaulle (LFPG) in the last 2 hours.
```

**Response:** 
```
I found 12 departures from LFPG in that interval. Notable flights include AF123 to New York and LH456 to Frankfurt. Would you like details on a specific flight?
```

**Prompt:** 
```
Show me the trajectory of aircraft '4b1813' for its most recent flight.
```

**Response:** 
```
Fetching the track data for 4b1813... I have retrieved 150 trajectory points showing the climb, cruise, and descent phases of the flight. The path started at Zurich (LSZH) and ended at London (EGLL).
```

## Capabilities

### Monitor live aircraft positions
Get current state vectors (altitude, velocity, position) for planes globally or within a defined geographic box.

### Analyze full flight paths
Retrieve the complete sequence of coordinates and data points that define a specific aircraft's route.

### Query historical air traffic
Pull comprehensive logs detailing all flights within a specified time window or across multiple criteria.

### Check airport activity logs
Fetch records of planes arriving at or departing from any major international airport using its ICAO code.

### Focus on a single airframe
Limit historical flight data retrieval to track one specific aircraft using its unique identifier (ICAO24).

## Use Cases

### Investigating a delayed cargo shipment
The logistics manager needs to know why Cargo-X is late. They ask their agent, which runs `get_flights_by_aircraft` using the plane's ICAO24. The agent pulls the historical log and determines the delay started 3 hours ago near JFK, pinpointing the exact time of deviation.

### Modeling optimal flight corridors
A data scientist needs to find the best path between two cities avoiding known weather zones. They use `get_tracks` on multiple sample flights and run `get_states` over a geographic bounding box, letting the agent compare hundreds of potential coordinates.

### Checking airport capacity limits
The operations analyst needs to know if an airport can handle peak traffic. They use `get_flights_by_arrival` and `get_flights_by_departure` for the last week, aggregating the counts by hour to spot bottlenecks.

### Global trend spotting
A market researcher wants to see if flight activity increased in Asia after a policy change. They run `get_flights_all`, filtering by specific Asian airports and expanding the time window, yielding data that proves or disproves their hypothesis.

## Benefits

- Real-time visibility: Use `get_states` to instantly know where a plane is—altitude, speed, and position vectors. No more relying on manual radar feeds for status checks.
- Deep log analysis: Need to compare year-over-year traffic? Run `get_flights_all` across massive time ranges to quantify industry trends without complex SQL queries.
- Targeted searches: If you only care about one plane, use `get_flights_by_aircraft`. It filters out all the noise and gives you a clean history for that single airframe.
- Airport traffic flow: Monitoring congestion is simple. Use `get_flights_by_arrival` or `get_flights_by_departure` to quickly assess an airport's current operational load by ICAO code.
- Path reconstruction: The `get_tracks` tool reconstructs the exact journey of a flight, giving you granular data points for route analysis—essential for incident investigation.

## How It Works

The bottom line is, your AI client turns complex aviation database calls into a simple conversational command.

1. First, subscribe to the OpenSky Server on Vinkius and authorize your AI client.
2. Next, tell your agent exactly what you need—whether it's 'the current state of AC-123' or 'all flights into JFK last week.'
3. The agent executes the appropriate tool (like `get_states` or `get_flights_by_arrival`) and gives you structured data immediately.

## Frequently Asked Questions

**How do I find out where a plane is right now using get_states?**
You use `get_states`. Just include the necessary parameters like the aircraft's ICAO24 or a bounding box, and the server returns its real-time position, altitude, and velocity vectors.

**Can get_flights_by_arrival handle multiple airports?**
No. `get_flights_by_arrival` requires you to specify one airport's ICAO code per call. If you need multiple airports, run the tool once for each location and combine the results in your agent.

**What is the difference between get_flights_all and get_states?**
This is key: `get_states` gives you a snapshot of *right now* (or near-real-time). `get_flights_all` pulls logs for an entire time block, showing activity over days or weeks.

**How do I track the route of one plane using get_tracks?**
You pass the unique aircraft ID (ICAO24) to `get_tracks`. The tool returns a sequence of coordinates, which you can then plot or analyze for specific phases like climb or descent.

**How do I limit my search area when running get_states?**
You use a geographic bounding box to narrow the results. Instead of querying globally, you pass min/max latitude and longitude parameters into the tool call. This drastically cuts down on data volume and focuses your analysis on a specific region.

**What do I need to know about rate limits when using get_states?**
If you hit default API limits, your agent will receive an error code. For consistent high-volume queries, enter your OpenSky credentials during setup. This raises your quota and ensures reliable access for large data processing tasks.

**What parameters should I use with get_flights_by_aircraft to retrieve a full year of records?**
You must specify precise start and end dates, including the time zone offset. The tool pulls detailed log entries for that aircraft across the entire period, giving you a complete historical movement profile, not just a summary.

**What data does get_flights_by_departure return besides the flight ID?**
It returns the scheduled departure time, destination ICAO code, and carrier information. This is crucial for logistics planning because it gives context to *why* a plane was supposed to leave that airport at that specific time.

**How can I see all planes currently flying over a specific area?**
Use the `get_states` tool and provide the geographic bounding box using `lamin`, `lomin`, `lamax`, and `lomax` parameters. The agent will return all active aircraft within those coordinates.

**Can I track the exact path a flight took yesterday?**
Yes. First, identify the aircraft's ICAO24 address, then use the `get_tracks` tool with the specific timestamp to retrieve the full trajectory points of that flight.

**Is it possible to list all flights that arrived at London Heathrow (EGLL) today?**
Absolutely. Use the `get_flights_by_arrival` tool, entering 'EGLL' as the airport and providing the Unix timestamps for the start and end of the day.