Redmine集成服务器

高性能的Rust实现,提供35种API工具,用于Redmine集成,支持实时日志查看和多平台运行。

  • by Sunalamye
  • Rust
  • 本地部署
  • 1 星标
  • 更新于
在 GitHub 查看 Sunalamye/RedmineMCP

使用说明

Redmine MCP

用于Redmine集成的MCP服务器。具有35个API工具的高性能Rust实现。

特性

  • 35 API工具 -完全覆盖Redmine API
  • 日志查看器 -支持WebSocket的实时基于web的日志查看器
  • 交叉平台的 -适用于macOS、Linux和Windows的预构建二进制文件
  • 高性能 -具有异步I/O的原生Rust实现

工具类别

类别 工具
问题 获取问题、获取问题、更新问题、获取期刊
时间条目 get_Time_entrys、create_Time_entry、get_activities
项目和用户 获取项目、获取成员、获取用户、获取当前用户
Wiki get_Wiki_pages、get_Wiki-page、update_Wiki_page
文件 获取文件、获取附件、上传、下载
搜索 搜索(跨问题/wiki/新闻的全文)
通用 请求(自定义API调用)
实用程序 log_viewer

安装

选项1:克劳德代码市场(推荐)

直接从Claude代码安装:

claude mcp add-from-url https://github.com/Sunalamye/RedmineMCP

然后设置环境变量:

export REDMINE_URL="https://your-redmine.example.com"
export REDMINE_TOKEN="your-api-token-here"

该二进制文件将在首次使用时自动下载。

选项2:手动下载

预构建的二进制文件可从 发布 页面。

平台 文件 架构
macOS redmine-mcp-*-macos-arm64 苹果硅(M1/M2/M3)
Linux redmine-mcp-*-linux-arm64 ARM64
窗户 redmine-mcp-*-windows-x64.exe x64

快速开始

1.获取您的API代币

  1. 登录您的Redmine实例
  2. 首选 我的账户 (点击您的用户名)
  3. 找到 API访问密钥 在右侧边栏上
  4. 点击 展示 显示您的令牌

2.配置MCP客户端(仅限手动安装)

如果您是通过市场安装的,请跳过此部分-MCP是自动配置的。

克劳德代码

创建 .mcp.json 在您的项目目录中:

{
  "mcpServers": {
    "redmine": {
      "command": "/path/to/redmine-mcp",
      "env": {
        "REDMINE_URL": "https://your-redmine.example.com",
        "REDMINE_TOKEN": "your-api-token-here",
        "LOG_VIEWER": "true"
      }
    }
  }
}

开源代码

创建 opencode.json 在您的项目目录中:

{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "redmine": {
      "type": "local",
      "command": ["/path/to/redmine-mcp"],
      "enabled": true,
      "environment": {
        "REDMINE_URL": "https://your-redmine.example.com",
        "REDMINE_TOKEN": "your-api-token-here"
      }
    }
  }
}

环境变量

变量 必填 默认 描述
REDMINE_URL 是 - Redmine实例URL
REDMINE_TOKEN 是 - neneneba API令牌
LOG_LEVEL 没有 info 日志级别:调试/信息/警告/错误
LOG_VIEWER 没有 true 启用日志查看器web UI
LOG_VIEWER_PORT 没有 3456 日志查看器服务器端口
LOG_VIEWER_OPEN 没有 true 启动时自动打开浏览器

使用示例

# Get all open issues
redmine_get_issues(status_id: "open")

# Get issues assigned to me
redmine_get_issues(assigned_to_id: "me")

# Get single issue with history
redmine_get_issue(id: 12345)

# Add a note to an issue
redmine_update_issue(id: 12345, notes: "Task completed")

# Log time on an issue
redmine_create_time_entry(issue_id: 12345, hours: 2, comments: "Bug fix")

# Full-text search
redmine_search(q: "authentication", scope: "issues")

# Open Log Viewer in browser
redmine_log_viewer(open: true)

日志查看器

内置的日志查看器提供对MCP请求的实时监控:

  • 实时更新 通过WebSocket
  • 按级别过滤 (调试/信息/警告/错误)
  • 按工具筛选 名字
  • JSON查看器 用于请求/响应数据
  • 自动编辑 的敏感数据(API令牌)

访问地址: http://localhost:3456 当服务器正在运行时。

从源头构建

先决条件

  • 锈蚀1.75+(含 cargo)
  • 交叉编译: cargo-zigbuild

构建

cd rust

# Debug build
cargo build

# Release build
cargo build --release

# Cross-compile for multiple platforms
./build-release.sh

测试

提供了一个Docker Compose文件用于本地测试:

cd rust/test
docker-compose up -d

# Access Redmine at http://localhost:3000
# Default login: admin / admin

# Enable API: Administration → Settings → API → Enable REST web service

安全说明

  • .mcp.json 和 opencode.json 包含您的API令牌
  • 不要将这些文件提交到版本控制
  • 日志查看器自动编辑日志中的API令牌

许可证

麻省理工学院