You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(examples): transform hono-mcp server to Vengabus party theme
Transform the generic example server into a fun Vengabus-themed MCP server with:
- Replace generic tools with party-themed tools (party capacity calculator, vengabus schedule)
- Update resources to use party-themed URIs and content
- Replace generic prompts with party invitations and announcements
- Fix resource URI handling to strip trailing slashes
- Fix TypeScript errors with proper resource template typing
- Use docs:// protocol for party manual resource
๐ค Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
description: 'Current Vengabus fleet settings and party parameters',
65
88
mimeType: 'application/json',
66
89
},
67
-
async(uri: URL)=>({
68
-
contents: [
69
-
{
70
-
uri: uri.href,
71
-
mimeType: 'application/json',
72
-
text: JSON.stringify(
73
-
{
74
-
version: '1.0.0',
75
-
environment: 'test',
76
-
features: {
77
-
vengabus: true,
78
-
calculator: true,
90
+
async(uri: URL)=>{
91
+
constnormalizedUri=uri.href.replace(/\/$/,'')
92
+
return{
93
+
contents: [
94
+
{
95
+
uri: normalizedUri,
96
+
mimeType: 'application/json',
97
+
text: JSON.stringify(
98
+
{
99
+
version: '1.0.0',
100
+
fleet: 'intercity-disco',
101
+
features: {
102
+
bassBoost: true,
103
+
strobeEnabled: true,
104
+
maxBPM: 160,
105
+
wheelsOfSteel: 'turning',
106
+
},
107
+
routes: ['New York to Ibiza','Back to the Magic Island','Like an Intercity Disco','The place to be'],
79
108
},
80
-
},
81
-
null,
82
-
2,
83
-
),
84
-
},
85
-
],
86
-
}),
109
+
null,
110
+
2,
111
+
),
112
+
},
113
+
],
114
+
}
115
+
},
87
116
)
88
117
89
118
mcpServer.registerResource(
90
119
'readme',
91
-
'file://readme.md',
120
+
'docs://party-manual.md',
92
121
{
93
-
title: 'README',
94
-
description: 'Server documentation',
122
+
title: 'Vengabus Party Manual',
123
+
description: 'Official guide to the Vengabus experience',
95
124
mimeType: 'text/markdown',
96
125
},
97
-
async(uri: URL)=>({
98
-
contents: [
99
-
{
100
-
uri: uri.href,
101
-
mimeType: 'text/markdown',
102
-
text: '# Test MCP Server\n\nThis is a test server for the use-mcp integration tests.\n\n## Features\n- Addition tool\n- Vengabus schedule checker\n- Sample resources\n- Sample prompts',
103
-
},
104
-
],
126
+
()=>({
127
+
128
+
contents: [
129
+
{
130
+
uri: 'docs://party-manual.md',
131
+
mimeType: 'text/markdown',
132
+
text: "# ๐ Vengabus MCP Server\n\nBOOM BOOM BOOM BOOM! Welcome aboard the Vengabus! We like to party!\n\n## Features\n- ๐ Party capacity calculator - How many can we take to Ibiza?\n- ๐ Vengabus schedule checker - Next stop: The Magic Island!\n- ๐ต Fleet configuration with maximum bass boost\n- ๐ Party statistics tracker (BPM, passengers, energy levels)\n\n## Routes\n- New York to Ibiza (via San Francisco)\n- Back to the Magic Island\n- Like an Intercity Disco\n- The place to be\n\n## Current Status\nThe wheels of steel are turning, and traffic lights are burning!\nWe're going to Ibiza! Woah! We're going to Ibiza!\n\n*Up, up and away we go!*",
description: 'Get statistics for different types',
143
+
title: 'Vengabus Party Statistics',
144
+
description: 'Get party metrics (bpm, passengers, energy)',
115
145
mimeType: 'application/json',
116
146
},
117
-
// @ts-expect-error - type is missing in the callback
118
-
async(uri: URL,{ type })=>({
119
-
contents: [
120
-
{
121
-
uri: uri.href,
122
-
mimeType: 'application/json',
123
-
text: JSON.stringify(
124
-
{
125
-
type: type,
126
-
count: Math.floor(Math.random()*100),
127
-
lastUpdated: newDate().toISOString(),
128
-
},
129
-
null,
130
-
2,
131
-
),
132
-
},
133
-
],
134
-
}),
147
+
async(uri: URL,variables: Variables)=>{
148
+
constmetric=variables.metricasstring
149
+
return{
150
+
contents: [
151
+
{
152
+
uri: uri.href,
153
+
mimeType: 'application/json',
154
+
text: JSON.stringify(
155
+
{
156
+
metric: metric,
157
+
value:
158
+
metric==='bpm'
159
+
? 140+Math.floor(Math.random()*20)
160
+
: metric==='passengers'
161
+
? Math.floor(Math.random()*50)+20
162
+
: metric==='energy'
163
+
? Math.floor(Math.random()*100)
164
+
: 0,
165
+
unit:
166
+
metric==='bpm'
167
+
? 'beats per minute'
168
+
: metric==='passengers'
169
+
? 'party people'
170
+
: metric==='energy'
171
+
? 'party power %'
172
+
: 'unknown',
173
+
status: 'The party is jumping!',
174
+
lastUpdated: newDate().toISOString(),
175
+
},
176
+
null,
177
+
2,
178
+
),
179
+
},
180
+
],
181
+
}
182
+
},
135
183
)
136
184
137
185
// Register sample prompts
138
186
mcpServer.registerPrompt(
139
-
'greeting',
187
+
'party_invitation',
140
188
{
141
-
title: 'Generate Greeting',
142
-
description: 'Generate a greeting message',
189
+
title: 'Vengabus Party Invitation',
190
+
description: 'Generate a party invitation for the Vengabus',
143
191
argsSchema: {
144
-
name: z.string().describe('Name of the person to greet'),
145
-
style: z.string().optional().describe('Style of greeting (formal/casual)'),
192
+
name: z.string().describe('Name of the party person'),
193
+
destination: z.string().optional().describe('Where the Vengabus is heading'),
146
194
},
147
195
},
148
-
({ name,style})=>({
196
+
({ name,destination})=>({
149
197
messages: [
150
198
{
151
199
role: 'user',
152
200
content: {
153
201
type: 'text',
154
-
text: `Generate a ${style||'casual'} greeting for ${name}`,
202
+
text: `Create a party invitation for ${name} to join the Vengabus${destination ? ` heading to ${destination}` : ''}`,
155
203
},
156
204
},
157
205
{
158
206
role: 'assistant',
159
207
content: {
160
208
type: 'text',
161
-
text: style==='formal'? `Good day, ${name}. I hope this message finds you well.` : `Hey ${name}! How's it going?`,
209
+
text: `๐ BOOM BOOM BOOM BOOM! Hey ${name}! ๐\n\nThe Vengabus is coming${destination? ` and we're heading to ${destination}` : ''}!\n${destination?.toLowerCase().includes('ibiza') ? "WE'RE GOING TO IBIZA! Back to the Magic Island! ๐๏ธ\n" : ''}\nWe like to party! We like, we like to party!\n\nThe wheels of steel are turning, and traffic lights are burning!\nSo if you like to party, get on and move your body!\n\n๐ Route: ${destination||'New York โ San Francisco โ IBIZA!'}\n๐ต Departure: When everybody's jumping\n๐ Dress code: Beach party ready\n๐๏ธ Ticket: Just bring your party spirit!\n\nHey now, hey now, hear what we say now - happiness is just around the corner!\n\n*The Vengabus is coming... and everybody's jumping!*`,
162
210
},
163
211
},
164
212
],
165
213
}),
166
214
)
167
215
168
216
mcpServer.registerPrompt(
169
-
'code_review',
217
+
'party_announcement',
170
218
{
171
-
title: 'Code Review Template',
172
-
description: 'Template for code review requests',
219
+
title: 'Party Bus Announcement',
220
+
description: 'Generate party-themed announcements for various occasions',
focus: z.string().optional().describe('What to focus on (performance/security/style)'),
222
+
event: z.string().describe('Type of event (deployment, release, milestone, etc.)'),
223
+
details: z.string().optional().describe('Additional details about the event'),
176
224
},
177
225
},
178
-
({language, focus})=>({
226
+
({event, details})=>({
179
227
messages: [
180
228
{
181
229
role: 'user',
182
230
content: {
183
231
type: 'text',
184
-
text: `Please review the following ${language} code${focus ? ` with a focus on ${focus}` : ''}:`,
232
+
text: `Create a party bus announcement for a ${event}${details ? `: ${details}` : ''}`,
233
+
},
234
+
},
235
+
{
236
+
role: 'assistant',
237
+
content: {
238
+
type: 'text',
239
+
text: `๐ ATTENTION PARTY PEOPLE! ๐\n\n${event.toUpperCase()} ANNOUNCEMENT!\n\nThe party bus is making a special stop for this ${event}!\n${details ? `\n๐ข Details: ${details}\n` : ''}\n๐ Status: Maximum celebration mode activated!\n๐ Time: Right now!\n๐ Location: Wherever the party takes us!\n\nAll aboard for this incredible ${event}! The wheels are turning and we're ready to celebrate!\n\n*Honk honk! Let's party!* ๐บ`,
0 commit comments