Skip to main content
Glama

Motion MCP Server

A production-ready MCP (Model Context Protocol) Server that integrates with Motion (usemotion.com) task management platform. This server enables AI assistants to manage projects and tasks through Motion's API while maintaining local context in .claude/motion/ directory using markdown files.

Features

🎯 Core Functionality

  • Full Motion API Integration: Projects, tasks, workspaces, users, comments

  • Local Storage: Markdown-based task files with YAML frontmatter

  • Bidirectional Sync: Keep local and remote data in sync with conflict resolution

  • Rate Limited: Respects Motion's API limits (12/min individual, 120/min team)

πŸ€– AI-Powered Features

  • Task Enrichment: AI-enhanced descriptions and acceptance criteria

  • Goal Breakdown: Convert high-level goals into actionable task lists

  • Workflow Planning: Generate comprehensive project plans

  • Status Reports: Automated progress summaries

πŸ“ MCP Resources

  • Project Overviews: Real-time project status and metrics

  • Task Files: Individual task details as markdown resources

  • Documentation: Project docs accessible through MCP

  • AI Prompts: Templates for task planning and reporting

Related MCP server: Motion MCP Server

Installation

Prerequisites

  • Node.js 18+ and npm

  • Motion account with API key

  • Claude Desktop (for MCP integration)

Setup

  1. Clone and Install

git clone https://github.com/idxstudios/use-motion-mcp-server.git
cd use-motion-mcp-server
npm install
  1. Configure Environment

# Copy example environment file
cp .env.example .env

# Edit .env with your Motion API key
MOTION_API_KEY=your_motion_api_key_here
MOTION_IS_TEAM_ACCOUNT=false  # true for team accounts
  1. Build the Server

# Generate OpenAPI routes first (required for first build)
make openapi

# Full build with OpenAPI generation + TypeScript compilation
make build

# OR for TypeScript compilation only (after OpenAPI generated)
npm run build
  1. Configure Claude Desktop Edit your claude_desktop_config.json:

{
  "mcpServers": {
    "motion": {
      "command": "node",
      "args": ["/absolute/path/to/motion-mcp-server/dist/server/index.js"],
      "env": {
        "MOTION_API_KEY": "your-motion-api-key"
      }
    }
  }
}

Architecture

The server follows a Domain Controllers β†’ App (Commands/Queries) β†’ Services pattern with Functional/Reactive Programming (FRP) principles:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚Domain Controllers│───▢│   App Layer     │───▢│    Services     β”‚
β”‚  (MCP Handlers) β”‚    β”‚ Commands/Queriesβ”‚    β”‚ Motion/Storage  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ—‚οΈ Directory Structure

src/
β”œβ”€β”€ api/mcp/v1-routes/     # Generated OpenAPI code
β”‚   β”œβ”€β”€ models/            # Generated TypeScript interfaces
β”‚   β”œβ”€β”€ routes/            # Generated controller interfaces
β”‚   └── tools.ts           # Generated MCP tool schemas
β”œβ”€β”€ api/mcp/v1-controllers/# Domain controller implementations
β”‚   β”œβ”€β”€ project-controller.ts
β”‚   β”œβ”€β”€ task-controller.ts
β”‚   β”œβ”€β”€ workflow-controller.ts
β”‚   β”œβ”€β”€ sync-controller.ts
β”‚   β”œβ”€β”€ context-controller.ts
β”‚   └── docs-controller.ts
β”œβ”€β”€ app/                   # Business logic layer
β”‚   β”œβ”€β”€ motion/            # Motion API commands & queries
β”‚   β”œβ”€β”€ projects/          # Project commands & queries
β”‚   β”œβ”€β”€ tasks/             # Task commands & queries
β”‚   β”œβ”€β”€ workflow/          # Workflow planning
β”‚   β”œβ”€β”€ sync/              # Synchronization logic
β”‚   β”œβ”€β”€ context/           # Context management
β”‚   └── docs/              # Documentation generation
β”œβ”€β”€ services/              # External service integrations
β”‚   β”œβ”€β”€ motion-service.ts  # Motion API client
β”‚   β”œβ”€β”€ storage/           # Local file management
β”‚   └── ai/                # AI enhancements
β”œβ”€β”€ setup/                 # Configuration and DI
β”‚   └── dependencies.ts    # Dependency injection
└── server/index.ts        # MCP server entry point

