Skip to content
This page was generated and translated with the assistance of AI. If you spot any inaccuracies, feel free to help improve it. Edit on GitHub

MCP Server

OpenPR includes a built-in MCP (Model Context Protocol) server that exposes 34 tools for AI assistants to manage projects, issues, sprints, labels, comments, proposals, and files. The server supports three transport protocols simultaneously.

Transport Protocols

ProtocolUse CaseEndpoint
HTTPWeb integrations, OpenClaw pluginsPOST /mcp/rpc
stdioClaude Desktop, Codex, local CLIstdin/stdout JSON-RPC
SSEStreaming clients, real-time UIsGET /sse + POST /messages

Multi-Protocol

In HTTP mode, all three protocols are available on a single port: /mcp/rpc (HTTP), /sse + /messages (SSE), and /health (health check).

Configuration

Environment Variables

VariableRequiredDescriptionExample
OPENPR_API_URLYesAPI server base URLhttp://localhost:3000
OPENPR_BOT_TOKENYesBot token with opr_ prefixopr_abc123...
OPENPR_WORKSPACE_IDYesDefault workspace UUIDe5166fd1-...

Claude Desktop / Cursor / Codex (stdio)

Add to your MCP client configuration:

json
{
  "mcpServers": {
    "openpr": {
      "command": "/path/to/mcp-server",
      "args": ["--transport", "stdio"],
      "env": {
        "OPENPR_API_URL": "http://localhost:3000",
        "OPENPR_BOT_TOKEN": "opr_your_token_here",
        "OPENPR_WORKSPACE_ID": "your-workspace-uuid"
      }
    }
  }
}

HTTP Mode

bash
# Start the MCP server
./target/release/mcp-server --transport http --bind-addr 0.0.0.0:8090

# Verify
curl -X POST http://localhost:8090/mcp/rpc \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

SSE Mode

bash
# 1. Connect SSE stream (returns session endpoint)
curl -N -H "Accept: text/event-stream" http://localhost:8090/sse
# -> event: endpoint
# -> data: /messages?session_id=<uuid>

# 2. POST request to the returned endpoint
curl -X POST "http://localhost:8090/messages?session_id=<uuid>" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"projects.list","arguments":{}}}'
# -> Response arrives via SSE stream as event: message

Docker Compose

yaml
mcp-server:
  build:
    context: .
    dockerfile: Dockerfile.prebuilt
    args:
      APP_BIN: mcp-server
  environment:
    - OPENPR_API_URL=http://api:8080
    - OPENPR_BOT_TOKEN=opr_your_token
    - OPENPR_WORKSPACE_ID=your-workspace-uuid
  ports:
    - "8090:8090"
  command: ["./mcp-server", "--transport", "http", "--bind-addr", "0.0.0.0:8090"]

Tool Reference (34 Tools)

Projects (5)

ToolRequired ParamsDescription
projects.list--List all projects in workspace
projects.getproject_idGet project details with issue counts
projects.createkey, nameCreate a project
projects.updateproject_idUpdate name/description
projects.deleteproject_idDelete a project

Work Items / Issues (11)

ToolRequired ParamsDescription
work_items.listproject_idList issues in a project
work_items.getwork_item_idGet issue by UUID
work_items.get_by_identifieridentifierGet by human ID (e.g., API-42)
work_items.createproject_id, titleCreate issue with optional state, priority, description, assignee_id, due_at, attachments
work_items.updatework_item_idUpdate any field
work_items.deletework_item_idDelete an issue
work_items.searchqueryFull-text search across all projects
work_items.add_labelwork_item_id, label_idAdd one label
work_items.add_labelswork_item_id, label_idsAdd multiple labels
work_items.remove_labelwork_item_id, label_idRemove a label
work_items.list_labelswork_item_idList labels on an issue

Comments (3)

ToolRequired ParamsDescription
comments.creatework_item_id, contentCreate comment with optional attachments
comments.listwork_item_idList comments on an issue
comments.deletecomment_idDelete a comment

Files (1)

ToolRequired ParamsDescription
files.uploadfilename, content_base64Upload file (base64), returns URL and filename

Labels (5)

ToolRequired ParamsDescription
labels.list--List all workspace labels
labels.list_by_projectproject_idList labels for a project
labels.createname, colorCreate label (color: hex, e.g., #2563eb)
labels.updatelabel_idUpdate name/color/description
labels.deletelabel_idDelete a label

Sprints (4)

ToolRequired ParamsDescription
sprints.listproject_idList sprints in a project
sprints.createproject_id, nameCreate sprint with optional start_date, end_date
sprints.updatesprint_idUpdate name/dates/status
sprints.deletesprint_idDelete a sprint

Proposals (3)

ToolRequired ParamsDescription
proposals.listproject_idList proposals with optional status filter
proposals.getproposal_idGet proposal details
proposals.createproject_id, title, descriptionCreate a governance proposal

Members & Search (2)

ToolRequired ParamsDescription
members.list--List workspace members and roles
search.allqueryGlobal search across projects, issues, comments

Response Format

All MCP tool responses follow this structure:

Success

json
{
  "code": 0,
  "message": "success",
  "data": { ... }
}

Error

json
{
  "code": 400,
  "message": "error description"
}

Bot Token Authentication

The MCP server authenticates via bot tokens (prefix opr_). Create bot tokens in Workspace Settings > Bot Tokens.

Each bot token:

  • Has a display name (shown in activity feeds)
  • Is scoped to one workspace
  • Creates a bot_mcp user entity for audit trail integrity
  • Supports all read/write operations available to workspace members

Agent Integration

For coding agents, OpenPR provides:

  • AGENTS.md (apps/mcp-server/AGENTS.md) -- Workflow patterns and tool examples for agents.
  • Skill Package (skills/openpr-mcp/SKILL.md) -- Governed skill with workflow templates and scripts.

Recommended agent workflow:

  1. Load AGENTS.md for tool semantics.
  2. Use tools/list to enumerate available tools at runtime.
  3. Follow workflow patterns: search -> create -> label -> comment.

Next Steps

Released under the Apache-2.0 License.