Back to MCP directory
publicPublicdnsLocal runtime

matrix-mcp-server

matrix-mcp是一个基于TypeScript的MCP服务器,提供连接Matrix服务器、管理聊天室及消息等功能。

article

README

🚀 matrix-mcp

matrix-mcp 是一个用 TypeScript 实现的 MCP 服务器,提供了与 Matrix 家域服交互的工具。它具备连接到 Matrix 服务器、列出已加入的房间、获取房间消息等功能,能帮助开发者更便捷地与 Matrix 服务进行交互。

🚀 快速开始

matrix-mcp 是一款强大的 MCP 服务器,借助它可以轻松实现与 Matrix 家域服的交互。下面将为你详细介绍如何快速搭建并使用该服务器。

📦 安装指南

先决条件

  • Node.js 20 或更高版本
  • npm(Node 包管理器)

安装步骤

  1. 克隆仓库
    git clone <repository-url>
    cd matrix-mcp-server
    
  2. 安装依赖项
    npm install
    
  3. 运行服务器
    • 以开发模式启动 MCP 服务器:
    npm run dev
    
    • 要构建并在生产模式下运行服务器:
    npm run build
    npm start
    
    默认情况下,服务器将在 http://localhost:3000 上运行。

💻 使用示例

测试服务器

可以使用 Postman 或 curl 等工具测试服务器。例如,要连接到 Matrix 家域服,向 /connect-matrix 发送 POST 请求,携带以下 JSON 有效负载:

{
  "homeserverUrl": "https://matrix.org",
  "username": "your-username",
  "password": "your-password"
}

添加到 VSCode

将以下内容添加到 VSCode 的配置文件中:

{
  "servers": {
    "matrix-mcp": {
      "type": "stdio",
      "command": "<full-path-to>/node",
      "args": [
        "<full-path-to>/matrix-mcp-server/dist/server.js"
      ]
    }
  }
}

📚 详细文档

注意事项

⚠️ 重要提示

  • 此项目用于开发目的。在生产环境中使用时,请确保实施适当的安全措施和会话管理。
  • 参考 src/server.ts 文件以获取更多配置选项。

📄 许可证

此项目根据 MIT 许可证发布。

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