πŸ”§ OpenAPI-Based Code Generation

Tools and interfaces are generated from YAML schemas:

  • Define tools in schemas/mcp/v1/mcp-tools.yaml

  • Custom Handlebars templates in schemas/api-gen/server/

  • Generated code in src/api/mcp/v1-routes/

  • Run make openapi to regenerate

Available Tools

πŸ“‹ Project Management

  • motion.project.list - List all projects with pagination

  • motion.project.create - Create new projects

  • motion.project.bind - Bind project to local storage

  • motion.project.sync - Sync project with Motion

βœ… Task Operations

  • motion.task.create - Create tasks (with AI enrichment)

  • motion.task.list - List and filter tasks

  • motion.task.search - Search tasks in local storage

  • motion.task.update - Update task properties

  • motion.task.complete - Mark tasks as completed

πŸ€– AI Features

  • motion.task.enrich - AI-enhance task descriptions

  • motion.task.batch_create - Create multiple tasks from goals

  • motion.task.analyze - Analyze task complexity

  • motion.workflow.plan - Generate comprehensive plans

πŸ”„ Sync & Context

  • motion.sync.all - Sync all bound projects

  • motion.sync.check - Check sync status

  • motion.context.save - Save project context for AI

  • motion.context.load - Load project context

πŸ“„ Documentation

  • motion.docs.create - Generate project documentation

  • motion.docs.update - Update existing docs

  • motion.status.report - Generate status reports

🏒 Workspace Management

  • motion.workspace.list - List all available workspaces

  • motion.workspace.set_default - Set default workspace for new projects

  • motion.workspace.get_settings - Get workspace-specific settings

  • motion.workspace.update_settings - Update workspace preferences

Local Storage Structure

The server maintains local context in .claude/motion/:

.claude/motion/
β”œβ”€β”€ workspace-settings/
β”‚   β”œβ”€β”€ default.json      # Default workspace configuration
β”‚   └── [workspace-id].json # Workspace-specific settings
└── [project-id]/
    β”œβ”€β”€ meta.json         # Project metadata
    β”œβ”€β”€ tasks/
    β”‚   └── [task-id].md  # Task files with YAML frontmatter
    └── docs/
        └── *.md          # Project documentation

Task File Format

---
id: task_123
projectId: proj_456
status: In Progress
priority: HIGH
duration: 120
# ... other metadata
---

# Task Title

## Description
Detailed task description...

## Acceptance Criteria
- [ ] Criteria 1
- [ ] Criteria 2

Workspace Settings Format

{
  "workspaceId": "workspace_123",
  "defaultProjectId": "project_456",
  "defaultPriority": "MEDIUM",
  "defaultDuration": 60,
  "aiProvider": "openai"
}

Development

πŸ› οΈ Build Commands (Make)

make help          # Show all available commands
make install       # Install dependencies
make build         # Build the project
make test          # Run tests
make lint          # Run linter
make dev           # Start development server
make check         # Run all quality checks
make docker-build  # Build Docker image

πŸ” Testing

# Run all tests
npm test

# Run with coverage
npm run test:coverage

# Run specific test files
npm test -- --testPathPattern=tasks

πŸ“Š Monitoring

The server includes comprehensive error handling and logging:

  • Request/response logging

  • Rate limit monitoring

  • Sync conflict detection

  • Validation error reporting

Docker Deployment

Build and Run

# Build image
make docker-build

# Run container
docker run -it --rm \
  -v "${PWD}/.claude:/app/.claude" \
  -e MOTION_API_KEY="your-api-key" \
  motion-mcp-server

Docker Compose

version: '3.8'
services:
  motion-mcp:
    build: .
    volumes:
      - ./.claude:/app/.claude
    environment:
      - MOTION_API_KEY=${MOTION_API_KEY}
      - MOTION_IS_TEAM_ACCOUNT=false

Configuration

Environment Variables

MOTION_API_KEY=              # Required: Your Motion API key
MOTION_IS_TEAM_ACCOUNT=      # Rate limit configuration
MOTION_BASE_URL=             # Motion API base URL
REQUEST_TIMEOUT=             # API request timeout (ms)
CLAUDE_DATA_DIR=             # Local storage directory
LOG_LEVEL=                   # Logging verbosity

Rate Limiting

The server automatically detects account type and applies appropriate limits:

  • Individual accounts: 12 requests/minute

  • Team accounts: 120 requests/minute

