Skip to content

Commit 0cb9288

Browse files
committed
.env api/server.ts lib/mcp-api-handler.ts package.json pnpm-lock.yaml
1 parent 2dd5c40 commit 0cb9288

File tree

5 files changed

+529
-364
lines changed

5 files changed

+529
-364
lines changed

.env

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
REDIS_URL=redis://default:np4yjRz8CBN0Xfn75IB8hD2vm8ADIuhr@redis-19521.c263.us-east-1-2.ec2.redns.redis-cloud.com:19521

api/server.ts

Lines changed: 7 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,10 @@
11
import { z } from "zod";
2-
import { initializeMcpApiHandler } from "../lib/mcp-api-handler";
2+
import createMcpApiHandler from "@vercel/mcp-adapter/next";
33

4-
const handler = initializeMcpApiHandler(
5-
(server) => {
6-
// Add more tools, resources, and prompts here
7-
server.tool("echo", { message: z.string() }, async ({ message }) => ({
8-
content: [{ type: "text", text: `Tool echo: ${message}` }],
9-
}));
10-
},
11-
{
12-
capabilities: {
13-
tools: {
14-
echo: {
15-
description: "Echo a message",
16-
},
17-
},
18-
},
19-
}
20-
);
4+
const handler = createMcpApiHandler((server) => {
5+
server.tool("echo", { message: z.string() }, async ({ message }) => ({
6+
content: [{ type: "text", text: `Tool echo: ${message}` }],
7+
}));
8+
});
219

22-
export default handler;
10+
export { handler as GET, handler as POST, handler as DELETE };

lib/mcp-api-handler.ts

Lines changed: 0 additions & 329 deletions
This file was deleted.

package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@
1111
"license": "ISC",
1212
"packageManager": "[email protected]+sha512.c85cd21b6da10332156b1ca2aa79c0a61ee7ad2eb0453b88ab299289e9e8ca93e6091232b25c07cbf61f6df77128d9c849e5c9ac6e44854dbd211c49f3a67adc",
1313
"dependencies": {
14-
"@modelcontextprotocol/sdk": "^1.10.2",
15-
"content-type": "^1.0.5",
16-
"raw-body": "^3.0.0",
17-
"redis": "^4.7.0",
14+
"@vercel/mcp-adapter": "^0.2.1",
1815
"zod": "^3.24.2"
1916
},
2017
"devDependencies": {

0 commit comments

Comments
 (0)