openproject-mcp_server

etrex/openproject-mcp_server

3.2

If you are the rightful owner of openproject-mcp_server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

The OpenProject MCP Server Plugin adds Model Context Protocol server functionality to OpenProject, enabling AI assistants to interact with OpenProject through the Model Context Protocol.

Tools
2
Resources
0
Prompts
0

OpenProject MCP Server Plugin

這是一個為 OpenProject 添加 MCP (Model Context Protocol) 伺服器功能的 plugin,讓 AI 助手能夠透過 Model Context Protocol 與 OpenProject 進行互動。

功能特色

  • 🔧 工作項目管理: 列出、查看、建立、更新工作項目
  • 📁 專案管理: 列出、查看、建立專案
  • 🔒 安全存取: 僅允許本地端存取
  • 🌐 Streamable HTTP: 支援最新的 MCP 傳輸協議
  • 📊 完整整合: 直接存取 OpenProject 的 Rails models

安裝

  1. 將此 plugin 加入到 OpenProject 的 Gemfile.modules
gem 'openproject-mcp_server', path: 'path/to/openproject-mcp_server'
  1. 執行 bundle install:
bundle install
  1. 重新啟動 OpenProject

使用方式

測試 MCP Server

# 測試伺服器是否運行
curl http://localhost:3000/mcp

# 測試工具列表
curl -X POST http://localhost:3000/mcp \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": "1",
    "method": "tools/list"
  }'

連接到 Claude Desktop

claude mcp add --transport http openproject http://localhost:3000/mcp

可用工具

1. Work Packages 工具
# 列出工作項目
curl -X POST http://localhost:3000/mcp \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": "2",
    "method": "tools/call",
    "params": {
      "name": "work_packages",
      "arguments": {
        "action": "list",
        "project_id": 1,
        "limit": 10
      }
    }
  }'

# 建立工作項目
curl -X POST http://localhost:3000/mcp \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": "3",
    "method": "tools/call",
    "params": {
      "name": "work_packages",
      "arguments": {
        "action": "create",
        "subject": "測試工作項目",
        "project_id": 1,
        "description": "這是透過 MCP 建立的工作項目"
      }
    }
  }'
2. Projects 工具
# 列出專案
curl -X POST http://localhost:3000/mcp \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": "4",
    "method": "tools/call",
    "params": {
      "name": "projects",
      "arguments": {
        "action": "list",
        "limit": 10
      }
    }
  }'

開發

擴展功能

要添加新的 MCP 工具,請在 app/tools/ 目錄下建立新的類別:

class MyCustomTool < ApplicationTool
  description "自訂工具描述"
  
  arguments do
    required(:param1).filled(:string).description("必要參數")
    optional(:param2).filled(:integer).description("可選參數")
  end
  
  def call(param1:, param2: nil)
    # 實作你的邏輯
    "處理結果"
  end
end

然後在 McpServerController 中註冊新工具。

安全性

  • 目前僅允許本地端存取 (localhost)
  • 在生產環境中,建議添加適當的認證機制
  • 可以透過修改 ensure_local_request 方法來調整存取控制

授權

GPL-3.0

貢獻

歡迎提交 Pull Request 和 Issue!

技術細節

  • 使用 Streamable HTTP 傳輸協議
  • 支援 JSON-RPC 2.0
  • 整合 OpenProject 的權限系統
  • 自動載入 tools 目錄中的類別