# Wrike MCP Server

Complete Model Context Protocol (MCP) server for Wrike project management platform with 70+ tools and 20 interactive React apps.

## Features

### 🛠️ 70+ MCP Tools

Comprehensive coverage of the Wrike API v4:

#### Tasks (9 tools)
- `wrike_list_tasks` - List tasks with filters (folder, status, assignee, dates)
- `wrike_get_task` - Get task details by ID
- `wrike_create_task` - Create new task
- `wrike_update_task` - Update task properties
- `wrike_delete_task` - Delete task
- `wrike_search_tasks` - Search tasks by title/description
- `wrike_add_dependency` - Add task dependency
- `wrike_get_dependencies` - Get task dependencies
- `wrike_remove_dependency` - Remove task dependency

#### Folders & Projects (8 tools)
- `wrike_list_folders` - List all folders/projects
- `wrike_get_folder` - Get folder details
- `wrike_create_folder` - Create new folder
- `wrike_create_project` - Create new project
- `wrike_update_folder` - Update folder/project
- `wrike_delete_folder` - Delete folder
- `wrike_copy_folder` - Copy folder with options
- `wrike_get_folder_tree` - Get folder tree structure

#### Comments (5 tools)
- `wrike_list_comments` - List comments on task/folder
- `wrike_get_comment` - Get comment details
- `wrike_create_comment` - Create new comment
- `wrike_update_comment` - Update comment
- `wrike_delete_comment` - Delete comment

#### Attachments (7 tools)
- `wrike_list_attachments` - List attachments
- `wrike_get_attachment` - Get attachment details
- `wrike_download_attachment` - Get download URL
- `wrike_get_attachment_preview` - Get preview URL
- `wrike_get_attachment_url` - Get public URL
- `wrike_update_attachment` - Update attachment name
- `wrike_delete_attachment` - Delete attachment

#### Time Tracking (6 tools)
- `wrike_list_timelogs` - List time logs with filters
- `wrike_get_timelog` - Get timelog details
- `wrike_create_timelog` - Create time entry
- `wrike_update_timelog` - Update time entry
- `wrike_delete_timelog` - Delete time entry
- `wrike_list_timelog_categories` - List time categories

#### Contacts & Users (3 tools)
- `wrike_list_contacts` - List all contacts/users
- `wrike_get_contact` - Get contact details
- `wrike_update_contact` - Update contact

#### Spaces (5 tools)
- `wrike_list_spaces` - List all spaces
- `wrike_get_space` - Get space details
- `wrike_create_space` - Create new space
- `wrike_update_space` - Update space
- `wrike_delete_space` - Delete space

#### Groups (5 tools)
- `wrike_list_groups` - List all groups
- `wrike_get_group` - Get group details
- `wrike_create_group` - Create new group
- `wrike_update_group` - Update group
- `wrike_delete_group` - Delete group

#### Workflows & Custom Statuses (10 tools)
- `wrike_list_workflows` - List all workflows
- `wrike_get_workflow` - Get workflow details
- `wrike_create_workflow` - Create custom workflow
- `wrike_update_workflow` - Update workflow
- `wrike_list_custom_statuses` - List custom statuses
- `wrike_get_custom_status` - Get custom status
- `wrike_create_custom_status` - Create custom status
- `wrike_update_custom_status` - Update custom status
- `wrike_delete_custom_status` - Delete custom status

#### Custom Fields (5 tools)
- `wrike_list_custom_fields` - List custom field definitions
- `wrike_get_custom_field` - Get custom field details
- `wrike_create_custom_field` - Create custom field
- `wrike_update_custom_field` - Update custom field
- `wrike_delete_custom_field` - Delete custom field

#### Approvals (6 tools)
- `wrike_list_approvals` - List approvals with filters
- `wrike_get_approval` - Get approval details
- `wrike_create_approval` - Create new approval
- `wrike_update_approval` - Update approval
- `wrike_delete_approval` - Delete approval
- `wrike_submit_approval_decision` - Submit approve/reject decision

#### Webhooks (5 tools)
- `wrike_list_webhooks` - List all webhooks
- `wrike_get_webhook` - Get webhook details
- `wrike_create_webhook` - Create new webhook
- `wrike_update_webhook` - Update webhook
- `wrike_delete_webhook` - Delete webhook

#### Work Schedules, Export, Audit & More (10 tools)
- `wrike_list_work_schedules` - List work schedules
- `wrike_get_work_schedule` - Get work schedule details
- `wrike_start_data_export` - Start data export job
- `wrike_get_data_export_status` - Get export status
- `wrike_get_audit_log` - Get audit log entries
- `wrike_list_blueprints` - List blueprints/templates
- `wrike_get_blueprint` - Get blueprint details
- `wrike_launch_blueprint` - Launch blueprint to create project
- `wrike_get_account` - Get account information
- `wrike_get_version` - Get API version
- `wrike_list_invitations` - List pending invitations
- `wrike_invite_user` - Invite user to account
- `wrike_delete_invitation` - Cancel invitation
- `wrike_list_colors` - List available colors
- `wrike_query_ids` - Convert permalinks to IDs

