OpenProject MCP Server

OpenProject MCP Server

A comprehensive MCP server for integrating with OpenProject API, enabling AI assistants to manage projects, work packages, time tracking, and users.

Category
访问服务器

README

OpenProject MCP Server

A comprehensive Model Context Protocol (MCP) server for integrating with OpenProject API. This server enables AI assistants to interact with OpenProject instances for project management, work package handling, time tracking, and user management.

Features

🚀 Core Capabilities

  • Project Management: Create, read, update, and delete projects
  • Work Package Operations: Full CRUD operations for work packages (tasks, bugs, features)
  • User Management: Retrieve user information and current user details
  • Time Tracking: Create and manage time entries
  • Search Functionality: Search across projects, work packages, and users
  • API Testing: Connection testing and API information retrieval

🛠 Technical Features

  • Type Safety: Full TypeScript implementation with Zod validation
  • Error Handling: Comprehensive error handling and validation
  • Authentication: Support for API keys and basic authentication
  • Rate Limiting: Built-in rate limiting considerations
  • Caching: Configurable cache settings

Installation

Prerequisites

  • Node.js 18.0.0 or higher
  • OpenProject instance with API access
  • API key or user credentials for OpenProject

Setup

  1. Clone and install dependencies:
git clone <repository-url>
cd mcp-openproject
npm install
  1. Configure environment variables:
cp .env.example .env

Edit .env with your OpenProject configuration:

# OpenProject Configuration
OPENPROJECT_BASE_URL=https://your-openproject-instance.com
OPENPROJECT_API_KEY=your-api-key-here

# Optional: Basic Auth (alternative to API key)
# OPENPROJECT_USERNAME=your-username
# OPENPROJECT_PASSWORD=your-password

# MCP Server Configuration
MCP_SERVER_NAME=openproject-mcp
MCP_SERVER_VERSION=1.0.0

# Logging
LOG_LEVEL=info

# Rate Limiting
RATE_LIMIT_REQUESTS_PER_MINUTE=60

# Cache Settings
CACHE_TTL_SECONDS=300
  1. Build the project:
npm run build
  1. Test the connection:
npm run dev

Usage

Running the Server

Development mode:

npm run dev

Production mode:

npm start

Available Tools

Project Management

  • get_projects - List all projects with optional filtering and pagination
  • get_project - Get detailed information about a specific project
  • create_project - Create a new project
  • update_project - Update an existing project
  • delete_project - Delete a project

Work Package Management

  • get_work_packages - List work packages with filtering options
  • get_work_package - Get detailed work package information
  • create_work_package - Create a new work package
  • update_work_package - Update an existing work package

User Management

  • get_users - List all users
  • get_current_user - Get current authenticated user information

Time Tracking

  • get_time_entries - List time entries with filtering
  • create_time_entry - Log time against projects or work packages

Search & Utility

  • search - Search across projects, work packages, or users
  • test_connection - Test API connectivity
  • get_api_info - Get OpenProject API information

Example Tool Calls

Create a Project

{
  "name": "create_project",
  "arguments": {
    "name": "My New Project",
    "identifier": "my-new-project",
    "description": "A sample project created via MCP",
    "public": false
  }
}

Create a Work Package

{
  "name": "create_work_package",
  "arguments": {
    "subject": "Implement new feature",
    "description": "Add user authentication to the application",
    "projectId": 1,
    "typeId": 1,
    "priorityId": 2,
    "assigneeId": 5,
    "dueDate": "2024-12-31"
  }
}

Log Time Entry

{
  "name": "create_time_entry",
  "arguments": {
    "projectId": 1,
    "workPackageId": 123,
    "activityId": 1,
    "hours": "8.0",
    "comment": "Worked on user authentication implementation",
    "spentOn": "2024-01-15"
  }
}

Search Work Packages

{
  "name": "search",
  "arguments": {
    "query": "authentication",
    "type": "work_packages",
    "limit": 10
  }
}

Authentication

API Key (Recommended)

Set your OpenProject API key in the environment:

OPENPROJECT_API_KEY=your-api-key-here

Basic Authentication

Alternatively, use username/password:

OPENPROJECT_USERNAME=your-username
OPENPROJECT_PASSWORD=your-password

Configuration

Environment Variables

Variable Description Required Default
OPENPROJECT_BASE_URL OpenProject instance URL Yes -
OPENPROJECT_API_KEY API key for authentication No* -
OPENPROJECT_USERNAME Username for basic auth No* -
OPENPROJECT_PASSWORD Password for basic auth No* -
MCP_SERVER_NAME MCP server name No openproject-mcp
MCP_SERVER_VERSION MCP server version No 1.0.0
LOG_LEVEL Logging level No info
RATE_LIMIT_REQUESTS_PER_MINUTE Rate limiting No 60
CACHE_TTL_SECONDS Cache TTL No 300

*Either API key or username/password is required.

Development

Project Structure

src/
├── client/
│   └── openproject-client.ts    # OpenProject API client
├── handlers/
│   └── tool-handlers.ts          # MCP tool request handlers
├── tools/
│   └── index.ts                  # Tool definitions and schemas
├── types/
│   └── openproject.ts            # TypeScript types and Zod schemas
└── index.ts                      # Main MCP server implementation

Scripts

  • npm run build - Build TypeScript to JavaScript
  • npm run dev - Run in development mode with hot reload
  • npm start - Run the built server
  • npm test - Run tests
  • npm run lint - Run ESLint
  • npm run format - Format code with Prettier

Adding New Tools

  1. Define the tool schema in src/tools/index.ts
  2. Add the tool definition to the tools array
  3. Implement the handler in src/handlers/tool-handlers.ts
  4. Add types if needed in src/types/openproject.ts

