gtfs-one-mcp 1.3.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.
@@ -0,0 +1,229 @@
1
+ /**
2
+ * Response shapes for the GTFS One REST API (`/wp-json/gtfs-one/v1/*`).
3
+ *
4
+ * These mirror the actual JSON returned by a live GTFS One site (verified against
5
+ * a production install), not the idealized shapes in the spec — where they differ,
6
+ * reality wins. Notably: `/stops/search` and `/stops/nearby` wrap results in a
7
+ * `stops` array, and RT vehicles use `id`/`next_eta`/`next_stop` (not the
8
+ * `vehicle_id`/`speed` the spec sketches).
9
+ */
10
+ export interface Feed {
11
+ id: string;
12
+ name: string;
13
+ url: string;
14
+ active: boolean;
15
+ logo?: number;
16
+ rt_vehicles?: string;
17
+ rt_trips?: string;
18
+ rt_alerts?: string;
19
+ }
20
+ /** One route serving a stop, with its next scheduled departure times. */
21
+ export interface RouteAtStop {
22
+ route_id: string;
23
+ name: string;
24
+ color: string;
25
+ url?: string;
26
+ next: string[];
27
+ }
28
+ export interface NearbyStop {
29
+ id: string;
30
+ name: string;
31
+ code: string;
32
+ lat: number;
33
+ lon: number;
34
+ distance_m: number;
35
+ distance_text: string;
36
+ is_timepoint: boolean;
37
+ routes: RouteAtStop[];
38
+ }
39
+ export interface NearbyStopsResponse {
40
+ stops: NearbyStop[];
41
+ }
42
+ export interface SearchStop {
43
+ id: string;
44
+ name: string;
45
+ code: string;
46
+ lat: number;
47
+ lon: number;
48
+ label: string;
49
+ type: string;
50
+ }
51
+ export interface SearchStopsResponse {
52
+ stops: SearchStop[];
53
+ }
54
+ export interface Departure {
55
+ route_id: string;
56
+ name: string;
57
+ color: string;
58
+ url?: string;
59
+ headsign: string;
60
+ time: string;
61
+ minutes: number;
62
+ }
63
+ export interface DeparturesResponse {
64
+ stop: {
65
+ id: string;
66
+ name: string;
67
+ code: string;
68
+ };
69
+ departures: Departure[];
70
+ ts: number;
71
+ }
72
+ export interface MapStop {
73
+ id: string;
74
+ name: string;
75
+ code: string;
76
+ lat: number;
77
+ lon: number;
78
+ }
79
+ /** A shape point is a [latitude, longitude] pair. */
80
+ export type ShapePoint = [number, number];
81
+ export interface RouteMapResponse {
82
+ shapes: ShapePoint[];
83
+ stops: MapStop[];
84
+ }
85
+ export interface SystemRoute {
86
+ route_id: string;
87
+ name: string;
88
+ long_name: string;
89
+ color: string;
90
+ shapes: ShapePoint[];
91
+ stops: MapStop[];
92
+ }
93
+ export interface SystemMapResponse {
94
+ routes: SystemRoute[];
95
+ }
96
+ export interface AlertActivePeriod {
97
+ start: number | null;
98
+ end: number | null;
99
+ }
100
+ export interface Alert {
101
+ id: string;
102
+ header: string;
103
+ description: string;
104
+ url: string;
105
+ /** GTFS-RT Cause enum (integer). Translate before showing to a human. */
106
+ cause: number | null;
107
+ /** GTFS-RT Effect enum (integer). */
108
+ effect: number | null;
109
+ /** GTFS-RT SeverityLevel enum (integer). */
110
+ severity: number | null;
111
+ routes: string[];
112
+ stops: string[];
113
+ active_period: AlertActivePeriod[];
114
+ }
115
+ export interface AlertsResponse {
116
+ alerts: Alert[];
117
+ ts?: number;
118
+ }
119
+ export interface Vehicle {
120
+ id: string;
121
+ lat: number;
122
+ lon: number;
123
+ bearing: number | null;
124
+ route_id: string;
125
+ trip_id: string;
126
+ direction_id: number | null;
127
+ stop_id: string | null;
128
+ status: number | null;
129
+ timestamp: number | null;
130
+ route_name: string;
131
+ color: string;
132
+ direction: string | null;
133
+ next_stop: string | null;
134
+ next_eta: number | null;
135
+ }
136
+ export interface VehiclesResponse {
137
+ vehicles: Vehicle[];
138
+ ts?: number;
139
+ }
140
+ export interface GeocodeResponse {
141
+ lat: number;
142
+ lon: number;
143
+ label: string;
144
+ }
145
+ export interface PlanStopRef {
146
+ id: string;
147
+ name: string;
148
+ code?: string;
149
+ lat?: number | null;
150
+ lon?: number | null;
151
+ }
152
+ export interface PlanRoute {
153
+ id: string;
154
+ name: string;
155
+ short_name?: string;
156
+ long_name?: string;
157
+ color?: string;
158
+ text_color?: string;
159
+ }
160
+ export interface PlanFare {
161
+ status: "exact" | "partial" | "unavailable" | "cross_agency";
162
+ total: string | null;
163
+ currency: string;
164
+ by_category?: Record<string, string>;
165
+ note?: string;
166
+ fallback_routes?: string[];
167
+ }
168
+ export interface PlanConnection {
169
+ leg1_arrive: string;
170
+ leg2_depart: string;
171
+ wait_min: number;
172
+ }
173
+ /** One scheduled departure for a route option (with connection detail if a transfer). */
174
+ export interface PlanTime {
175
+ depart: string;
176
+ arrive: string;
177
+ duration_min: number;
178
+ connection?: PlanConnection;
179
+ }
180
+ export interface PlanWalk {
181
+ meters: number;
182
+ display: string;
183
+ minutes: number;
184
+ stop?: PlanStopRef;
185
+ }
186
+ export interface PlanOptionLeg {
187
+ type: "transit";
188
+ route: PlanRoute;
189
+ headsign?: string;
190
+ board_stop: PlanStopRef;
191
+ alight_stop: PlanStopRef;
192
+ intermediate_stops?: number;
193
+ }
194
+ /** One route (or route pair) that connects the origin and destination. */
195
+ export interface PlanOption {
196
+ transfers: number;
197
+ duration_min: number;
198
+ routes: PlanRoute[];
199
+ service_days: string[];
200
+ from_stop?: PlanStopRef | null;
201
+ to_stop?: PlanStopRef | null;
202
+ transfer_at?: PlanStopRef | null;
203
+ access?: PlanWalk | null;
204
+ egress?: PlanWalk | null;
205
+ times: PlanTime[];
206
+ next_service_date?: string | null;
207
+ next_times?: PlanTime[];
208
+ fare: PlanFare;
209
+ legs: PlanOptionLeg[];
210
+ walk_only?: boolean;
211
+ walk?: PlanWalk;
212
+ }
213
+ export interface PlanResponse {
214
+ query?: {
215
+ from?: unknown;
216
+ to?: unknown;
217
+ tz?: string;
218
+ unit_system?: string;
219
+ rider_category?: string;
220
+ };
221
+ date?: string;
222
+ options: PlanOption[];
223
+ reason?: string;
224
+ message?: string;
225
+ next_service_date?: string;
226
+ nearest_stop?: PlanStopRef;
227
+ nearest_stop_distance?: string;
228
+ ts?: number;
229
+ }
package/dist/types.js ADDED
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Response shapes for the GTFS One REST API (`/wp-json/gtfs-one/v1/*`).
3
+ *
4
+ * These mirror the actual JSON returned by a live GTFS One site (verified against
5
+ * a production install), not the idealized shapes in the spec — where they differ,
6
+ * reality wins. Notably: `/stops/search` and `/stops/nearby` wrap results in a
7
+ * `stops` array, and RT vehicles use `id`/`next_eta`/`next_stop` (not the
8
+ * `vehicle_id`/`speed` the spec sketches).
9
+ */
10
+ export {};
11
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG"}
@@ -0,0 +1,7 @@
1
+ {
2
+ "gtfs_one_url": "https://your-agency-site.org",
3
+ "feed_id": "default",
4
+ "cache_ttl_seconds": 30,
5
+ "agency_name": "Your Transit Agency",
6
+ "agency_description": "Public transit serving your service area. Describe the cities, landmarks, and regions covered so the AI knows what this server is for."
7
+ }
package/package.json ADDED
@@ -0,0 +1,58 @@
1
+ {
2
+ "name": "gtfs-one-mcp",
3
+ "version": "1.3.0",
4
+ "description": "Model Context Protocol server for any GTFS One transit site. Lets AI assistants query bus stops, schedules, routes, live vehicle positions, and service alerts from an agency's live GTFS data. Runs locally (stdio) or as a hosted remote connector (Streamable HTTP).",
5
+ "license": "GPL-2.0-or-later",
6
+ "author": "Digital Mountaineers",
7
+ "homepage": "https://github.com/digital-mountaineers/gtfs-one-mcp#readme",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/digital-mountaineers/gtfs-one-mcp.git"
11
+ },
12
+ "bugs": {
13
+ "url": "https://github.com/digital-mountaineers/gtfs-one-mcp/issues"
14
+ },
15
+ "keywords": [
16
+ "mcp",
17
+ "model-context-protocol",
18
+ "gtfs",
19
+ "gtfs-realtime",
20
+ "transit",
21
+ "public-transit",
22
+ "bus",
23
+ "wordpress",
24
+ "claude",
25
+ "ai"
26
+ ],
27
+ "type": "module",
28
+ "bin": {
29
+ "gtfs-one-mcp": "dist/index.js",
30
+ "gtfs-one-mcp-http": "dist/http.js"
31
+ },
32
+ "files": [
33
+ "dist",
34
+ "gtfs-one.config.example.json",
35
+ "README.md",
36
+ "LICENSE"
37
+ ],
38
+ "engines": {
39
+ "node": ">=18"
40
+ },
41
+ "scripts": {
42
+ "build": "tsc",
43
+ "watch": "tsc --watch",
44
+ "start": "node dist/index.js",
45
+ "start:http": "node dist/http.js",
46
+ "prepublishOnly": "npm run build"
47
+ },
48
+ "dependencies": {
49
+ "@modelcontextprotocol/sdk": "^1.29.0",
50
+ "express": "^5.1.0",
51
+ "zod": "^3.23.8"
52
+ },
53
+ "devDependencies": {
54
+ "@types/express": "^5.0.0",
55
+ "@types/node": "^22.10.0",
56
+ "typescript": "^5.7.0"
57
+ }
58
+ }