Перейти к содержимому

MCP Server

Это содержимое пока не доступно на вашем языке.

The OpenPR MCP server implements the Model Context Protocol to give AI agents structured access to project management operations. Rather than screen-scraping a web UI or parsing API docs, agents interact through typed tool definitions with JSON Schema input validation.

The MCP server supports three transport modes:

TransportUse CaseCommand
HTTPRemote agents, production deploymentsmcp-server serve --transport http --bind-addr 0.0.0.0:8090
stdioLocal agents, IDE integrationsmcp-server serve --transport stdio
SSEBrowser-based agents, streamingmcp-server serve --transport sse

In the default Docker Compose deployment, the MCP server runs on port 8090 with HTTP transport.

The MCP server authenticates using bot tokens with the opr_ prefix. These tokens are workspace-scoped and stored as SHA-256 hashes in the workspace_bots table.

Bot tokens support:

  • Expiration dates (optional)
  • Permission arrays (read, write, admin)
  • Active/inactive status
  • Automatic last_used_at tracking

The MCP server requires these environment variables:

VariableDescription
OPENPR_API_URLBase URL of the OpenPR API
OPENPR_BOT_TOKENBot token (opr_ prefix) for authentication
OPENPR_WORKSPACE_IDUUID of the workspace to operate in
DEFAULT_AUTHOR_IDDefault user ID for operations without explicit author

The MCP server exposes 34 tools organized into the following categories.

ToolDescription
projects.listList all projects in the workspace
projects.getGet project details by UUID
projects.createCreate a new project with name and key
projects.updateUpdate project fields
projects.deleteDelete a project
ToolDescription
work_items.listList issues in a project with optional filters (state, priority, assignee, sprint)
work_items.getGet a single issue by UUID
work_items.get_by_identifierGet an issue by its human-readable key (e.g., PROJ-A1B2C3D4)
work_items.createCreate a new issue with title, description, state, priority, assignee
work_items.updateUpdate issue fields (title, description, state, priority, assignee, sprint)
work_items.deleteDelete an issue
work_items.searchFull-text search across issue titles and descriptions
work_items.add_labelAdd a single label to an issue
work_items.add_labelsAdd multiple labels to an issue in one call
work_items.remove_labelRemove a label from an issue
work_items.list_labelsList all labels on an issue
ToolDescription
sprints.createCreate a sprint with name, start date, end date
sprints.listList all sprints in a project
sprints.updateUpdate sprint fields (name, status, dates)
sprints.deleteDelete a sprint
ToolDescription
comments.listList comments on an issue
comments.createAdd a comment to an issue
comments.deleteDelete a comment
ToolDescription
labels.createCreate a label with name and color
labels.listList all labels in the workspace
labels.list_projectList labels scoped to a specific project
labels.updateUpdate label name or color
labels.deleteDelete a label
ToolDescription
proposals.listList proposals for a project, optionally filtered by status
proposals.getGet proposal details (supports both UUID and PROP- prefixed IDs)
proposals.createCreate a new proposal with title, description, and project
ToolDescription
members.listList all members in the workspace
ToolDescription
files.uploadUpload a file attachment
ToolDescription
search.allGlobal search across all entity types

Every tool definition includes a JSON Schema for input validation. Parameters use UUID format for entity references and enforce required fields at the schema level.

Example: work_items.create input schema:

{
"type": "object",
"properties": {
"project_id": {
"type": "string",
"description": "UUID of the project",
"pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
},
"title": {
"type": "string",
"description": "Issue title"
},
"description": {
"type": "string",
"description": "Issue description (optional)"
},
"state": {
"type": "string",
"description": "Issue state: backlog, todo, in_progress, done"
},
"priority": {
"type": "string",
"description": "Priority: low, medium, high, urgent"
},
"assignee_id": {
"type": "string",
"description": "UUID of the assignee (optional)"
}
},
"required": ["project_id", "title"]
}

All tools return a CallToolResult with either a success payload (JSON-formatted data) or an error message string. Success responses contain the full entity representation as pretty-printed JSON.

{
"mcpServers": {
"openpr": {
"url": "http://localhost:8090/mcp",
"transport": "http",
"headers": {
"Authorization": "Bearer opr_your_bot_token_here"
}
}
}
}
{
"mcpServers": {
"openpr": {
"command": "/path/to/mcp-server",
"args": ["serve", "--transport", "stdio"],
"env": {
"OPENPR_API_URL": "http://localhost:8081",
"OPENPR_BOT_TOKEN": "opr_your_bot_token_here",
"OPENPR_WORKSPACE_ID": "your-workspace-uuid"
}
}
}
}

The MCP server includes a built-in tool listing utility:

Terminal window
# Print all tool definitions as JSON
mcp-server list-tools

This outputs every tool name, description, and input schema — useful for debugging or generating client code.