@@ -8,6 +8,8 @@ The **fast-time-server** is a high-performance Go-based MCP server that provides
8
8
9
9
- ** Multiple Transport Modes** : stdio, HTTP (JSON-RPC), SSE, dual (MCP + REST), and REST API
10
10
- ** Comprehensive Time Operations** : Get system time, convert between timezones
11
+ - ** MCP Resources** : Timezone data, world times, format examples, business hours
12
+ - ** MCP Prompts** : Time comparisons, meeting scheduling, detailed conversions
11
13
- ** REST API** : Traditional HTTP endpoints alongside MCP protocol
12
14
- ** OpenAPI Documentation** : Interactive Swagger UI and OpenAPI 3.0 specification
13
15
- ** CORS Support** : Enabled for browser-based testing
@@ -115,6 +117,146 @@ Converts time between different timezones.
115
117
}
116
118
```
117
119
120
+ ## MCP Resources
121
+
122
+ The server provides four MCP resources that can be accessed through the MCP protocol:
123
+
124
+ ### timezone://info
125
+ Comprehensive timezone information including offsets, DST status, major cities, and population data.
126
+
127
+ ** Example Response:**
128
+ ``` json
129
+ {
130
+ "timezones" : [
131
+ {
132
+ "id" : " America/New_York" ,
133
+ "name" : " Eastern Time" ,
134
+ "offset" : " -05:00" ,
135
+ "dst" : true ,
136
+ "abbreviation" : " EST/EDT" ,
137
+ "major_cities" : [" New York" , " Toronto" , " Montreal" ],
138
+ "population" : 141000000
139
+ }
140
+ ],
141
+ "timezone_groups" : {
142
+ "us_timezones" : [" America/New_York" , " America/Chicago" , " America/Denver" , " America/Los_Angeles" ]
143
+ }
144
+ }
145
+ ```
146
+
147
+ ### time://current/world
148
+ Current time in major cities around the world, updated in real-time.
149
+
150
+ ** Example Response:**
151
+ ``` json
152
+ {
153
+ "last_updated" : " 2025-01-10T16:30:00Z" ,
154
+ "times" : {
155
+ "New York" : " 2025-01-10 11:30:00 EST" ,
156
+ "London" : " 2025-01-10 16:30:00 GMT" ,
157
+ "Tokyo" : " 2025-01-11 01:30:00 JST"
158
+ }
159
+ }
160
+ ```
161
+
162
+ ### time://formats
163
+ Examples of supported time formats for parsing and display.
164
+
165
+ ** Example Response:**
166
+ ``` json
167
+ {
168
+ "input_formats" : [
169
+ " 2006-01-02 15:04:05" ,
170
+ " 2006-01-02T15:04:05Z" ,
171
+ " 2006-01-02T15:04:05-07:00"
172
+ ],
173
+ "output_formats" : {
174
+ "iso8601" : " 2006-01-02T15:04:05Z07:00" ,
175
+ "rfc3339" : " 2006-01-02T15:04:05Z"
176
+ }
177
+ }
178
+ ```
179
+
180
+ ### time://business-hours
181
+ Standard business hours across different regions.
182
+
183
+ ** Example Response:**
184
+ ``` json
185
+ {
186
+ "regions" : {
187
+ "north_america" : {
188
+ "standard_hours" : " 9:00 AM - 5:00 PM" ,
189
+ "lunch_break" : " 12:00 PM - 1:00 PM" ,
190
+ "working_days" : [" Monday" , " Tuesday" , " Wednesday" , " Thursday" , " Friday" ]
191
+ }
192
+ }
193
+ }
194
+ ```
195
+
196
+ ## MCP Prompts
197
+
198
+ The server provides three prompt templates for common time-related tasks:
199
+
200
+ ### compare_timezones
201
+ Compare current times across multiple time zones.
202
+
203
+ ** Arguments:**
204
+ - ` timezones ` (required): Comma-separated list of timezone IDs
205
+ - ` reference_time ` (optional): Reference time (defaults to now)
206
+
207
+ ** Example:**
208
+ ``` json
209
+ {
210
+ "prompt" : " compare_timezones" ,
211
+ "arguments" : {
212
+ "timezones" : " UTC,America/New_York,Asia/Tokyo"
213
+ }
214
+ }
215
+ ```
216
+
217
+ ### schedule_meeting
218
+ Find optimal meeting time across multiple time zones.
219
+
220
+ ** Arguments:**
221
+ - ` participants ` (required): Comma-separated list of participant locations/timezones
222
+ - ` duration ` (required): Meeting duration in minutes
223
+ - ` preferred_hours ` (optional): Preferred time range (default: "9 AM - 5 PM")
224
+ - ` date_range ` (optional): Date range to consider (default: "next 7 days")
225
+
226
+ ** Example:**
227
+ ``` json
228
+ {
229
+ "prompt" : " schedule_meeting" ,
230
+ "arguments" : {
231
+ "participants" : " New York,London,Tokyo" ,
232
+ "duration" : " 60" ,
233
+ "preferred_hours" : " 9 AM - 5 PM"
234
+ }
235
+ }
236
+ ```
237
+
238
+ ### convert_time_detailed
239
+ Convert time with detailed context.
240
+
241
+ ** Arguments:**
242
+ - ` time ` (required): Time to convert
243
+ - ` from_timezone ` (required): Source timezone
244
+ - ` to_timezones ` (required): Comma-separated list of target timezones
245
+ - ` include_context ` (optional): Include contextual information (true/false)
246
+
247
+ ** Example:**
248
+ ``` json
249
+ {
250
+ "prompt" : " convert_time_detailed" ,
251
+ "arguments" : {
252
+ "time" : " 2025-01-10T10:00:00Z" ,
253
+ "from_timezone" : " UTC" ,
254
+ "to_timezones" : " America/New_York,Europe/London,Asia/Tokyo" ,
255
+ "include_context" : " true"
256
+ }
257
+ }
258
+ ```
259
+
118
260
## REST API Endpoints
119
261
120
262
When using ` rest ` or ` dual ` transport modes, the following REST endpoints are available:
@@ -205,6 +347,35 @@ curl http://localhost:8080/api/v1/timezones/Asia/Tokyo/info
205
347
}
206
348
```
207
349
350
+ ### MCP Resources via REST
351
+
352
+ ``` bash
353
+ # List all resources
354
+ curl http://localhost:8080/api/v1/resources
355
+
356
+ # Get specific resource
357
+ curl http://localhost:8080/api/v1/resources/timezone-info
358
+ curl http://localhost:8080/api/v1/resources/current-world
359
+ curl http://localhost:8080/api/v1/resources/time-formats
360
+ curl http://localhost:8080/api/v1/resources/business-hours
361
+ ```
362
+
363
+ ### MCP Prompts via REST
364
+
365
+ ``` bash
366
+ # List all prompts
367
+ curl http://localhost:8080/api/v1/prompts
368
+
369
+ # Execute a prompt
370
+ curl -X POST http://localhost:8080/api/v1/prompts/compare_timezones/execute \
371
+ -H " Content-Type: application/json" \
372
+ -d ' {"timezones": "UTC,America/New_York,Asia/Tokyo"}'
373
+
374
+ curl -X POST http://localhost:8080/api/v1/prompts/schedule_meeting/execute \
375
+ -H " Content-Type: application/json" \
376
+ -d ' {"participants": "New York,London,Tokyo", "duration": "60"}'
377
+ ```
378
+
208
379
### Test Endpoints
209
380
``` bash
210
381
# Echo test
0 commit comments