本指南将帮助您快速搭建和使用 Sentry MCP 服务器,为您的项目提供高效的监控和管理服务。
运行以下命令启动服务:
npm start
默认情况下,服务器将在 http://localhost:3000 上运行。
打开浏览器访问 http://localhost:3000/docs 查看 Swagger UI 文档。
使用 Git 克隆项目仓库:
git clone https://github.com/srcgrp/sentry-mcp-server.git
cd sentry-mcp-server
进入项目目录后,安装所需的依赖项:
npm install
创建并编辑 .env 文件:
PORT=3000
SENTRY_PUBLIC_KEY=your_sentry_public_key
SENTRY_PRIVATE_KEY=your_sentry_private_key
SENTRY_PROJECT_slug=your_project_slug
npm install sentry-mcp-server --save
在项目中初始化模块:
const SentryMCP = require('sentry-mcp-server');
SentryMCP.init({
public: 'your_sentry_public_key',
private: 'your_sentry_private_key',
project: 'your_project_slug'
});
编辑 config.json 文件:
{
"port": 3000,
"sentry": {
"publicKey": "your_sentry_public_key",
"privateKey": "your_sentry_private_key",
"projectSlug": "your_project_slug"
}
}
在 nginx.conf 中添加反向代理配置:
server {
listen 80;
server_name your_domain;
location / {
proxy_pass http://localhost:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
访问文档页面:
npm run docs
提交代码到仓库时,请确保遵循 CONTRIBUTING.md 文件中的指南。
欢迎所有贡献者参与项目!请参考 CONTRIBUTING.md 文件了解如何贡献代码。
如需支持或遇到问题,请访问我们的 Discussions 页面进行反馈。
感谢您对 Sentry MCP 服务器的支持!希望这个工具能为您的项目带来便利。