Skip to content

Commit 818512a

Browse files
authored
Use McpAgent in examples (#37)
1 parent 9384880 commit 818512a

File tree

4 files changed

+69
-4
lines changed

4 files changed

+69
-4
lines changed

demos/remote-mcp-github-oauth/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import OAuthProvider from "@cloudflare/workers-oauth-provider";
2-
import { DurableMCP } from "workers-mcp";
2+
import { McpAgent } from "agents/mcp";
33
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
44
import { z } from "zod";
55
import { Octokit } from "octokit";
@@ -19,7 +19,7 @@ const ALLOWED_USERNAMES = new Set([
1919
// For example: 'yourusername', 'coworkerusername'
2020
]);
2121

22-
export class MyMCP extends DurableMCP<Props, Env> {
22+
export class MyMCP extends McpAgent<Props, Env> {
2323
server = new McpServer({
2424
name: "Github OAuth Proxy Demo",
2525
version: "1.0.0",

demos/remote-mcp-server/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"dependencies": {
2020
"@cloudflare/workers-oauth-provider": "^0.0.2",
2121
"@modelcontextprotocol/sdk": "^1.7.0",
22+
"agents": "^0.0.43",
2223
"hono": "^4.7.4",
2324
"zod": "^3.24.2"
2425
}

demos/remote-mcp-server/src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import app from "./app";
2-
import { DurableMCP } from "workers-mcp";
2+
import { McpAgent } from "agents/mcp";
33
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
44
import { z } from "zod";
55
import OAuthProvider from "@cloudflare/workers-oauth-provider";
66

7-
export class MyMCP extends DurableMCP {
7+
export class MyMCP extends McpAgent {
88
server = new McpServer({
99
name: "Demo",
1010
version: "1.0.0",

package-lock.json

Lines changed: 64 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)