sbb-mcp 0.1.3 → 0.2.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 +57 -57
- package/README.md +276 -232
- package/dist/auth.d.ts +2 -0
- package/dist/auth.js +44 -0
- package/dist/auth.js.map +1 -0
- package/dist/client.d.ts +17 -0
- package/dist/client.js +70 -0
- package/dist/client.js.map +1 -0
- package/dist/formatters.d.ts +15 -1
- package/dist/formatters.js +31 -4
- package/dist/formatters.js.map +1 -1
- package/dist/http.js +3 -0
- package/dist/http.js.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/journey.d.ts +5 -0
- package/dist/journey.js +67 -0
- package/dist/journey.js.map +1 -0
- package/dist/prices.d.ts +3 -0
- package/dist/prices.js +51 -0
- package/dist/prices.js.map +1 -0
- package/dist/profile.d.ts +14 -0
- package/dist/profile.js +70 -0
- package/dist/profile.js.map +1 -0
- package/dist/swisstrip.d.ts +41 -0
- package/dist/swisstrip.js +119 -0
- package/dist/swisstrip.js.map +1 -0
- package/dist/tools.js +194 -19
- package/dist/tools.js.map +1 -1
- package/dist/types.d.ts +139 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/package.json +64 -64
package/LICENSE
CHANGED
|
@@ -1,57 +1,57 @@
|
|
|
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
|
+
# 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.
|
package/README.md
CHANGED
|
@@ -1,232 +1,276 @@
|
|
|
1
|
-
# sbb-mcp
|
|
2
|
-
|
|
3
|
-
[](https://www.npmjs.com/package/sbb-mcp)
|
|
4
|
-
[](https://fsl.software/)
|
|
5
|
-
[](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
|
-
- **
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
"
|
|
103
|
-
"
|
|
104
|
-
|
|
105
|
-
"
|
|
106
|
-
"
|
|
107
|
-
"
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
- `
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
- `
|
|
151
|
-
- `
|
|
152
|
-
- `
|
|
153
|
-
- `
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
- `
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
- `
|
|
179
|
-
- `
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
- `
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
- `
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
1
|
+
# sbb-mcp
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/sbb-mcp)
|
|
4
|
+
[](https://fsl.software/)
|
|
5
|
+
[](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
|
+
- **Multi-traveler** -- family trip pricing when connected to SwissTrip (partner, kids, each with their own reduction card)
|
|
21
|
+
- **Mock mode** -- works without credentials for testing and demos
|
|
22
|
+
|
|
23
|
+
## Quick Start
|
|
24
|
+
|
|
25
|
+
### Claude Desktop
|
|
26
|
+
|
|
27
|
+
Add to your `claude_desktop_config.json`:
|
|
28
|
+
|
|
29
|
+
```json
|
|
30
|
+
{
|
|
31
|
+
"mcpServers": {
|
|
32
|
+
"sbb": {
|
|
33
|
+
"command": "npx",
|
|
34
|
+
"args": ["-y", "sbb-mcp"],
|
|
35
|
+
"env": {
|
|
36
|
+
"SMAPI_CLIENT_ID": "your-client-id",
|
|
37
|
+
"SMAPI_CLIENT_SECRET": "your-secret",
|
|
38
|
+
"SMAPI_SCOPE": "your-scope",
|
|
39
|
+
"SMAPI_CONTRACT_ID": "your-contract-id"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Claude Code
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
claude mcp add sbb -- npx -y sbb-mcp
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Cursor
|
|
53
|
+
|
|
54
|
+
Add to `.cursor/mcp.json`:
|
|
55
|
+
|
|
56
|
+
```json
|
|
57
|
+
{
|
|
58
|
+
"mcpServers": {
|
|
59
|
+
"sbb": {
|
|
60
|
+
"command": "npx",
|
|
61
|
+
"args": ["-y", "sbb-mcp"],
|
|
62
|
+
"env": {
|
|
63
|
+
"SMAPI_CLIENT_ID": "your-client-id",
|
|
64
|
+
"SMAPI_CLIENT_SECRET": "your-secret",
|
|
65
|
+
"SMAPI_SCOPE": "your-scope",
|
|
66
|
+
"SMAPI_CONTRACT_ID": "your-contract-id"
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### Windsurf
|
|
74
|
+
|
|
75
|
+
Add to `~/.codeium/windsurf/mcp_config.json`:
|
|
76
|
+
|
|
77
|
+
```json
|
|
78
|
+
{
|
|
79
|
+
"mcpServers": {
|
|
80
|
+
"sbb": {
|
|
81
|
+
"command": "npx",
|
|
82
|
+
"args": ["-y", "sbb-mcp"],
|
|
83
|
+
"env": {
|
|
84
|
+
"SMAPI_CLIENT_ID": "your-client-id",
|
|
85
|
+
"SMAPI_CLIENT_SECRET": "your-secret",
|
|
86
|
+
"SMAPI_SCOPE": "your-scope",
|
|
87
|
+
"SMAPI_CONTRACT_ID": "your-contract-id"
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
### VS Code Copilot
|
|
95
|
+
|
|
96
|
+
Add to `.vscode/mcp.json`:
|
|
97
|
+
|
|
98
|
+
```json
|
|
99
|
+
{
|
|
100
|
+
"servers": {
|
|
101
|
+
"sbb": {
|
|
102
|
+
"command": "npx",
|
|
103
|
+
"args": ["-y", "sbb-mcp"],
|
|
104
|
+
"env": {
|
|
105
|
+
"SMAPI_CLIENT_ID": "your-client-id",
|
|
106
|
+
"SMAPI_CLIENT_SECRET": "your-secret",
|
|
107
|
+
"SMAPI_SCOPE": "your-scope",
|
|
108
|
+
"SMAPI_CONTRACT_ID": "your-contract-id"
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Smithery
|
|
116
|
+
|
|
117
|
+
Install via [Smithery](https://smithery.ai/servers/fabsforward2-zhoi/sbb-mcp):
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
npx @smithery/cli mcp add fabsforward2-zhoi/sbb-mcp
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### Demo Mode (No Credentials)
|
|
124
|
+
|
|
125
|
+
Run without any environment variables to use mock data:
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
npx sbb-mcp
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
This lets you test the MCP server with realistic Swiss station data without SBB API credentials.
|
|
132
|
+
|
|
133
|
+
## Tools
|
|
134
|
+
|
|
135
|
+
### search_stations
|
|
136
|
+
|
|
137
|
+
Search for Swiss train stations by name. Returns station IDs needed for other tools.
|
|
138
|
+
|
|
139
|
+
**Input:**
|
|
140
|
+
- `query` (string, required) -- Station name, e.g. "Zurich", "Bern", "Interlaken"
|
|
141
|
+
- `limit` (number, optional) -- Max results (default: 10)
|
|
142
|
+
|
|
143
|
+
**Example:** "Find stations matching Luzern"
|
|
144
|
+
|
|
145
|
+
### search_connections
|
|
146
|
+
|
|
147
|
+
Find train connections between two stations. Automatically resolves station names to IDs.
|
|
148
|
+
|
|
149
|
+
**Input:**
|
|
150
|
+
- `from` (string, required) -- Origin station name or ID (e.g. "Zurich HB" or "8503000")
|
|
151
|
+
- `to` (string, required) -- Destination station name or ID
|
|
152
|
+
- `date` (string, optional) -- Travel date YYYY-MM-DD
|
|
153
|
+
- `time` (string, optional) -- Departure time HH:MM
|
|
154
|
+
- `arrival_time` (boolean, optional) -- Treat time as arrival time
|
|
155
|
+
|
|
156
|
+
**Example:** "Show me trains from Zurich to Bern tomorrow at 9am"
|
|
157
|
+
|
|
158
|
+
### get_trip_details
|
|
159
|
+
|
|
160
|
+
Get detailed stop-by-stop information for a connection including intermediate stops, platforms, and occupancy forecasts.
|
|
161
|
+
|
|
162
|
+
**Input:**
|
|
163
|
+
- `trip_id` (string, required) -- Trip ID from search_connections
|
|
164
|
+
|
|
165
|
+
### get_more_connections
|
|
166
|
+
|
|
167
|
+
Load earlier or later trains for a previous search.
|
|
168
|
+
|
|
169
|
+
**Input:**
|
|
170
|
+
- `collection_id` (string, required) -- Collection ID from search_connections
|
|
171
|
+
- `direction` ("next" | "previous") -- Later or earlier trains
|
|
172
|
+
|
|
173
|
+
### get_prices
|
|
174
|
+
|
|
175
|
+
Get ticket prices with Swiss reduction card support. Supports multi-traveler family pricing when connected to SwissTrip.
|
|
176
|
+
|
|
177
|
+
**Input:**
|
|
178
|
+
- `trip_ids` (string[], required) -- Trip IDs from search_connections
|
|
179
|
+
- `traveler_type` ("ADULT" | "CHILD", default: "ADULT") -- used when no traveler_names given
|
|
180
|
+
- `reduction_card` ("HALF_FARE" | "GA" | "NONE", default: "HALF_FARE") -- used when no traveler_names given
|
|
181
|
+
- `traveler_names` (string[], optional) -- SwissTrip traveler names for family pricing (requires `SWISSTRIP_TOKEN`)
|
|
182
|
+
|
|
183
|
+
**Example:** "How much for Zurich to Zermatt for Fabian and Anna?" (with SwissTrip connected, each traveler's reduction card is applied automatically)
|
|
184
|
+
|
|
185
|
+
### get_ticket_link
|
|
186
|
+
|
|
187
|
+
Get a direct purchase link to buy the ticket on SBB.ch. On mobile with the SBB app installed, opens directly in the app with Halbtax/GA applied automatically. Supports multi-traveler tickets when connected to SwissTrip.
|
|
188
|
+
|
|
189
|
+
**Input:**
|
|
190
|
+
- `trip_id` (string, required) -- Trip ID to purchase
|
|
191
|
+
- `from_name` (string, required) -- Origin station name
|
|
192
|
+
- `from_id` (string, required) -- Origin station ID
|
|
193
|
+
- `to_name` (string, required) -- Destination station name
|
|
194
|
+
- `to_id` (string, required) -- Destination station ID
|
|
195
|
+
- `date` (string, required) -- Travel date YYYY-MM-DD
|
|
196
|
+
- `time` (string, required) -- Departure time HH:MM
|
|
197
|
+
- `traveler_type` ("ADULT" | "CHILD", default: "ADULT") -- used when no traveler_names given
|
|
198
|
+
- `reduction_card` ("HALF_FARE" | "GA" | "NONE", default: "HALF_FARE") -- used when no traveler_names given
|
|
199
|
+
- `traveler_names` (string[], optional) -- SwissTrip traveler names for family tickets (requires `SWISSTRIP_TOKEN`)
|
|
200
|
+
|
|
201
|
+
### list_travelers
|
|
202
|
+
|
|
203
|
+
List all travelers in the user's SwissTrip account (self, partner, kids). Each traveler has their own reduction card. Requires `SWISSTRIP_TOKEN`.
|
|
204
|
+
|
|
205
|
+
**Example:** "Who are my travelers?" → shows all saved travelers with their reduction cards
|
|
206
|
+
|
|
207
|
+
## Prompts
|
|
208
|
+
|
|
209
|
+
### plan_journey
|
|
210
|
+
|
|
211
|
+
End-to-end journey planning prompt. Searches connections, compares prices, and provides ticket links.
|
|
212
|
+
|
|
213
|
+
**Input:**
|
|
214
|
+
- `from` (string, required) -- Origin station
|
|
215
|
+
- `to` (string, required) -- Destination station
|
|
216
|
+
- `date` (string, optional) -- Travel date
|
|
217
|
+
|
|
218
|
+
## Environment Variables
|
|
219
|
+
|
|
220
|
+
| Variable | Required | Description |
|
|
221
|
+
|----------|----------|-------------|
|
|
222
|
+
| `SMAPI_CLIENT_ID` | Yes* | OAuth 2.0 client ID from SBB Developer Portal |
|
|
223
|
+
| `SMAPI_CLIENT_SECRET` | Yes* | OAuth 2.0 client secret |
|
|
224
|
+
| `SMAPI_SCOPE` | Yes* | OAuth scope |
|
|
225
|
+
| `SMAPI_CONTRACT_ID` | Yes* | SBB business contract ID |
|
|
226
|
+
| `SMAPI_ENV` | No | `int` (default) or `prod` |
|
|
227
|
+
| `SMAPI_TENANT_ID` | No | Azure AD tenant (defaults to SBB tenant) |
|
|
228
|
+
| `SWISSTRIP_TOKEN` | No | SwissTrip auth token for cloud profiles and multi-traveler support |
|
|
229
|
+
| `SWISSTRIP_URL` | No | SwissTrip API base URL (defaults to `https://swisstrip.ch`) |
|
|
230
|
+
|
|
231
|
+
*Without SMAPI credentials, the server runs in mock mode with realistic demo data.
|
|
232
|
+
|
|
233
|
+
## SwissTrip Integration (Optional)
|
|
234
|
+
|
|
235
|
+
Set `SWISSTRIP_TOKEN` to connect sbb-mcp to your [SwissTrip](https://swisstrip.ch) account. This enables:
|
|
236
|
+
|
|
237
|
+
- **Cloud-synced profiles** -- your travel profile (name, DOB, reduction card) syncs from SwissTrip instead of local `~/.sbb-mcp/profile.json`
|
|
238
|
+
- **Multi-traveler pricing** -- add your partner, kids, or travel companions on SwissTrip and get per-person pricing with correct reduction cards
|
|
239
|
+
- **Family tickets** -- pass `traveler_names` to `get_prices` and `get_ticket_link` for group pricing
|
|
240
|
+
|
|
241
|
+
```json
|
|
242
|
+
{
|
|
243
|
+
"mcpServers": {
|
|
244
|
+
"sbb": {
|
|
245
|
+
"command": "npx",
|
|
246
|
+
"args": ["-y", "sbb-mcp"],
|
|
247
|
+
"env": {
|
|
248
|
+
"SMAPI_CLIENT_ID": "your-client-id",
|
|
249
|
+
"SMAPI_CLIENT_SECRET": "your-secret",
|
|
250
|
+
"SMAPI_SCOPE": "your-scope",
|
|
251
|
+
"SWISSTRIP_TOKEN": "your-swisstrip-auth-token"
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
Without `SWISSTRIP_TOKEN`, sbb-mcp uses local file-based profiles as before -- no SwissTrip account required.
|
|
259
|
+
|
|
260
|
+
## Available on
|
|
261
|
+
|
|
262
|
+
- [npm](https://www.npmjs.com/package/sbb-mcp)
|
|
263
|
+
- [Official MCP Registry](https://registry.modelcontextprotocol.io)
|
|
264
|
+
- [Smithery](https://smithery.ai/servers/fabsforward2-zhoi/sbb-mcp)
|
|
265
|
+
|
|
266
|
+
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)
|
|
267
|
+
|
|
268
|
+
## About
|
|
269
|
+
|
|
270
|
+
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.
|
|
271
|
+
|
|
272
|
+
**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.
|
|
273
|
+
|
|
274
|
+
## License
|
|
275
|
+
|
|
276
|
+
[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.
|
package/dist/auth.d.ts
ADDED