@pipeworx/mcp-mobility-database 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 +160 -0
- package/bin/cli.js +17 -0
- package/package.json +32 -0
- package/server.json +18 -0
- package/src/index.ts +1112 -0
- package/src/server.ts +45 -0
- package/tsconfig.json +18 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Mojibake Inc.
|
|
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,160 @@
|
|
|
1
|
+
# @pipeworx/mobility-database
|
|
2
|
+
|
|
3
|
+
The open catalogue of public-transport data feeds maintained by MobilityData —
|
|
4
|
+
~4,500 GTFS Schedule feeds and ~1,900 GTFS-Realtime feeds across ~70 countries,
|
|
5
|
+
each with the operator's own download URL, licence and bounding box. The
|
|
6
|
+
successor to TransitFeeds.
|
|
7
|
+
|
|
8
|
+
Part of [Pipeworx](https://pipeworx.io) — an MCP gateway connecting AI agents to 1679+ live data sources.
|
|
9
|
+
|
|
10
|
+
## Tools
|
|
11
|
+
|
|
12
|
+
- `mobilitydb_search_feeds(query?, country?, municipality?, provider?, data_type?, include_inactive?, limit?)`
|
|
13
|
+
— find the transit feed for an agency, city or country.
|
|
14
|
+
- `mobilitydb_gtfs_rt_feeds(country?, query?, entity_type?, group_by_agency?, limit?)`
|
|
15
|
+
— realtime feeds (vehicle positions / trip updates / service alerts) with the
|
|
16
|
+
schedule feed each is keyed against.
|
|
17
|
+
- `mobilitydb_feed(feed_id)` — everything the catalogue records about one feed,
|
|
18
|
+
plus its sibling realtime streams and any superseding entry.
|
|
19
|
+
|
|
20
|
+
## Auth
|
|
21
|
+
|
|
22
|
+
Keyless.
|
|
23
|
+
|
|
24
|
+
MobilityData also runs an authenticated REST API at `api.mobilitydatabase.org`,
|
|
25
|
+
which takes a bearer token minted from a refresh token issued on free signup at
|
|
26
|
+
<https://mobilitydatabase.org/sign-up>. This pack deliberately does **not** use
|
|
27
|
+
it and declares no platform key: the catalogue export carries the same feed
|
|
28
|
+
inventory with no credential, and declaring a key env var the gateway does not
|
|
29
|
+
hold un-sinks routing toward a tool that could only refuse. What the
|
|
30
|
+
authenticated API would add is per-version dataset history and MobilityData's
|
|
31
|
+
own validation reports; if that is wanted, `PLATFORM_MOBILITYDB_TOKEN` and the
|
|
32
|
+
code that uses it land together in one change.
|
|
33
|
+
|
|
34
|
+
## Data sources
|
|
35
|
+
|
|
36
|
+
- <https://files.mobilitydatabase.org/feeds_v2.csv> — the catalogue export
|
|
37
|
+
(~6,475 rows including superseded entries).
|
|
38
|
+
|
|
39
|
+
## Traps, verified live 2026-09-17
|
|
40
|
+
|
|
41
|
+
- **It is real CSV, not line-splittable.** Feed names and notes contain commas,
|
|
42
|
+
quotes, CJK text and nested parentheses — `"TC_大有巴士(公總) (Dayou bus (public bus))"`.
|
|
43
|
+
Splitting on `,` puts an operator's contact email in the `data_type` column.
|
|
44
|
+
There is an RFC 4180 parser in `src/index.ts` for exactly this.
|
|
45
|
+
- **One agency publishes three realtime rows**, one per `entity_type`: `vp`
|
|
46
|
+
vehicle positions, `tu` trip updates, `sa` service alerts, each with a
|
|
47
|
+
different URL. Counting "realtime feeds" without collapsing on
|
|
48
|
+
`static_reference` triples the agency count.
|
|
49
|
+
- **A realtime feed is unusable without its schedule feed.** `static_reference`
|
|
50
|
+
names it; realtime trip ids only resolve against that specific GTFS feed.
|
|
51
|
+
- **Some feeds need the CONSUMER's own credential at the transit agency**
|
|
52
|
+
(`urls.authentication_type` 1 or 2, parameter named in
|
|
53
|
+
`urls.api_key_parameter_name`). That credential is between the caller and the
|
|
54
|
+
agency; it is reported so a caller knows before fetching.
|
|
55
|
+
- **`redirect.id` marks a superseded entry** that is still present in the export
|
|
56
|
+
and would otherwise look like a live feed.
|
|
57
|
+
|
|
58
|
+
## Quick Start
|
|
59
|
+
|
|
60
|
+
Add to your MCP client (Claude Desktop, Cursor, Windsurf, etc.):
|
|
61
|
+
|
|
62
|
+
```json
|
|
63
|
+
{
|
|
64
|
+
"mcpServers": {
|
|
65
|
+
"mobility-database": {
|
|
66
|
+
"url": "https://gateway.pipeworx.io/mobility-database/mcp"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### What this endpoint actually serves
|
|
73
|
+
|
|
74
|
+
`tools/list` at `https://gateway.pipeworx.io/mobility-database/mcp` returns the tools in the table
|
|
75
|
+
above **plus the shared Pipeworx meta-tools** — `ask_pipeworx`,
|
|
76
|
+
`discover_tools`, `search_within`, `remember`/`recall` and the rest of the
|
|
77
|
+
gateway-wide set. So the tool count you see is larger than this table: a
|
|
78
|
+
single-pack endpoint currently lists roughly 30 shared tools alongside the
|
|
79
|
+
pack's own. The connection's `initialize` response states its exact scope, and
|
|
80
|
+
is the authoritative answer for a given day.
|
|
81
|
+
|
|
82
|
+
This is deliberate, not multiplexing by accident. The meta-tools are what let a
|
|
83
|
+
scoped connection answer a question this pack does not cover — via
|
|
84
|
+
`ask_pipeworx`, which routes across the whole catalog — without you adding a
|
|
85
|
+
second MCP server. There is currently no way to mount a pack endpoint without
|
|
86
|
+
them; if the extra schemas cost you more context than the routing is worth,
|
|
87
|
+
connect to the full gateway once rather than to several pack endpoints.
|
|
88
|
+
|
|
89
|
+
Or connect to the full Pipeworx gateway to get every pack's tools listed
|
|
90
|
+
directly, instead of just this one's:
|
|
91
|
+
|
|
92
|
+
```json
|
|
93
|
+
{
|
|
94
|
+
"mcpServers": {
|
|
95
|
+
"pipeworx": {
|
|
96
|
+
"url": "https://gateway.pipeworx.io/mcp"
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Both URLs reach the same gateway and the same 1679+ data sources. The
|
|
103
|
+
only difference is which pack's tools are listed **directly**; `ask_pipeworx`
|
|
104
|
+
reaches all of them from either one.
|
|
105
|
+
|
|
106
|
+
## No MCP client? Call it over HTTP
|
|
107
|
+
|
|
108
|
+
```bash
|
|
109
|
+
curl -X POST https://gateway.pipeworx.io/v1/tools/mobilitydb_search_feeds \
|
|
110
|
+
-H 'Content-Type: application/json' \
|
|
111
|
+
-d '{"query":"BART","country":"US","limit":2}'
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
No account needed for the first calls. Inspect any tool: `GET https://gateway.pipeworx.io/v1/tools/mobilitydb_search_feeds`. Find one: `POST https://gateway.pipeworx.io/v1/tools/search_packs` with `{"query":"..."}`.
|
|
115
|
+
|
|
116
|
+
## Standalone (no gateway account)
|
|
117
|
+
|
|
118
|
+
This package also runs as a local stdio MCP server — no Pipeworx account, no
|
|
119
|
+
gateway round-trip:
|
|
120
|
+
|
|
121
|
+
```json
|
|
122
|
+
{
|
|
123
|
+
"mcpServers": {
|
|
124
|
+
"mobility-database": {
|
|
125
|
+
"command": "npx",
|
|
126
|
+
"args": ["-y", "@pipeworx/mcp-mobility-database"]
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Or run it directly to confirm it starts:
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
npx -y @pipeworx/mcp-mobility-database
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
It speaks MCP over stdin/stdout and answers `initialize`/`tools/list`/`tools/call`
|
|
139
|
+
for **only** this pack's tools — none of the shared meta-tools the gateway
|
|
140
|
+
connection above adds. Same source, same tools, no ask_pipeworx routing.
|
|
141
|
+
|
|
142
|
+
## Using with ask_pipeworx
|
|
143
|
+
|
|
144
|
+
Instead of calling tools directly, you can ask questions in plain English —
|
|
145
|
+
this works on the pack endpoint above as well as on the full gateway:
|
|
146
|
+
|
|
147
|
+
```
|
|
148
|
+
ask_pipeworx({ question: "your question about Mobility Database data" })
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
The gateway picks the right tool and fills the arguments automatically.
|
|
152
|
+
|
|
153
|
+
## More
|
|
154
|
+
|
|
155
|
+
- [Docs and guides](https://pipeworx.io/docs)
|
|
156
|
+
- [pipeworx.io](https://pipeworx.io)
|
|
157
|
+
|
|
158
|
+
## License
|
|
159
|
+
|
|
160
|
+
MIT
|
package/bin/cli.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
//
|
|
3
|
+
// Entry point for `npx @pipeworx/mcp-<slug>`.
|
|
4
|
+
//
|
|
5
|
+
// Packs ship as raw TypeScript (no build step — see publish-pack.sh for why:
|
|
6
|
+
// tsx sidesteps every extensionless-import / bare-JSON-import edge case a
|
|
7
|
+
// per-pack tsc build would have to solve one pack at a time). This file
|
|
8
|
+
// registers tsx's ESM loader programmatically, then hands off to src/server.ts,
|
|
9
|
+
// which wraps the pack's {tools, callTool} export in a stdio MCP server.
|
|
10
|
+
//
|
|
11
|
+
// Copied verbatim into every published pack repo by scripts/publish-pack.sh —
|
|
12
|
+
// edit this file, not a per-pack copy.
|
|
13
|
+
import { register } from 'tsx/esm/api';
|
|
14
|
+
|
|
15
|
+
register();
|
|
16
|
+
|
|
17
|
+
await import('../src/server.ts');
|
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@pipeworx/mcp-mobility-database",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "MobilityData's open catalogue of public-transport feeds — ~4,500 GTFS schedule feeds and ~1,900 realtime feeds worldwide, each with the operator's own download URL.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "src/index.ts",
|
|
7
|
+
"types": "src/index.ts",
|
|
8
|
+
"bin": {
|
|
9
|
+
"mcp-mobility-database": "bin/cli.js"
|
|
10
|
+
},
|
|
11
|
+
"keywords": ["mcp", "mcp-server", "model-context-protocol", "pipeworx", "mobility-database"],
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "git+https://github.com/pipeworx-io/mcp-mobility-database.git"
|
|
16
|
+
},
|
|
17
|
+
"scripts": {
|
|
18
|
+
"typecheck": "tsc --noEmit"
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
22
|
+
"tsx": "^4.19.0"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"typescript": "^5.9.3",
|
|
26
|
+
"@cloudflare/workers-types": "^4.20260405.1"
|
|
27
|
+
},
|
|
28
|
+
"pipeworx": {
|
|
29
|
+
"sourceHash": "v1-5b09ff3244dd191d9cdb44a53e8e716cfc9a2fe44a1800e68205358f7295cb04",
|
|
30
|
+
"sourceCommit": "b0fb3c31386cf0256dcf1e2f1b3440435a87ec35"
|
|
31
|
+
}
|
|
32
|
+
}
|
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/mobility-database",
|
|
4
|
+
"title": "Mobility Database",
|
|
5
|
+
"description": "MobilityData's open catalogue of public-transport feeds — ~4,500 GTFS schedule feeds and ~1,900…",
|
|
6
|
+
"version": "0.1.0",
|
|
7
|
+
"websiteUrl": "https://pipeworx.io/packs/mobility-database",
|
|
8
|
+
"repository": {
|
|
9
|
+
"url": "https://github.com/pipeworx-io/mcp-mobility-database",
|
|
10
|
+
"source": "github"
|
|
11
|
+
},
|
|
12
|
+
"remotes": [
|
|
13
|
+
{
|
|
14
|
+
"type": "streamable-http",
|
|
15
|
+
"url": "https://gateway.pipeworx.io/mobility-database/mcp"
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
}
|