Troubleshooting

Common Issues

❌ "Motion API key not found"

# Check environment variables
echo $MOTION_API_KEY

# Verify .env file
cat .env

❌ "Project not bound locally"

# First bind the project
# Use motion.project.bind tool in Claude

❌ Rate limit exceeded

# Check if team account flag is correct
MOTION_IS_TEAM_ACCOUNT=true  # For team accounts

Debug Mode

# Enable debug logging
export LOG_LEVEL=debug
npm start

API Reference

The server implements all major Motion API endpoints:

Contributing

  1. Fork the repository

  2. Create a feature branch

  3. Make your changes

  4. Add tests for new functionality

  5. Run quality checks: make check

  6. Submit a pull request

Code Style

  • TypeScript with strict mode

  • Functional/Reactive Programming patterns

  • Immutable data structures

  • Pure functions without side effects

License

MIT License - see LICENSE file for details.

Support


Built with ❀️ for the Claude ecosystem

Available Tools

25 tools
motion.context.loadC

Load project context

Inputs: projectId.

motion.context.saveC

Save project context for AI

Inputs: context, projectId.

motion.docs.createC

Generate project documentation

Inputs: type, template, projectId.

motion.docs.updateC

Update existing docs

Inputs: docId, content, projectId.

motion.project.bindC

Bind project to local storage

Inputs: projectId.

motion.project.createD

Create a new project

Inputs: name, description, workspaceId.

motion.project.listC

List all projects with pagination

Inputs: limit, cursor, workspaceId.

motion.project.syncD

Sync project with Motion

Inputs: force, projectId.

motion.status.reportC

Generate status reports

Inputs: format, projectId, includeMetrics.

motion.sync.allC

Sync all bound projects

Inputs: force.

motion.sync.checkD

Check sync status

Inputs: projectId.

motion.task.analyzeD

Analyze task complexity

Inputs: taskId.

motion.task.batch_createC

Create multiple tasks from goals

Inputs: goal, context, maxTasks, projectId.

motion.task.completeC

Mark tasks as completed

Inputs: taskId.

motion.task.createD

Create a new task

Inputs: name, enrich, dueDate, duration, +3 more.

motion.task.enrichC

AI-enhance task descriptions

Inputs: taskId, context.

motion.task.listC

List and filter tasks

Inputs: limit, cursor, status, priority, +1 more.

motion.task.moveC

Move task to different project

Inputs: taskId, targetProjectId.

motion.task.searchC

Search tasks in local storage

Inputs: query, status, projectId.

motion.task.updateD

Update task properties

Inputs: name, status, taskId, dueDate, +3 more.

motion.workflow.planD

Generate comprehensive plans

Inputs: goal, context, projectId, constraints.

motion.workspace.get_settingsC

Get workspace settings

Inputs: workspaceId.

motion.workspace.listC

List all workspaces

Inputs: limit, cursor.

motion.workspace.set_defaultD

Set default workspace

Inputs: workspaceId.

motion.workspace.update_settingsD

Update workspace settings

Inputs: settings, workspaceId.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.3/5.0

    Scored across 25 tools

    Disambiguation4/5

    Most tools map cleanly to a resource+action combination, but a few boundaries blur: motion.task.list vs motion.task.search (all tasks vs local storage), and the three sync-related tools (motion.project.sync, motion.sync.all, motion.sync.check) could be confused. The AI-oriented trio (motion.task.enrich, motion.task.analyze, motion.workflow.plan) also has soft boundaries, though descriptions clarify intent.

    Naming Consistency5/5

    Every tool follows the motion.<domain>.<action> pattern, with global ops (motion.sync.all, motion.status.report) fitting the same convention. Action verbs are consistently snake_case and descriptive, so the pattern generalizes predictably across tasks, projects, docs, context, and workspaces.

    Tool Count3/5

    25 tools is on the heavy edge for what is essentially a task/project manager. The workspace, sync, and docs clusters each add a handful of low-frequency administrative operations, so the surface feels somewhat sprawling rather than tightly scoped.

    Completeness3/5

    Tasks have decent lifecycle support (create, batch_create, list, search, update, complete, move) but no delete or get-by-id. Projects lack update/archive/delete entirely, and docs have create/update but no list or delete. These are notable gaps that will force agents to work around missing lifecycle operations.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers