article
README
🚀 matrix-mcp
matrix-mcp 是一个用 TypeScript 实现的 MCP 服务器,提供了与 Matrix 家域服交互的工具。它具备连接到 Matrix 服务器、列出已加入的房间、获取房间消息等功能,能帮助开发者更便捷地与 Matrix 服务进行交互。
🚀 快速开始
matrix-mcp 是一款强大的 MCP 服务器,借助它可以轻松实现与 Matrix 家域服的交互。下面将为你详细介绍如何快速搭建并使用该服务器。
📦 安装指南
先决条件
- Node.js 20 或更高版本
- npm(Node 包管理器)
安装步骤
- 克隆仓库
git clone <repository-url> cd matrix-mcp-server - 安装依赖项
npm install - 运行服务器
- 以开发模式启动 MCP 服务器:
npm run dev- 要构建并在生产模式下运行服务器:
默认情况下,服务器将在npm run build npm starthttp://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 许可证发布。
扫码联系在线客服