Skip to content

Commit 38de53b

Browse files
fix: got tools to be working with the new arch
1 parent ed3dc52 commit 38de53b

File tree

7 files changed

+193
-80
lines changed

7 files changed

+193
-80
lines changed

examples/mcp-sdk/src/index.ts

Lines changed: 35 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import { Hono } from "hono";
33
import {
44
muppet,
55
describeTool,
6-
staticResource,
7-
dynamicResource,
6+
// staticResource,
7+
// dynamicResource,
88
describePrompt,
9-
validator,
9+
mValidator,
1010
} from "muppet";
1111
import z from "zod";
1212
import pino from "pino";
@@ -15,13 +15,12 @@ const app = new Hono();
1515

1616
// Define a simple hello world tool
1717
app.post(
18-
"/",
18+
"/hello",
1919
describeTool({
2020
name: "Hello World",
2121
description: "A simple hello world route",
2222
}),
23-
validator(
24-
"json",
23+
mValidator(
2524
z.object({
2625
name: z.string(),
2726
}),
@@ -40,40 +39,39 @@ app.post(
4039
);
4140

4241
// Define static resources
43-
app.post(
44-
"/static/*",
45-
staticResource({
46-
name: "Static Resource",
47-
description: "A static resource",
48-
resource: {
49-
path: "E:/dev/muppet/muppet/examples/mcp-sdk/dist/static",
50-
},
51-
}),
52-
);
42+
// app.post(
43+
// "/static/*",
44+
// staticResource({
45+
// name: "Static Resource",
46+
// description: "A static resource",
47+
// resource: {
48+
// path: "E:/dev/muppet/muppet/examples/mcp-sdk/dist/static",
49+
// },
50+
// }),
51+
// );
5352

54-
// Define Dynamic resources
55-
app.post(
56-
"/dynamic/*",
57-
dynamicResource({
58-
name: "Dynamic Resource",
59-
description: "A dynamic resource",
60-
}),
61-
(c) => {
62-
return c.json([
63-
{
64-
uri: "file:///logs/app.log",
65-
name: "Application Logs",
66-
mimeType: "text/plain",
67-
},
68-
]);
69-
},
70-
);
53+
// // Define Dynamic resources
54+
// app.post(
55+
// "/dynamic/*",
56+
// dynamicResource({
57+
// name: "Dynamic Resource",
58+
// description: "A dynamic resource",
59+
// }),
60+
// (c) => {
61+
// return c.json([
62+
// {
63+
// uri: "file:///logs/app.log",
64+
// name: "Application Logs",
65+
// mimeType: "text/plain",
66+
// },
67+
// ]);
68+
// },
69+
// );
7170

7271
// Define a simple prompt
7372
app.post(
74-
"/propmt",
75-
validator(
76-
"json",
73+
"/simple",
74+
mValidator(
7775
z.object({
7876
name: z.string(),
7977
}),
@@ -101,7 +99,7 @@ muppet(app, {
10199
transport: new StdioServerTransport(),
102100
logger: {
103101
stream: pino.destination(
104-
"~/dev/muppet-dev/muppet/examples/mcp-sdk/dist/main.log",
102+
"/Users/adityamathur/dev/muppet-dev/muppet/examples/mcp-sdk/dist/main.log",
105103
),
106104
},
107105
});

examples/mcp-sdk/src/transport.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ import pino from "pino";
1111
// "E:/dev/muppet/muppet/examples/mcp-sdk/dist/transport.log"
1212

1313
const logger = pino(
14-
pino.destination("~/dev/muppet-dev/muppet/examples/mcp-sdk/dist/main.log"),
14+
pino.destination(
15+
"/Users/adityamathur/dev/muppet-dev/muppet/examples/mcp-sdk/dist/main.log",
16+
),
1517
);
1618

1719
/**

packages/core/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@
7373
}
7474
},
7575
"devDependencies": {
76+
"@hono/event-emitter": "^2.0.0",
7677
"pkgroll": "^2.5.1"
7778
}
7879
}

0 commit comments

Comments
 (0)