Back to MCP directory
publicPublicdnsLocal runtime

swit-mcp

Swit MCP服务器是一个基于Model Context Protocol的集成工具,允许通过Claude Desktop与Swit平台进行OAuth认证和API交互,实现消息发送、频道管理等功能。

article

README

🚀 Swit MCP(模型上下文协议)服务器

Swit MCP(模型上下文协议)服务器是一个强大的工具,它提供了与Swit平台集成的能力,支持OAuth认证和多种Swit API操作,帮助用户更高效地管理工作空间和消息。

  ░██████╗░██╗░░░░░░░██╗██╗████████╗  ███╗░░░███╗░█████╗░██████╗░
  ██╔════╝░██║░░██╗░░██║██║╚══██╔══╝  ████╗░████║██╔══██╗██╔══██╗
  ╚█████╗░░╚██╗████╗██╔╝██║░░░██║░░░  ██╔████╔██║██║░░╚═╝██████╔╝
  ░╚═══██╗░░████╔═████║░██║░░░██║░░░  ██║╚██╔╝██║██║░░██╗██╔═══╝░
  ██████╔╝░░╚██╔╝░╚██╔╝░██║░░░██║░░░  ██║░╚═╝░██║╚█████╔╝██║░░░░░
  ╚═════╝░░░░╚═╝░░░╚═╝░░╚═╝░░░╚═╝░░░  ╚═╝░░░░░╚═╝░╚════╝░╚═╝░░░░░
🟦 Swit MCP( Model Context Protocol ) Server 🟧

🚀 快速开始

1. Swit开发者控制台应用注册

  1. https://developers.swit.io 上创建新应用。
  2. 获取客户端ID和客户端密钥。
  3. 设置重定向URI为 http://localhost:3000/callback

2. MCP客户端配置

Claude桌面版

~/Library/Application Support/Claude/claude_desktop_config.json 文件中进行如下配置:

{
  "mcpServers": {
    "swit": {
      "command": "npx",
      "args": ["-y", "swit-mcp"],
      "env": {
        "SWIT_CLIENT_ID": "your-client-id",
        "SWIT_CLIENT_SECRET": "your-client-secret"
      }
    }
  }
}

3. 认证过程

  1. 在Claude桌面版中首次运行Swit工具时,OAuth Web服务器将自动启动。
  2. 运行 swit-oauth-start 工具以获取认证URL。
  3. 在浏览器中使用Swit账户登录。
  4. 令牌将自动保存,你可以使用 swit-oauth-status 命令查看令牌信息。

✨ 主要特性

🔐 OAuth管理

  • swit-oauth-status:检查OAuth认证状态并查询令牌信息。
  • swit-oauth-start:启动OAuth认证(返回浏览器认证URL)。

💼 Swit API集成

  • swit-workspace-list:查询可访问的工作空间列表。
  • swit-channel-list:查询指定工作空间的频道列表(支持过滤)。
  • swit-message-create:向频道发送新消息(支持文本/HTML)。
  • swit-message-comment-create:在现有消息上添加评论。

🎯 使用示例:向Claude请求“告知Swit的开发团队频道项目进展情况”,系统将自动发送消息。

🔧 技术细节

  • MCP SDK:使用模型上下文协议TypeScript SDK。
  • OAuth:使用 @swit-api/oauth 包。
  • 类型安全:使用Zod进行运行时类型验证。
  • Web服务器:使用Express内置Web服务器处理OAuth回调。
  • 测试:使用Jest + Nock进行HTTP模拟测试。
help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client