@pipeworx/mcp-adsb 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +55 -0
- package/package.json +20 -0
- package/server.json +18 -0
- package/src/index.ts +160 -0
- package/tsconfig.json +14 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Pipeworx
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# mcp-adsb
|
|
2
|
+
|
|
3
|
+
adsb.lol MCP — live aircraft tracking via community ADS-B.
|
|
4
|
+
|
|
5
|
+
Part of [Pipeworx](https://pipeworx.io) — an MCP gateway connecting AI agents to 770+ live data sources.
|
|
6
|
+
|
|
7
|
+
## Tools
|
|
8
|
+
|
|
9
|
+
| Tool | Description |
|
|
10
|
+
|------|-------------|
|
|
11
|
+
|
|
12
|
+
## Quick Start
|
|
13
|
+
|
|
14
|
+
Add to your MCP client (Claude Desktop, Cursor, Windsurf, etc.):
|
|
15
|
+
|
|
16
|
+
```json
|
|
17
|
+
{
|
|
18
|
+
"mcpServers": {
|
|
19
|
+
"adsb": {
|
|
20
|
+
"url": "https://gateway.pipeworx.io/adsb/mcp"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Or connect to the full Pipeworx gateway for access to all 770+ data sources:
|
|
27
|
+
|
|
28
|
+
```json
|
|
29
|
+
{
|
|
30
|
+
"mcpServers": {
|
|
31
|
+
"pipeworx": {
|
|
32
|
+
"url": "https://gateway.pipeworx.io/mcp"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Using with ask_pipeworx
|
|
39
|
+
|
|
40
|
+
Instead of calling tools directly, you can ask questions in plain English:
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
ask_pipeworx({ question: "your question about Adsb data" })
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
The gateway picks the right tool and fills the arguments automatically.
|
|
47
|
+
|
|
48
|
+
## More
|
|
49
|
+
|
|
50
|
+
- [All tools and guides](https://github.com/pipeworx-io/examples)
|
|
51
|
+
- [pipeworx.io](https://pipeworx.io)
|
|
52
|
+
|
|
53
|
+
## License
|
|
54
|
+
|
|
55
|
+
MIT
|
package/package.json
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pipeworx/mcp-adsb",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "adsb.lol MCP — live aircraft tracking via community ADS-B.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "src/index.ts",
|
|
7
|
+
"types": "src/index.ts",
|
|
8
|
+
"keywords": ["mcp", "mcp-server", "model-context-protocol", "pipeworx", "adsb"],
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/pipeworx-io/mcp-adsb"
|
|
13
|
+
},
|
|
14
|
+
"scripts": {
|
|
15
|
+
"typecheck": "tsc --noEmit"
|
|
16
|
+
},
|
|
17
|
+
"devDependencies": {
|
|
18
|
+
"typescript": "^5.7.0"
|
|
19
|
+
}
|
|
20
|
+
}
|
package/server.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
|
|
3
|
+
"name": "io.github.pipeworx-io/adsb",
|
|
4
|
+
"title": "Adsb",
|
|
5
|
+
"description": "adsb.lol MCP — live aircraft tracking via community ADS-B.",
|
|
6
|
+
"version": "0.1.0",
|
|
7
|
+
"websiteUrl": "https://pipeworx.io/packs/adsb",
|
|
8
|
+
"repository": {
|
|
9
|
+
"url": "https://github.com/pipeworx-io/mcp-adsb",
|
|
10
|
+
"source": "github"
|
|
11
|
+
},
|
|
12
|
+
"remotes": [
|
|
13
|
+
{
|
|
14
|
+
"type": "streamable-http",
|
|
15
|
+
"url": "https://gateway.pipeworx.io/adsb/mcp"
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
interface McpToolDefinition {
|
|
2
|
+
name: string;
|
|
3
|
+
description: string;
|
|
4
|
+
inputSchema: {
|
|
5
|
+
type: 'object';
|
|
6
|
+
properties: Record<string, unknown>;
|
|
7
|
+
required?: string[];
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
interface McpToolExport {
|
|
12
|
+
tools: McpToolDefinition[];
|
|
13
|
+
callTool: (name: string, args: Record<string, unknown>) => Promise<unknown>;
|
|
14
|
+
meter?: { credits: number };
|
|
15
|
+
cost?: Record<string, unknown>;
|
|
16
|
+
provider?: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* adsb.lol MCP — live aircraft tracking via community ADS-B.
|
|
21
|
+
*
|
|
22
|
+
* Real-time aircraft positions (altitude, speed, heading) crowdsourced from
|
|
23
|
+
* ADS-B receivers. This is LIVE position data, NOT flight schedules.
|
|
24
|
+
* Keyless public API. Base: https://api.adsb.lol/v2
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
const BASE = 'https://api.adsb.lol/v2';
|
|
29
|
+
const UA = 'pipeworx/1.0 (+https://pipeworx.io)';
|
|
30
|
+
|
|
31
|
+
const tools: McpToolExport['tools'] = [
|
|
32
|
+
{
|
|
33
|
+
name: 'aircraft_near',
|
|
34
|
+
description:
|
|
35
|
+
'Live aircraft tracking: what planes are flying overhead or near a location right now. Returns real-time ADS-B positions (altitude, ground speed, heading, vertical rate) for every aircraft within a radius of a lat/lon point. Use this for "what is flying above me" / "planes near <place>".',
|
|
36
|
+
inputSchema: {
|
|
37
|
+
type: 'object',
|
|
38
|
+
properties: {
|
|
39
|
+
latitude: { type: 'number', description: 'Center latitude in decimal degrees, e.g. 51.5.' },
|
|
40
|
+
longitude: { type: 'number', description: 'Center longitude in decimal degrees, e.g. -0.1.' },
|
|
41
|
+
radius_nm: { type: 'number', description: 'Search radius in nautical miles (default 25, max 250).' },
|
|
42
|
+
},
|
|
43
|
+
required: ['latitude', 'longitude'],
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
name: 'get_aircraft',
|
|
48
|
+
description:
|
|
49
|
+
'Track a specific aircraft by its 24-bit ICAO hex address (e.g. "a835af"). Returns the live ADS-B position (lat/lon, altitude, speed, heading) of that exact airframe if it is currently transmitting. Real-time position data, not schedules.',
|
|
50
|
+
inputSchema: {
|
|
51
|
+
type: 'object',
|
|
52
|
+
properties: {
|
|
53
|
+
hex: { type: 'string', description: "24-bit ICAO hex address, e.g. 'a835af'." },
|
|
54
|
+
},
|
|
55
|
+
required: ['hex'],
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: 'find_by_callsign',
|
|
60
|
+
description:
|
|
61
|
+
'Track a flight by its callsign (e.g. "UAL123"). Returns the live real-time ADS-B position (lat/lon, altitude, ground speed, heading) of the aircraft currently broadcasting that flight callsign. Live position, not a schedule lookup.',
|
|
62
|
+
inputSchema: {
|
|
63
|
+
type: 'object',
|
|
64
|
+
properties: {
|
|
65
|
+
callsign: { type: 'string', description: "Flight callsign, e.g. 'UAL123'." },
|
|
66
|
+
},
|
|
67
|
+
required: ['callsign'],
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
name: 'military_aircraft',
|
|
72
|
+
description:
|
|
73
|
+
'Live military and government aircraft currently being tracked worldwide via ADS-B. Returns real-time positions (lat/lon, altitude, speed, heading) for military/government airframes transmitting right now.',
|
|
74
|
+
inputSchema: { type: 'object', properties: {} },
|
|
75
|
+
},
|
|
76
|
+
];
|
|
77
|
+
|
|
78
|
+
const mapAc = (a: Record<string, unknown>) => ({
|
|
79
|
+
hex: a.hex,
|
|
80
|
+
flight: ((a.flight as string) || '').trim(),
|
|
81
|
+
registration: a.r,
|
|
82
|
+
type: a.t,
|
|
83
|
+
lat: a.lat,
|
|
84
|
+
lon: a.lon,
|
|
85
|
+
alt_baro_ft: a.alt_baro,
|
|
86
|
+
ground_speed_kt: a.gs,
|
|
87
|
+
track_deg: a.track,
|
|
88
|
+
vert_rate_fpm: a.baro_rate,
|
|
89
|
+
squawk: a.squawk,
|
|
90
|
+
category: a.category,
|
|
91
|
+
emergency: a.emergency,
|
|
92
|
+
seen_s: a.seen,
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
interface AdsbResponse {
|
|
96
|
+
ac?: Record<string, unknown>[];
|
|
97
|
+
total?: number;
|
|
98
|
+
now?: number;
|
|
99
|
+
error?: number;
|
|
100
|
+
message?: string;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
async function adsbGet(path: string): Promise<AdsbResponse> {
|
|
104
|
+
const res = await fetch(`${BASE}${path}`, { headers: { Accept: 'application/json', 'User-Agent': UA } });
|
|
105
|
+
if (!res.ok) {
|
|
106
|
+
const message = await res.text().catch(() => '');
|
|
107
|
+
return { error: res.status, message };
|
|
108
|
+
}
|
|
109
|
+
return res.json();
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function reqStr(args: Record<string, unknown>, key: string, example: string): string {
|
|
113
|
+
const v = args[key];
|
|
114
|
+
if (typeof v !== 'string' || !v.trim()) throw new Error(`Required argument "${key}" is missing. Pass a string like ${example}.`);
|
|
115
|
+
return v;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function reqNum(args: Record<string, unknown>, key: string, example: string): number {
|
|
119
|
+
const v = args[key];
|
|
120
|
+
if (typeof v !== 'number' || !Number.isFinite(v)) throw new Error(`Required argument "${key}" is missing. Pass a number like ${example}.`);
|
|
121
|
+
return v;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
async function callTool(name: string, args: Record<string, unknown>): Promise<unknown> {
|
|
125
|
+
switch (name) {
|
|
126
|
+
case 'aircraft_near': {
|
|
127
|
+
const lat = reqNum(args, 'latitude', '51.5');
|
|
128
|
+
const lon = reqNum(args, 'longitude', '-0.1');
|
|
129
|
+
let radius = typeof args.radius_nm === 'number' && Number.isFinite(args.radius_nm) ? args.radius_nm : 25;
|
|
130
|
+
if (radius > 250) radius = 250;
|
|
131
|
+
if (radius < 0) radius = 25;
|
|
132
|
+
const data = await adsbGet(`/lat/${lat}/lon/${lon}/dist/${radius}`);
|
|
133
|
+
if (data.error !== undefined) return data;
|
|
134
|
+
const ac = data.ac || [];
|
|
135
|
+
return { count: ac.length, now: data.now, aircraft: ac.slice(0, 100).map(mapAc) };
|
|
136
|
+
}
|
|
137
|
+
case 'get_aircraft': {
|
|
138
|
+
const hex = reqStr(args, 'hex', "'a835af'").toLowerCase();
|
|
139
|
+
const data = await adsbGet(`/hex/${encodeURIComponent(hex)}`);
|
|
140
|
+
if (data.error !== undefined) return data;
|
|
141
|
+
return { aircraft: (data.ac || []).map(mapAc) };
|
|
142
|
+
}
|
|
143
|
+
case 'find_by_callsign': {
|
|
144
|
+
const callsign = reqStr(args, 'callsign', "'UAL123'");
|
|
145
|
+
const data = await adsbGet(`/callsign/${encodeURIComponent(callsign)}`);
|
|
146
|
+
if (data.error !== undefined) return data;
|
|
147
|
+
return { aircraft: (data.ac || []).map(mapAc) };
|
|
148
|
+
}
|
|
149
|
+
case 'military_aircraft': {
|
|
150
|
+
const data = await adsbGet('/mil');
|
|
151
|
+
if (data.error !== undefined) return data;
|
|
152
|
+
const ac = data.ac || [];
|
|
153
|
+
return { count: ac.length, aircraft: ac.slice(0, 100).map(mapAc) };
|
|
154
|
+
}
|
|
155
|
+
default:
|
|
156
|
+
throw new Error(`Unknown tool: ${name}`);
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export default { tools, callTool, meter: { credits: 1 } } satisfies McpToolExport;
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "ESNext",
|
|
5
|
+
"moduleResolution": "bundler",
|
|
6
|
+
"strict": true,
|
|
7
|
+
"esModuleInterop": true,
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
"outDir": "dist",
|
|
10
|
+
"rootDir": "src",
|
|
11
|
+
"declaration": true
|
|
12
|
+
},
|
|
13
|
+
"include": ["src"]
|
|
14
|
+
}
|