Skip to main content
Glama
Abhishekrajpurohit

Motion.dev MCP Server

Motion.dev MCP Server

A production-ready Model Context Protocol (MCP) server providing comprehensive Motion.dev animation library access for React, JavaScript, and Vue. Features offline documentation, intelligent code generation, and multi-framework support.

πŸš€ Quick Start

Prerequisites

  • Node.js 18+ - Required runtime

  • MCP-compatible client - Any AI client supporting Model Context Protocol

Installation & Setup

# Clone the repository
git clone https://github.com/your-username/motion-dev-mcp.git
cd motion-dev-mcp

# Install dependencies
npm install

# Build TypeScript
npm run build

# Initialize documentation database (first time only)
npm run rebuild

MCP Client Integration

Configure in your MCP client settings:

{
  "mcpServers": {
    "motion-dev": {
      "command": "node",
      "args": ["./dist/index.js"],
      "cwd": "$HOME/motion-dev-mcp"
    }
  }
}

Or using Claude Code CLI:

claude mcp add node $HOME/motion-dev-mcp/dist/index.js

Related MCP server: animotion-mcp

✨ Features

πŸ“š Offline Documentation System

  • 351 Code Examples across React (119), JavaScript (124), and Vue (108)

  • 26 Documentation Pages with complete Motion.dev coverage

  • 63 Component Definitions with enhanced API references

  • FTS5 Full-Text Search with LIKE fallback for special characters

πŸ› οΈ MCP Tools Available

Documentation Access

  • get_motion_docs - Fetch specific Motion.dev documentation

  • search_motion_docs - Full-text search across all docs

  • get_component_api - Component API with examples (e.g., motion.div)

  • get_examples_by_category - Filtered code examples

  • get_framework_guide - Framework-specific guides

Code Generation

  • generate_motion_component - Multi-animation support (scale + rotate)

  • create_animation_sequence - Complex animation timelines

  • convert_between_frameworks - React ↔ JS ↔ Vue conversion

  • validate_motion_syntax - Comprehensive validation against Motion.dev API

  • optimize_motion_code - Performance and accessibility suggestions

🎯 Production Capabilities

Advanced Search System

  • FTS5 + LIKE Hybrid: Handles motion.div and special characters gracefully

  • Framework Filtering: Search within specific framework documentation

  • <50ms Response Times: Optimized SQLite queries with comprehensive indexing

Multi-Framework Code Generation

  • Pattern Combination: Intelligently merges multiple animations (scale + rotate)

  • Cross-Framework: Converts animations between React, JavaScript, and Vue

  • Production Ready: Clean, optimized code with proper TypeScript support

Comprehensive Validation

  • Motion.dev API Validation: Validates against actual property specifications

  • Performance Warnings: Flags layout-triggering animations

  • Accessibility Recommendations: Suggests prefers-reduced-motion support

  • Best Practice Guidance: Framework-specific import and usage validation

πŸ“– Usage Examples

Search Documentation

// Find spring animation docs
search_motion_docs({
  "query": "spring animations",
  "framework": "react",
  "limit": 10
})

Get Component API

// Get motion.div with examples
get_component_api({
  "component": "motion.div",
  "framework": "react"
})
// Returns: 10+ relevant examples with descriptions

Generate Multi-Animation Components

// Combine multiple animation patterns
generate_motion_component({
  "animations": ["scale", "rotate"],
  "framework": "react",
  "componentName": "AnimatedBox"
})
// Returns: Component with combined scale + rotate animations

Cross-Framework Conversion

// Convert React to Vue
convert_between_frameworks({
  "from": "react",
  "to": "vue",
  "code": "<motion.div animate={{ x: 100, rotate: 90 }} />"
})

Comprehensive Validation

// Validate Motion.dev syntax
validate_motion_syntax({
  "code": "<motion.div animate={{ invalidProp: 'bad' }} />",
  "framework": "react"
})
// Returns: Specific errors for invalid properties with suggestions

πŸ”§ Maintenance Commands

Database Management

# Rebuild all documentation (updates examples and components)
npm run rebuild

# Check current database statistics
npm run stats

# Custom database path
MOTION_DB_PATH=./custom/docs.db npm run rebuild

Development

# Build TypeScript
npm run build

# Test MCP server startup
node dist/index.js

# Debug database content
sqlite3 docs/motion-docs.db "SELECT COUNT(*) FROM motion_examples;"

πŸ“Š Current Database Statistics

  • Documentation: 26 pages (React: 7, JavaScript: 13, Vue: 6)

  • Components: 63 enhanced definitions with descriptions

  • Examples: 351 working code examples across all frameworks

  • Database Size: ~15MB with full content and search indexes

  • FTS5 Support: βœ… Enabled with automatic LIKE fallback

πŸ—οΈ Architecture

SQLite-First Design

  • Offline Operation: Complete functionality without internet after setup

  • FTS5 Search: Fast semantic search with graceful LIKE fallback

  • Structured Storage: Optimized schema for docs, components, and examples

  • Better-sqlite3: High-performance SQLite with sql.js fallback

MCP Protocol Compliance

  • 10+ Tools: Complete Motion.dev functionality coverage

  • TypeScript: Full type safety and comprehensive error handling

  • Streaming Support: Efficient handling of large documentation responses

  • Session Management: Proper client session handling

🎯 Integration Benefits

Perfect for AI-powered development workflows:

  • Design-to-Code: Generate animations from design specifications

  • Natural Language: Compose animated components from descriptions

  • Full-Stack Development: Complete application animation implementation

  • Cross-Platform: Touch gestures and responsive animations

πŸ“ˆ Performance Metrics

  • Search Response: <50ms for SQLite queries

  • Code Generation: <200ms for complex multi-animation components

  • Database Rebuild: 100% success rate with progress tracking

  • Error Rate: <1% failed requests under normal usage

  • Framework Parity: Full React/JS/Vue support with intelligent merging

πŸ”„ Status: Production Functional (8/10)

βœ… Successfully Completed:

  • Comprehensive offline documentation system with 351 examples

  • Multi-framework code generation with pattern combination

  • Advanced search with FTS5 + LIKE hybrid approach

  • Production-ready validation against Motion.dev API specifications

  • Full MCP protocol compliance with comprehensive tool coverage

🎯 Achievement: Transformed from 1/10 (Not Production Ready) to 8/10 (Production Functional) with all critical functionality restored and enhanced.


Transform your animations with AI-powered Motion.dev integration through any MCP-compatible client.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    B
    quality
    C
    maintenance
    Enables AI models to generate production-ready, 60fps-optimized GSAP animation code from natural language requests. It provides expert-level tools for creating complex sequences, debugging performance issues, and setting up GSAP within modern web frameworks.
    6
    475
    4
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    745+ CSS3 animations and 9,000+ real SVG icons (Lucide, Heroicons, Tabler, Bootstrap) for AI coding agents. Zero-clone setup via npx animotion-mcp. 10 MCP tools including search_animations, get_icon, suggest_animation, compose_animation, and more.
    12
    MIT