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.
- 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
- 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
- Node.js 18.0.0 or higher
- OpenProject instance with API access
- API key or user credentials for OpenProject
- Clone and install dependencies:
git clone <repository-url>
cd mcp-openproject
npm install- Configure environment variables:
cp .env.example .envEdit .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- Build the project:
npm run build- Test the connection:
npm run devDevelopment mode:
npm run devProduction mode:
npm startget_projects- List all projects with optional filtering and paginationget_project- Get detailed information about a specific projectcreate_project- Create a new projectupdate_project- Update an existing projectdelete_project- Delete a project
get_work_packages- List work packages with filtering optionsget_work_package- Get detailed work package informationcreate_work_package- Create a new work packageupdate_work_package- Update an existing work package
get_users- List all usersget_current_user- Get current authenticated user information
get_time_entries- List time entries with filteringcreate_time_entry- Log time against projects or work packages
search- Search across projects, work packages, or userstest_connection- Test API connectivityget_api_info- Get OpenProject API information
{
"name": "create_project",
"arguments": {
"name": "My New Project",
"identifier": "my-new-project",
"description": "A sample project created via MCP",
"public": false
}
}{
"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"
}
}{
"name": "create_time_entry",
"arguments": {
"projectId": 1,
"workPackageId": 123,
"activityId": 1,
"hours": "8.0",
"comment": "Worked on user authentication implementation",
"spentOn": "2024-01-15"
}
}{
"name": "search",
"arguments": {
"query": "authentication",
"type": "work_packages",
"limit": 10
}
}Set your OpenProject API key in the environment:
OPENPROJECT_API_KEY=your-api-key-hereAlternatively, use username/password:
OPENPROJECT_USERNAME=your-username
OPENPROJECT_PASSWORD=your-password| 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.
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
npm run build- Build TypeScript to JavaScriptnpm run dev- Run in development mode with hot reloadnpm start- Run the built servernpm test- Run testsnpm run lint- Run ESLintnpm run format- Format code with Prettier
- Define the tool schema in
src/tools/index.ts - Add the tool definition to the tools array
- Implement the handler in
src/handlers/tool-handlers.ts - Add types if needed in
src/types/openproject.ts
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.
- Environment Variables: Never commit
.envfiles 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
-
Connection Failed
- Verify
OPENPROJECT_BASE_URLis correct - Check network connectivity
- Ensure OpenProject instance is accessible
- Verify
-
Authentication Failed
- Verify API key or credentials are correct
- Check user permissions in OpenProject
- Ensure API access is enabled
-
Tool Execution Errors
- Check tool parameters match the schema
- Verify required fields are provided
- Check OpenProject permissions for the operation
Enable debug logging:
LOG_LEVEL=debug-
Install Dependencies
npm install
-
Configure Environment
cp .env.example .env # Edit .env with your OpenProject credentials -
Build the Server
npm run build
-
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!
-
Install Claude Desktop from Anthropic's website
-
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
-
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" } } } } -
Restart Claude Desktop to load the MCP server
-
Verify Connection - You should see the OpenProject tools available in Claude
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'
}));Once integrated, you can use natural language to interact with OpenProject:
"Show me all projects in OpenProject"
"Create a new project called 'Website Redesign'"
"Get details for project ID 5"
"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'"
"Show all users in the system"
"Get my user profile information"
"Find users with 'developer' in their name"
"Show time entries for this week"
"Log 2 hours of work on work package #456"
"Get time entries for project 'Website Redesign'"
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"
"Create 5 work packages for the sprint planning meeting"
"Update all work packages in project 'Mobile App' to add label 'v2.0'"
-
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
-
SSL Certificate Issues
- For development: Set
NODE_TLS_REJECT_UNAUTHORIZED=0 - For production: Ensure proper SSL certificates
- For development: Set
-
Connection Timeouts
- Check network connectivity to OpenProject instance
- Verify firewall settings
- Increase timeout in configuration if needed
-
Permission Errors
- Ensure your OpenProject user has appropriate permissions
- Check project-specific access rights
Enable detailed logging:
LOG_LEVEL=debugThis will show:
- API request/response details
- Authentication flow
- Error stack traces
- Performance metrics
- Log into your OpenProject instance
- Go to "My Account" → "Access tokens"
- Click "Generate" in the API section
- Copy the generated key immediately (it won't be shown again)
- Add the key to your
.envfile
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Run linting and formatting
- Submit a pull request
MIT License - see LICENSE file for details.
For issues and questions:
- Check the OpenProject API documentation
- Review the MCP specification
- Open an issue in this repository
Note: This MCP server is designed to work with OpenProject's REST API v3. Ensure your OpenProject instance supports this API version.