使用说明
Slack远程MCP
此远程MCP代理在wrangler中运行,并部署到cloudflare worker。
已实施的工具:
auth_test, list_public_channels, list_channel_types, post_message, list_conversations, get_user_info, list_workspace_users
Claude桌面配置
"slack": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://slack-mcp.curlmate.workers.dev/mcp",
"--header",
"access-token: your Slack 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
}
);
}
}
API终点
身份验证用户和工作区-
卷曲-X POST”https://slack.com/api/auth.test"
-H“授权:持有人YOUR_ACCESS_TOKEN”
列出公共频道-
卷曲-XGET”https://slack.com/api/conversations.list?types=public_channel"
-H“授权:持有人YOUR_ACCESS_TOKEN”
列出频道类型-
卷曲-XGET”https://slack.com/api/conversations.list?types=public_channel,private_channel,im,mpim“
-H“授权:持有人YOUR_ACCESS_TOKEN”
邮寄信息-
卷曲-X POST”https://slack.com/api/chat.postMessage"
-H“授权:持有人YOUR_ACCESS_TOKEN”
-H“内容类型:应用程序/json”
d
“频道”:“channel_ID”,
“text”:“来自curl的你好🚀"
}'
列出对话-
卷曲-XGET”https://slack.com/api/conversations.list"
-H“授权:持有人YOUR_ACCESS_TOKEN”
获取用户信息-
卷曲-XGET”https://slack.com/api/users.info?user=USER_ID"
-H“授权:持有人YOUR_ACCESS_TOKEN”
列出工作区用户-
卷曲-XGET”https://slack.com/api/users.list"
-H“授权:持有人YOUR_ACCESS_TOKEN”
