使用说明
远程MCP概念
此远程MCP代理在wrangler中运行,并部署到cloudflare worker。
已实施的工具:
list pages, create page, fetch page, list authenticated user
Claude桌面配置
"notion": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://notion-mcp.curlmate.workers.dev/mcp",
"--header",
"access-token: your Notion Access Token from https://curlmate.dev"
]
}
指令
npm install
npm start
这将在上启动MCP服务器 http://localhost:5174/mcp
在你的内部 McpAgents init() 方法,您可以定义资源、工具等:
export class MyMCP extends McpAgent<Env> {
server = new McpServer({
name: "Demo",
version: "1.0.0"
});
async init() {
this.server.resource("counter", "mcp://resource/counter", (uri) => {
// ...
});
this.server.registerTool(
"add",
{
description: "Add to the counter, stored in the MCP",
inputSchema: { a: z.number() }
},
async ({ a }) => {
// add your logic here
}
);
}
}