sbb-mcp 0.1.3 → 0.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.
package/LICENSE CHANGED
@@ -1,57 +1,216 @@
1
- # Functional Source License, Version 1.1, MIT Future License
2
-
3
- ## Abbreviation
4
- FSL-1.1-MIT
5
-
6
- ## Notice
7
- Copyright 2026 SwissTrip (F. Weinhappl)
8
-
9
- ## Terms and Conditions
10
-
11
- ### Licensor ("We")
12
- The party offering the Software under these Terms and Conditions.
13
-
14
- ### The Software
15
- The "Software" is each version of the software that we make available under these Terms and Conditions, as indicated by our inclusion of these Terms and Conditions with the Software.
16
-
17
- ### License Grant
18
- Subject to your compliance with this License Grant and the Patents, Redistribution and Trademark clauses below, we hereby grant you the right to use, copy, modify, create derivative works, publicly perform, publicly display and redistribute the Software for any Permitted Purpose identified below.
19
-
20
- ### Permitted Purpose
21
- A Permitted Purpose is any purpose other than a Competing Use. A Competing Use means making the Software available to others in a commercial product or service that:
22
-
23
- 1. substitutes for the Software;
24
- 2. substitutes for any other product or service we offer using the Software that exists as of the date we make the Software available; or
25
- 3. offers the same or substantially similar functionality as the Software.
26
-
27
- Permitted Purposes specifically include using the Software:
28
-
29
- 1. for your internal use and access;
30
- 2. for non-commercial education;
31
- 3. for non-commercial research; and
32
- 4. in connection with professional services that you provide to a licensee using the Software in accordance with these Terms and Conditions.
33
-
34
- ### Patents
35
- To the extent your use for a Permitted Purpose would necessarily infringe our patents, the license grant above includes a license under our patents. If you make a claim against any party that the Software infringes or contributes to the infringement of any patent, then your patent license to the Software ends immediately.
36
-
37
- ### Redistribution
38
- The Terms and Conditions apply to all copies, modifications and derivatives of the Software.
39
-
40
- If you redistribute any copies, modifications or derivatives of the Software, you must include a copy of or a link to these Terms and Conditions and not remove any copyright notices provided in or with the Software.
41
-
42
- ### Disclaimer
43
- THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
44
-
45
- IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES, EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
46
-
47
- ### Trademarks
48
- Except for displaying the License Details and identifying us as the origin of the Software, you have no right under these Terms and Conditions to use our trademarks, trade names, service marks or product names.
49
-
50
- ## Grant of Future License
51
- We hereby irrevocably grant you an additional license to use the Software under the MIT license that is effective on the second anniversary of the date we make the Software available. On or after that date, you may use the Software under the MIT license, in which case the following will apply:
52
-
53
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
54
-
55
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
56
-
57
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1
+ The MCP project is undergoing a licensing transition from the MIT License to the Apache License, Version 2.0 ("Apache-2.0"). All new code and specification contributions to the project are licensed under Apache-2.0. Documentation contributions (excluding specifications) are licensed under CC-BY-4.0.
2
+
3
+ Contributions for which relicensing consent has been obtained are licensed under Apache-2.0. Contributions made by authors who originally licensed their work under the MIT License and who have not yet granted explicit permission to relicense remain licensed under the MIT License.
4
+
5
+ No rights beyond those granted by the applicable original license are conveyed for such contributions.
6
+
7
+ ---
8
+
9
+ Apache License
10
+ Version 2.0, January 2004
11
+ http://www.apache.org/licenses/
12
+
13
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
14
+
15
+ 1. Definitions.
16
+
17
+ "License" shall mean the terms and conditions for use, reproduction,
18
+ and distribution as defined by Sections 1 through 9 of this document.
19
+
20
+ "Licensor" shall mean the copyright owner or entity authorized by
21
+ the copyright owner that is granting the License.
22
+
23
+ "Legal Entity" shall mean the union of the acting entity and all
24
+ other entities that control, are controlled by, or are under common
25
+ control with that entity. For the purposes of this definition,
26
+ "control" means (i) the power, direct or indirect, to cause the
27
+ direction or management of such entity, whether by contract or
28
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
29
+ outstanding shares, or (iii) beneficial ownership of such entity.
30
+
31
+ "You" (or "Your") shall mean an individual or Legal Entity
32
+ exercising permissions granted by this License.
33
+
34
+ "Source" form shall mean the preferred form for making modifications,
35
+ including but not limited to software source code, documentation
36
+ source, and configuration files.
37
+
38
+ "Object" form shall mean any form resulting from mechanical
39
+ transformation or translation of a Source form, including but
40
+ not limited to compiled object code, generated documentation,
41
+ and conversions to other media types.
42
+
43
+ "Work" shall mean the work of authorship, whether in Source or
44
+ Object form, made available under the License, as indicated by a
45
+ copyright notice that is included in or attached to the work
46
+ (an example is provided in the Appendix below).
47
+
48
+ "Derivative Works" shall mean any work, whether in Source or Object
49
+ form, that is based on (or derived from) the Work and for which the
50
+ editorial revisions, annotations, elaborations, or other modifications
51
+ represent, as a whole, an original work of authorship. For the purposes
52
+ of this License, Derivative Works shall not include works that remain
53
+ separable from, or merely link (or bind by name) to the interfaces of,
54
+ the Work and Derivative Works thereof.
55
+
56
+ "Contribution" shall mean any work of authorship, including
57
+ the original version of the Work and any modifications or additions
58
+ to that Work or Derivative Works thereof, that is intentionally
59
+ submitted to the Licensor for inclusion in the Work by the copyright
60
+ owner or by an individual or Legal Entity authorized to submit on behalf
61
+ of the copyright owner. For the purposes of this definition, "submitted"
62
+ means any form of electronic, verbal, or written communication sent
63
+ to the Licensor or its representatives, including but not limited to
64
+ communication on electronic mailing lists, source code control systems,
65
+ and issue tracking systems that are managed by, or on behalf of, the
66
+ Licensor for the purpose of discussing and improving the Work, but
67
+ excluding communication that is conspicuously marked or otherwise
68
+ designated in writing by the copyright owner as "Not a Contribution."
69
+
70
+ "Contributor" shall mean Licensor and any individual or Legal Entity
71
+ on behalf of whom a Contribution has been received by Licensor and
72
+ subsequently incorporated within the Work.
73
+
74
+ 2. Grant of Copyright License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ copyright license to reproduce, prepare Derivative Works of,
78
+ publicly display, publicly perform, sublicense, and distribute the
79
+ Work and such Derivative Works in Source or Object form.
80
+
81
+ 3. Grant of Patent License. Subject to the terms and conditions of
82
+ this License, each Contributor hereby grants to You a perpetual,
83
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
84
+ (except as stated in this section) patent license to make, have made,
85
+ use, offer to sell, sell, import, and otherwise transfer the Work,
86
+ where such license applies only to those patent claims licensable
87
+ by such Contributor that are necessarily infringed by their
88
+ Contribution(s) alone or by combination of their Contribution(s)
89
+ with the Work to which such Contribution(s) was submitted. If You
90
+ institute patent litigation against any entity (including a
91
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
92
+ or a Contribution incorporated within the Work constitutes direct
93
+ or contributory patent infringement, then any patent licenses
94
+ granted to You under this License for that Work shall terminate
95
+ as of the date such litigation is filed.
96
+
97
+ 4. Redistribution. You may reproduce and distribute copies of the
98
+ Work or Derivative Works thereof in any medium, with or without
99
+ modifications, and in Source or Object form, provided that You
100
+ meet the following conditions:
101
+
102
+ (a) You must give any other recipients of the Work or
103
+ Derivative Works a copy of this License; and
104
+
105
+ (b) You must cause any modified files to carry prominent notices
106
+ stating that You changed the files; and
107
+
108
+ (c) You must retain, in the Source form of any Derivative Works
109
+ that You distribute, all copyright, patent, trademark, and
110
+ attribution notices from the Source form of the Work,
111
+ excluding those notices that do not pertain to any part of
112
+ the Derivative Works; and
113
+
114
+ (d) If the Work includes a "NOTICE" text file as part of its
115
+ distribution, then any Derivative Works that You distribute must
116
+ include a readable copy of the attribution notices contained
117
+ within such NOTICE file, excluding those notices that do not
118
+ pertain to any part of the Derivative Works, in at least one
119
+ of the following places: within a NOTICE text file distributed
120
+ as part of the Derivative Works; within the Source form or
121
+ documentation, if provided along with the Derivative Works; or,
122
+ within a display generated by the Derivative Works, if and
123
+ wherever such third-party notices normally appear. The contents
124
+ of the NOTICE file are for informational purposes only and
125
+ do not modify the License. You may add Your own attribution
126
+ notices within Derivative Works that You distribute, alongside
127
+ or as an addendum to the NOTICE text from the Work, provided
128
+ that such additional attribution notices cannot be construed
129
+ as modifying the License.
130
+
131
+ You may add Your own copyright statement to Your modifications and
132
+ may provide additional or different license terms and conditions
133
+ for use, reproduction, or distribution of Your modifications, or
134
+ for any such Derivative Works as a whole, provided Your use,
135
+ reproduction, and distribution of the Work otherwise complies with
136
+ the conditions stated in this License.
137
+
138
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
139
+ any Contribution intentionally submitted for inclusion in the Work
140
+ by You to the Licensor shall be under the terms and conditions of
141
+ this License, without any additional terms or conditions.
142
+ Notwithstanding the above, nothing herein shall supersede or modify
143
+ the terms of any separate license agreement you may have executed
144
+ with Licensor regarding such Contributions.
145
+
146
+ 6. Trademarks. This License does not grant permission to use the trade
147
+ names, trademarks, service marks, or product names of the Licensor,
148
+ except as required for reasonable and customary use in describing the
149
+ origin of the Work and reproducing the content of the NOTICE file.
150
+
151
+ 7. Disclaimer of Warranty. Unless required by applicable law or
152
+ agreed to in writing, Licensor provides the Work (and each
153
+ Contributor provides its Contributions) on an "AS IS" BASIS,
154
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
155
+ implied, including, without limitation, any warranties or conditions
156
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
157
+ PARTICULAR PURPOSE. You are solely responsible for determining the
158
+ appropriateness of using or redistributing the Work and assume any
159
+ risks associated with Your exercise of permissions under this License.
160
+
161
+ 8. Limitation of Liability. In no event and under no legal theory,
162
+ whether in tort (including negligence), contract, or otherwise,
163
+ unless required by applicable law (such as deliberate and grossly
164
+ negligent acts) or agreed to in writing, shall any Contributor be
165
+ liable to You for damages, including any direct, indirect, special,
166
+ incidental, or consequential damages of any character arising as a
167
+ result of this License or out of the use or inability to use the
168
+ Work (including but not limited to damages for loss of goodwill,
169
+ work stoppage, computer failure or malfunction, or any and all
170
+ other commercial damages or losses), even if such Contributor
171
+ has been advised of the possibility of such damages.
172
+
173
+ 9. Accepting Warranty or Additional Liability. While redistributing
174
+ the Work or Derivative Works thereof, You may choose to offer,
175
+ and charge a fee for, acceptance of support, warranty, indemnity,
176
+ or other liability obligations and/or rights consistent with this
177
+ License. However, in accepting such obligations, You may act only
178
+ on Your own behalf and on Your sole responsibility, not on behalf
179
+ of any other Contributor, and only if You agree to indemnify,
180
+ defend, and hold each Contributor harmless for any liability
181
+ incurred by, or claims asserted against, such Contributor by reason
182
+ of your accepting any such warranty or additional liability.
183
+
184
+ END OF TERMS AND CONDITIONS
185
+
186
+ ---
187
+
188
+ MIT License
189
+
190
+ Copyright (c) 2024-2025 Model Context Protocol a Series of LF Projects, LLC.
191
+
192
+ Permission is hereby granted, free of charge, to any person obtaining a copy
193
+ of this software and associated documentation files (the "Software"), to deal
194
+ in the Software without restriction, including without limitation the rights
195
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
196
+ copies of the Software, and to permit persons to whom the Software is
197
+ furnished to do so, subject to the following conditions:
198
+
199
+ The above copyright notice and this permission notice shall be included in all
200
+ copies or substantial portions of the Software.
201
+
202
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
203
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
204
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
205
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
206
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
207
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
208
+ SOFTWARE.
209
+
210
+ ---
211
+
212
+ Creative Commons Attribution 4.0 International (CC-BY-4.0)
213
+
214
+ Documentation in this project (excluding specifications) is licensed under
215
+ CC-BY-4.0. See https://creativecommons.org/licenses/by/4.0/legalcode for
216
+ the full license text.
package/README.md CHANGED
@@ -1,232 +1,153 @@
1
- # sbb-mcp
2
-
3
- [![npm version](https://img.shields.io/npm/v/sbb-mcp.svg)](https://www.npmjs.com/package/sbb-mcp)
4
- [![License: FSL-1.1-MIT](https://img.shields.io/badge/License-FSL--1.1--MIT-blue.svg)](https://fsl.software/)
5
- [![smithery badge](https://smithery.ai/badge/fabsforward2-zhoi/sbb-mcp)](https://smithery.ai/servers/fabsforward2-zhoi/sbb-mcp)
6
-
7
- MCP server for **Swiss Federal Railways** (SBB/CFF/FFS) -- real-time train schedules, prices, and ticket purchase links for any AI assistant.
8
-
9
- Works with Claude Desktop, Claude Code, Cursor, Windsurf, VS Code Copilot, ChatGPT, and any MCP-compatible AI client.
10
-
11
- ## Features
12
-
13
- - **Search stations** -- find any Swiss train station by name
14
- - **Train connections** -- real-time schedules with departure/arrival times, platforms, transfers
15
- - **Ticket prices** -- 1st/2nd class with Half-Fare (Halbtax) and GA travelcard support
16
- - **Purchase links** -- direct deep links to buy tickets on SBB.ch
17
- - **Pagination** -- browse earlier/later connections
18
- - **Trip details** -- intermediate stops, occupancy, platform changes
19
- - **Journey planning** -- built-in prompt for end-to-end trip planning
20
- - **Mock mode** -- works without credentials for testing and demos
21
-
22
- ## Quick Start
23
-
24
- ### Claude Desktop
25
-
26
- Add to your `claude_desktop_config.json`:
27
-
28
- ```json
29
- {
30
- "mcpServers": {
31
- "sbb": {
32
- "command": "npx",
33
- "args": ["-y", "sbb-mcp"],
34
- "env": {
35
- "SMAPI_CLIENT_ID": "your-client-id",
36
- "SMAPI_CLIENT_SECRET": "your-secret",
37
- "SMAPI_SCOPE": "your-scope",
38
- "SMAPI_CONTRACT_ID": "your-contract-id"
39
- }
40
- }
41
- }
42
- }
43
- ```
44
-
45
- ### Claude Code
46
-
47
- ```bash
48
- claude mcp add sbb -- npx -y sbb-mcp
49
- ```
1
+ # MCP Registry
50
2
 
51
- ### Cursor
52
-
53
- Add to `.cursor/mcp.json`:
54
-
55
- ```json
56
- {
57
- "mcpServers": {
58
- "sbb": {
59
- "command": "npx",
60
- "args": ["-y", "sbb-mcp"],
61
- "env": {
62
- "SMAPI_CLIENT_ID": "your-client-id",
63
- "SMAPI_CLIENT_SECRET": "your-secret",
64
- "SMAPI_SCOPE": "your-scope",
65
- "SMAPI_CONTRACT_ID": "your-contract-id"
66
- }
67
- }
68
- }
69
- }
70
- ```
3
+ The MCP registry provides MCP clients with a list of MCP servers, like an app store for MCP servers.
71
4
 
72
- ### Windsurf
73
-
74
- Add to `~/.codeium/windsurf/mcp_config.json`:
75
-
76
- ```json
77
- {
78
- "mcpServers": {
79
- "sbb": {
80
- "command": "npx",
81
- "args": ["-y", "sbb-mcp"],
82
- "env": {
83
- "SMAPI_CLIENT_ID": "your-client-id",
84
- "SMAPI_CLIENT_SECRET": "your-secret",
85
- "SMAPI_SCOPE": "your-scope",
86
- "SMAPI_CONTRACT_ID": "your-contract-id"
87
- }
88
- }
89
- }
90
- }
91
- ```
5
+ [**📤 Publish my MCP server**](docs/modelcontextprotocol-io/quickstart.mdx) | [**⚡️ Live API docs**](https://registry.modelcontextprotocol.io/docs) | [**👀 Ecosystem vision**](docs/design/ecosystem-vision.md) | 📖 **[Full documentation](./docs)**
92
6
 
93
- ### VS Code Copilot
94
-
95
- Add to `.vscode/mcp.json`:
96
-
97
- ```json
98
- {
99
- "servers": {
100
- "sbb": {
101
- "command": "npx",
102
- "args": ["-y", "sbb-mcp"],
103
- "env": {
104
- "SMAPI_CLIENT_ID": "your-client-id",
105
- "SMAPI_CLIENT_SECRET": "your-secret",
106
- "SMAPI_SCOPE": "your-scope",
107
- "SMAPI_CONTRACT_ID": "your-contract-id"
108
- }
109
- }
110
- }
111
- }
112
- ```
7
+ ## Development Status
113
8
 
114
- ### Smithery
9
+ **2025-10-24 update**: The Registry API has entered an **API freeze (v0.1)** 🎉. For the next month or more, the API will remain stable with no breaking changes, allowing integrators to confidently implement support. This freeze applies to v0.1 while development continues on v0. We'll use this period to validate the API in real-world integrations and gather feedback to shape v1 for general availability. Thank you to everyone for your contributions and patience—your involvement has been key to getting us here!
115
10
 
116
- Install via [Smithery](https://smithery.ai/servers/fabsforward2-zhoi/sbb-mcp):
11
+ **2025-09-08 update**: The registry has launched in preview 🎉 ([announcement blog post](https://blog.modelcontextprotocol.io/posts/2025-09-08-mcp-registry-preview/)). While the system is now more stable, this is still a preview release and breaking changes or data resets may occur. A general availability (GA) release will follow later. We'd love your feedback in [GitHub discussions](https://github.com/modelcontextprotocol/registry/discussions/new?category=ideas) or in the [#registry-dev Discord](https://discord.com/channels/1358869848138059966/1369487942862504016) ([joining details here](https://modelcontextprotocol.io/community/communication)).
117
12
 
118
- ```bash
119
- npx @smithery/cli mcp add fabsforward2-zhoi/sbb-mcp
120
- ```
13
+ Current key maintainers:
14
+ - **Adam Jones** (Anthropic) [@domdomegg](https://github.com/domdomegg)
15
+ - **Tadas Antanavicius** (PulseMCP) [@tadasant](https://github.com/tadasant)
16
+ - **Toby Padilla** (GitHub) [@toby](https://github.com/toby)
17
+ - **Radoslav (Rado) Dimitrov** (Stacklok) [@rdimitrov](https://github.com/rdimitrov)
121
18
 
122
- ### Demo Mode (No Credentials)
19
+ ## Contributing
123
20
 
124
- Run without any environment variables to use mock data:
21
+ We use multiple channels for collaboration - see [modelcontextprotocol.io/community/communication](https://modelcontextprotocol.io/community/communication).
125
22
 
126
- ```bash
127
- npx sbb-mcp
128
- ```
23
+ Often (but not always) ideas flow through this pipeline:
129
24
 
130
- This lets you test the MCP server with realistic Swiss station data without SBB API credentials.
25
+ - **[Discord](https://modelcontextprotocol.io/community/communication)** - Real-time community discussions
26
+ - **[Discussions](https://github.com/modelcontextprotocol/registry/discussions)** - Propose and discuss product/technical requirements
27
+ - **[Issues](https://github.com/modelcontextprotocol/registry/issues)** - Track well-scoped technical work
28
+ - **[Pull Requests](https://github.com/modelcontextprotocol/registry/pulls)** - Contribute work towards issues
131
29
 
132
- ## Tools
30
+ ### Quick start:
133
31
 
134
- ### search_stations
32
+ #### Pre-requisites
135
33
 
136
- Search for Swiss train stations by name. Returns station IDs needed for other tools.
34
+ - **Docker**
35
+ - **Go 1.24.x**
36
+ - **ko** - Container image builder for Go ([installation instructions](https://ko.build/install/))
37
+ - **golangci-lint v2.4.0**
137
38
 
138
- **Input:**
139
- - `query` (string, required) -- Station name, e.g. "Zurich", "Bern", "Interlaken"
140
- - `limit` (number, optional) -- Max results (default: 10)
39
+ #### Running the server
141
40
 
142
- **Example:** "Find stations matching Luzern"
143
-
144
- ### search_connections
41
+ ```bash
42
+ # Start full development environment
43
+ make dev-compose
44
+ ```
145
45
 
146
- Find train connections between two stations. Automatically resolves station names to IDs.
46
+ This starts the registry at [`localhost:8080`](http://localhost:8080) with PostgreSQL. The database uses ephemeral storage and is reset each time you restart the containers, ensuring a clean state for development and testing.
147
47
 
148
- **Input:**
149
- - `from` (string, required) -- Origin station name or ID (e.g. "Zurich HB" or "8503000")
150
- - `to` (string, required) -- Destination station name or ID
151
- - `date` (string, optional) -- Travel date YYYY-MM-DD
152
- - `time` (string, optional) -- Departure time HH:MM
153
- - `arrival_time` (boolean, optional) -- Treat time as arrival time
48
+ **Note:** The registry uses [ko](https://ko.build) to build container images. The `make dev-compose` command automatically builds the registry image with ko and loads it into your local Docker daemon before starting the services.
154
49
 
155
- **Example:** "Show me trains from Zurich to Bern tomorrow at 9am"
50
+ By default, the registry seeds from the production API with a filtered subset of servers (to keep startup fast). This ensures your local environment mirrors production behavior and all seed data passes validation. For offline development you can seed from a file without validation with `MCP_REGISTRY_SEED_FROM=data/seed.json MCP_REGISTRY_ENABLE_REGISTRY_VALIDATION=false make dev-compose`.
156
51
 
157
- ### get_trip_details
52
+ The setup can be configured with environment variables in [docker-compose.yml](./docker-compose.yml) - see [.env.example](./.env.example) for a reference.
158
53
 
159
- Get detailed stop-by-stop information for a connection including intermediate stops, platforms, and occupancy forecasts.
54
+ <details>
55
+ <summary>Alternative: Running a pre-built Docker image</summary>
160
56
 
161
- **Input:**
162
- - `trip_id` (string, required) -- Trip ID from search_connections
57
+ Pre-built Docker images are automatically published to GitHub Container Registry:
163
58
 
164
- ### get_more_connections
59
+ ```bash
60
+ # Run latest stable release
61
+ docker run -p 8080:8080 ghcr.io/modelcontextprotocol/registry:latest
165
62
 
166
- Load earlier or later trains for a previous search.
63
+ # Run latest from main branch (continuous deployment)
64
+ docker run -p 8080:8080 ghcr.io/modelcontextprotocol/registry:main
167
65
 
168
- **Input:**
169
- - `collection_id` (string, required) -- Collection ID from search_connections
170
- - `direction` ("next" | "previous") -- Later or earlier trains
66
+ # Run specific release version
67
+ docker run -p 8080:8080 ghcr.io/modelcontextprotocol/registry:v1.0.0
171
68
 
172
- ### get_prices
69
+ # Run development build from main branch
70
+ docker run -p 8080:8080 ghcr.io/modelcontextprotocol/registry:main-20250906-abc123d
71
+ ```
173
72
 
174
- Get ticket prices with Swiss reduction card support.
73
+ **Available tags:**
74
+ - **Releases**: `latest`, `v1.0.0`, `v1.1.0`, etc.
75
+ - **Continuous**: `main` (latest main branch build)
76
+ - **Development**: `main-<date>-<sha>` (specific commit builds)
175
77
 
176
- **Input:**
177
- - `trip_ids` (string[], required) -- Trip IDs from search_connections
178
- - `traveler_type` ("ADULT" | "CHILD", default: "ADULT")
179
- - `reduction_card` ("HALF_FARE" | "GA" | "NONE", default: "HALF_FARE")
78
+ </details>
180
79
 
181
- **Example:** "How much is a ticket from Zurich to Zermatt with Half-Fare card?"
80
+ #### Publishing a server
182
81
 
183
- ### get_ticket_link
82
+ To publish a server, we've built a simple CLI. You can use it with:
184
83
 
185
- Get a direct purchase link to buy the ticket on SBB.ch. Only call when the user wants to buy.
84
+ ```bash
85
+ # Build the latest CLI
86
+ make publisher
186
87
 
187
- **Input:**
188
- - `trip_id` (string, required) -- Trip ID to purchase
189
- - `traveler_type` ("ADULT" | "CHILD", default: "ADULT")
190
- - `reduction_card` ("HALF_FARE" | "GA" | "NONE", default: "HALF_FARE")
88
+ # Use it!
89
+ ./bin/mcp-publisher --help
90
+ ```
191
91
 
192
- ## Prompts
92
+ See [the publisher guide](./docs/modelcontextprotocol-io/quickstart.mdx) for more details.
193
93
 
194
- ### plan_journey
94
+ #### Other commands
195
95
 
196
- End-to-end journey planning prompt. Searches connections, compares prices, and provides ticket links.
96
+ ```bash
97
+ # Run lint, unit tests and integration tests
98
+ make check
99
+ ```
197
100
 
198
- **Input:**
199
- - `from` (string, required) -- Origin station
200
- - `to` (string, required) -- Destination station
201
- - `date` (string, optional) -- Travel date
101
+ There are also a few more helpful commands for development. Run `make help` to learn more, or look in [Makefile](./Makefile).
202
102
 
203
- ## Environment Variables
103
+ <!--
104
+ For Claude and other AI tools: Always prefer make targets over custom commands where possible.
105
+ -->
204
106
 
205
- | Variable | Required | Description |
206
- |----------|----------|-------------|
207
- | `SMAPI_CLIENT_ID` | Yes* | OAuth 2.0 client ID from SBB Developer Portal |
208
- | `SMAPI_CLIENT_SECRET` | Yes* | OAuth 2.0 client secret |
209
- | `SMAPI_SCOPE` | Yes* | OAuth scope |
210
- | `SMAPI_CONTRACT_ID` | Yes* | SBB business contract ID |
211
- | `SMAPI_ENV` | No | `int` (default) or `prod` |
212
- | `SMAPI_TENANT_ID` | No | Azure AD tenant (defaults to SBB tenant) |
107
+ ## Architecture
213
108
 
214
- *Without credentials, the server runs in mock mode with realistic demo data.
109
+ ### Project Structure
215
110
 
216
- ## Available on
111
+ ```
112
+ ├── cmd/ # Application entry points
113
+ │ └── publisher/ # Server publishing tool
114
+ ├── data/ # Seed data
115
+ ├── deploy/ # Deployment configuration (Pulumi)
116
+ ├── docs/ # Documentation
117
+ ├── internal/ # Private application code
118
+ │ ├── api/ # HTTP handlers and routing
119
+ │ ├── auth/ # Authentication (GitHub OAuth, JWT, namespace blocking)
120
+ │ ├── config/ # Configuration management
121
+ │ ├── database/ # Data persistence (PostgreSQL)
122
+ │ ├── service/ # Business logic
123
+ │ ├── telemetry/ # Metrics and monitoring
124
+ │ └── validators/ # Input validation
125
+ ├── pkg/ # Public packages
126
+ │ ├── api/ # API types and structures
127
+ │ │ └── v0/ # Version 0 API types
128
+ │ └── model/ # Data models for server.json
129
+ ├── scripts/ # Development and testing scripts
130
+ ├── tests/ # Integration tests
131
+ └── tools/ # CLI tools and utilities
132
+ └── validate-*.sh # Schema validation tools
133
+ ```
217
134
 
218
- - [npm](https://www.npmjs.com/package/sbb-mcp)
219
- - [Official MCP Registry](https://registry.modelcontextprotocol.io)
220
- - [Smithery](https://smithery.ai/servers/fabsforward2-zhoi/sbb-mcp)
135
+ ### Authentication
221
136
 
222
- Also available as: [sbb-mcp-official](https://www.npmjs.com/package/sbb-mcp-official) | [swiss-rail-mcp](https://www.npmjs.com/package/swiss-rail-mcp) | [sbb-cff-ffs-mcp](https://www.npmjs.com/package/sbb-cff-ffs-mcp) | [swiss-train-mcp](https://www.npmjs.com/package/swiss-train-mcp) | [swiss-railways-mcp](https://www.npmjs.com/package/swiss-railways-mcp)
137
+ Publishing supports multiple authentication methods:
138
+ - **GitHub OAuth** - For publishing by logging into GitHub
139
+ - **GitHub OIDC** - For publishing from GitHub Actions
140
+ - **DNS verification** - For proving ownership of a domain and its subdomains
141
+ - **HTTP verification** - For proving ownership of a domain
223
142
 
224
- ## About
143
+ The registry validates namespace ownership when publishing. E.g. to publish...:
144
+ - `io.github.domdomegg/my-cool-mcp` you must login to GitHub as `domdomegg`, or be in a GitHub Action on domdomegg's repos
145
+ - `me.adamjones/my-cool-mcp` you must prove ownership of `adamjones.me` via DNS or HTTP challenge
225
146
 
226
- Built on the official SBB Swiss Mobility API (SMAPI) with OSDM-compliant journey planning and pricing. Covers the entire Swiss public transport network including SBB, BLS, SOB, and regional operators.
147
+ ## Community Projects
227
148
 
228
- **SBB** (Schweizerische Bundesbahnen) / **CFF** (Chemins de fer federaux suisses) / **FFS** (Ferrovie federali svizzere) -- Swiss Federal Railways operates one of the densest rail networks in the world with over 10,000 daily connections.
149
+ Check out [community projects](docs/community-projects.md) to explore notable registry-related work created by the community.
229
150
 
230
- ## License
151
+ ## More documentation
231
152
 
232
- [FSL-1.1-MIT](https://fsl.software/) -- Functional Source License. Free to use for any non-competing purpose. Converts to MIT after 2 years. See [LICENSE](LICENSE) for details.
153
+ See the [documentation](./docs) for more details if your question has not been answered here!
package/dist/auth.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export declare function isSmapiConfigured(): boolean;
2
+ export declare function getAccessToken(): Promise<string>;