### 🎨 20 Interactive React Apps

All apps built with React + Vite, client-side interactivity, and graceful degradation:

1. **task-dashboard** - Task overview with status breakdown and filters
2. **task-detail** - Full task detail view with edit capabilities
3. **task-board** - Kanban board with drag-drop
4. **project-dashboard** - Project overview with health status
5. **project-detail** - Detailed project view with timeline
6. **folder-tree** - Interactive folder hierarchy browser
7. **gantt-view** - Gantt chart visualization for tasks
8. **time-tracker** - Time tracking interface
9. **time-report** - Time log reports and analytics
10. **comment-thread** - Comment conversation view
11. **attachment-gallery** - Attachment preview gallery
12. **team-workload** - Team capacity and workload view
13. **workflow-editor** - Custom workflow designer
14. **custom-fields-manager** - Custom fields configuration
15. **approval-dashboard** - Approval status overview
16. **space-overview** - Space management dashboard
17. **blueprint-gallery** - Template/blueprint browser
18. **audit-log-viewer** - Audit log explorer
19. **search-results** - Advanced search results view
20. **analytics-dashboard** - Project analytics and reporting

## Installation

```bash
npm install @mcpengine/wrike
```

## Configuration

### Environment Variables

```bash
WRIKE_API_TOKEN=your_wrike_api_token_here
```

### Get Wrike API Token

1. Log in to your Wrike account
2. Go to Settings → Apps & Integrations → API
3. Click "Create token"
4. Copy the generated token
5. Add to your environment variables

### MCP Settings (Claude Desktop)

Add to your `claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "wrike": {
      "command": "node",
      "args": ["/path/to/node_modules/@mcpengine/wrike/dist/main.js"],
      "env": {
        "WRIKE_API_TOKEN": "your_token_here"
      }
    }
  }
}
```

## Usage

### With Claude Desktop

Once configured, Claude can:

- Create and manage tasks, projects, folders
- Track time across projects
- Manage comments and attachments
- Configure workflows and custom fields
- Submit and track approvals
- Export data and view audit logs
- Browse and launch project templates
- And much more!

Example prompts:
- "Show me all high-priority tasks due this week"
- "Create a new project called 'Website Redesign' with tasks for design, development, and testing"
- "Log 3 hours on task X for yesterday"
- "Show the folder tree for Space Y"
- "What approvals are pending?"

### Programmatic Usage

```typescript
import { WrikeClient } from '@mcpengine/wrike';

const client = new WrikeClient(process.env.WRIKE_API_TOKEN!);

// List tasks
const tasks = await client.get('/tasks', {
  status: 'Active',
  importance: 'High',
});

// Create task
const newTask = await client.post('/folders/FOLDER_ID/tasks', {
  title: 'New Task',
  description: 'Task description',
  importance: 'High',
});

// Update task
const updated = await client.put('/tasks/TASK_ID', {
  status: 'Completed',
});
```

## Architecture

```
src/
├── server.ts              # MCP server setup
├── main.ts                # Entry point
├── clients/
│   └── wrike.ts           # Wrike API client (auth, rate limiting, pagination)
├── tools/                 # MCP tool definitions
│   ├── tasks-tools.ts
│   ├── folders-tools.ts
│   ├── comments-tools.ts
│   ├── attachments-tools.ts
│   ├── timelogs-tools.ts
│   ├── contacts-tools.ts
│   ├── spaces-tools.ts
│   ├── groups-tools.ts
│   ├── workflows-tools.ts
│   ├── customfields-tools.ts
│   ├── approvals-tools.ts
│   ├── webhooks-tools.ts
│   └── misc-tools.ts
├── types/
│   └── index.ts           # TypeScript type definitions
└── ui/
    └── react-app/         # React apps (20 apps)
```

## API Client Features

- **Authentication**: Bearer token authentication
- **Rate Limiting**: Automatic rate limit detection and retry
- **Error Handling**: Comprehensive error mapping
- **Pagination**: Helper methods for paginated responses
- **Batch Operations**: Efficient batch requests
- **Type Safety**: Full TypeScript type definitions

## Development

```bash
# Install dependencies
npm install

# Build
npm run build

# Build with apps
npm run build:apps

# Development mode
npm run dev

# Run tests
npm test
```

## Requirements

- Node.js 18+
- Wrike account with API access
- Valid Wrike API token

## License

MIT

## Support

- GitHub Issues: [Report bugs or request features]
- Documentation: [Wrike API Docs](https://developers.wrike.com/)

## Related

- [MCP SDK](https://github.com/modelcontextprotocol/sdk)
- [Wrike API](https://developers.wrike.com/)
- [MCPEngine](https://github.com/BusyBee3333/mcpengine)