Error Handling

The server includes comprehensive error handling:

  • Validation errors: Invalid input parameters
  • Authentication errors: Invalid credentials or expired tokens
  • API errors: OpenProject API failures
  • Network errors: Connection issues
  • Rate limiting: Too many requests

All errors are returned in a consistent format with descriptive messages.

Security Considerations

  • Environment Variables: Never commit .env files to version control
  • API Keys: Use API keys instead of passwords when possible
  • Rate Limiting: Respect OpenProject's rate limits
  • Input Validation: All inputs are validated using Zod schemas
  • Error Messages: Sensitive information is not exposed in error messages

Troubleshooting

Common Issues

  1. Connection Failed

    • Verify OPENPROJECT_BASE_URL is correct
    • Check network connectivity
    • Ensure OpenProject instance is accessible
  2. Authentication Failed

    • Verify API key or credentials are correct
    • Check user permissions in OpenProject
    • Ensure API access is enabled
  3. Tool Execution Errors

    • Check tool parameters match the schema
    • Verify required fields are provided
    • Check OpenProject permissions for the operation

Debug Mode

Enable debug logging:

LOG_LEVEL=debug

Usage Guide

Step 1: Server Setup

  1. Install Dependencies

    npm install
    
  2. Configure Environment

    cp .env.example .env
    # Edit .env with your OpenProject credentials
    
  3. Build the Server

    npm run build
    
  4. Start the Server

    npm start
    

    You should see:

    OpenProject MCP Server starting...
    Connected to OpenProject at: https://your-openproject-url.com
    OpenProject MCP Server started successfully!
    

Step 2: Integration with AI Agents

Claude Desktop Integration

  1. Install Claude Desktop from Anthropic's website

  2. Configure MCP Server in Claude Desktop:

    On macOS:

    # Edit Claude Desktop configuration
    code ~/Library/Application\ Support/Claude/claude_desktop_config.json
    

    On Windows:

    # Edit Claude Desktop configuration
    notepad %APPDATA%\Claude\claude_desktop_config.json
    
  3. Add Server Configuration:

    {
      "mcpServers": {
        "openproject": {
          "command": "node",
          "args": ["/path/to/your/mcp-openproject/dist/index.js"],
          "env": {
            "OPENPROJECT_BASE_URL": "https://your-openproject-url.com",
            "OPENPROJECT_API_KEY": "your-api-key-here",
            "NODE_TLS_REJECT_UNAUTHORIZED": "0"
          }
        }
      }
    }
    
  4. Restart Claude Desktop to load the MCP server

  5. Verify Connection - You should see the OpenProject tools available in Claude

Other MCP Clients

For other MCP-compatible clients, use the server as a subprocess:

// Example Node.js integration
const { spawn } = require('child_process');

const mcpServer = spawn('node', ['dist/index.js'], {
  env: {
    ...process.env,
    OPENPROJECT_BASE_URL: 'https://your-openproject-url.com',
    OPENPROJECT_API_KEY: 'your-api-key-here'
  },
  stdio: ['pipe', 'pipe', 'pipe']
});

// Handle MCP protocol communication
mcpServer.stdout.on('data', (data) => {
  // Process MCP responses
});

mcpServer.stdin.write(JSON.stringify({
  jsonrpc: '2.0',
  id: 1,
  method: 'tools/list'
}));

Step 3: Using the Tools

Once integrated, you can use natural language to interact with OpenProject:

Project Management

"Show me all projects in OpenProject"
"Create a new project called 'Website Redesign'"
"Get details for project ID 5"

Work Package Management

"List all work packages in the current sprint"
"Create a new task: 'Update user documentation'"
"Update work package #123 to set status as 'In Progress'"
"Search for work packages containing 'bug'"

User Management

"Show all users in the system"
"Get my user profile information"
"Find users with 'developer' in their name"

Time Tracking

"Show time entries for this week"
"Log 2 hours of work on work package #456"
"Get time entries for project 'Website Redesign'"

Step 4: Advanced Usage

Custom Queries

Use the search and filter capabilities:

"Find all high-priority work packages assigned to John"
"Show projects created in the last month"
"Get time entries for user ID 10 in January 2024"

Batch Operations

"Create 5 work packages for the sprint planning meeting"
"Update all work packages in project 'Mobile App' to add label 'v2.0'"

Troubleshooting

Common Issues

  1. Authentication Errors (401)

    • Verify your API key is correct
    • Check that the API key hasn't expired
    • Ensure you're using the correct OpenProject URL
  2. SSL Certificate Issues

    • For development: Set NODE_TLS_REJECT_UNAUTHORIZED=0
    • For production: Ensure proper SSL certificates
  3. Connection Timeouts

    • Check network connectivity to OpenProject instance
    • Verify firewall settings
    • Increase timeout in configuration if needed
  4. Permission Errors

    • Ensure your OpenProject user has appropriate permissions
    • Check project-specific access rights

Debug Mode

Enable detailed logging:

LOG_LEVEL=debug

This will show:

  • API request/response details
  • Authentication flow
  • Error stack traces
  • Performance metrics

API Key Generation

  1. Log into your OpenProject instance
  2. Go to "My Account" → "Access tokens"
  3. Click "Generate" in the API section
  4. Copy the generated key immediately (it won't be shown again)
  5. Add the key to your .env file

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Run linting and formatting
  6. Submit a pull request

License

MIT License - see LICENSE file for details.

Support

For issues and questions:


Note: This MCP server is designed to work with OpenProject's REST API v3. Ensure your OpenProject instance supports this API version.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选