Cedar MCP Server

The Cedar Model Context Protocol (MCP) server enables seamless integration between Cedar-OS and AI development environments like Cursor, providing intelligent assistance for building AI-native frontends.

Quick Start

1. Install in Cursor

Open your Cursor settings file (~/.cursor/settings.json) and add:
{
  "mcpServers": {
    "cedar": {
      "command": "npx",
      "args": ["@cedar/mcp-server"],
      "env": {}
    }
  }
}

2. Restart Cursor

Close and reopen Cursor to activate the MCP server.

3. Verify Installation

In any file, type a comment and use Cursor’s AI assistant:
// Help me create a Cedar chat component
The MCP server should provide Cedar-specific guidance.

4. Start Using Cedar

Ask the MCP server natural language questions:
"Create a basic Cedar chat interface with streaming support"
"Add voice input to my Cedar chat"
"Implement a radial menu spell"

Key Features

  • Intelligent Code Assistance: Context-aware suggestions for Cedar components and patterns
  • Documentation Search: Instant access to relevant Cedar documentation
  • Component Discovery: Find and implement the right Cedar components
  • Voice Integration Support: Specialized assistance for voice features
  • Spells Implementation: Expert guidance on Cedar spells
  • Mastra Backend Integration: Seamless agent backend connections

Common Usage Patterns

Component Implementation

"Help me implement a floating chat component with Cedar"
"Add voice capabilities to my Cedar chat interface"
"Create a custom spell for text selection"
"Build a mention system with Cedar"

Documentation Queries

"Show me Cedar chat component documentation"
"How do I configure streaming in Cedar?"
"What are Cedar spells and how do they work?"
"Explain Cedar's state management approach"

Integration Tasks

"Connect my Cedar frontend to a Mastra agent"
"Set up voice streaming with WebSockets"
"Implement state management with Cedar store"
"Configure message persistence"

Advanced Features

Contextual Awareness

The MCP server understands:
  • Your project structure and existing Cedar components
  • Current file context and imports
  • Project dependencies and configuration
  • Cedar best practices and patterns

Specialized Modules

  • Voice Expert: Audio streaming, permissions, WebSocket configuration
  • Spells Expert: Spell creation, activation patterns, gesture handling
  • Mastra Expert: Agent connections, workflow setup, backend integration
  • Chat Expert: Message handling, streaming, custom rendering

Common Workflows

Setting Up a New Project

  1. Initialize Cedar: "Set up a new Cedar project with TypeScript"
  2. Add chat: "Add Cedar chat components to my app"
  3. Configure backend: "Connect to my Mastra agent backend"
  4. Add voice: "Implement voice capabilities"

Building Features

  1. Start simple: "Create a basic chat interface"
  2. Add interactivity: "Add mention support to chat"
  3. Enhance UX: "Implement message streaming"
  4. Add AI features: "Create a questioning spell"

Debugging Issues

  • "Debug WebSocket connection problems"
  • "Fix streaming message display"
  • "Resolve spell activation conflicts"
  • "Troubleshoot voice permissions"

Best Practices

  1. Ask Before Building: Query capabilities before implementing
  2. Use Examples: Request code examples for complex features
  3. Incremental Development: Build features step by step
  4. Leverage Search: Use semantic search for documentation
  5. Validate Code: Ask for best practice reviews

Tips and Tricks

  • Auto-imports: MCP knows Cedar import paths
  • Pattern Matching: Ask for common Cedar patterns
  • Code Review: Request validation of implementations
  • Component Discovery: Ask “What Cedar components help with [task]?”
  • Quick Fixes: Get immediate solutions for errors

Troubleshooting

MCP Server Not Responding

  • Verify configuration in Cursor settings
  • Check Node.js is accessible
  • Restart Cursor after changes

Incorrect Suggestions

  • Provide more project context
  • Specify Cedar version
  • Include relevant code snippets

Performance Issues

  • Clear Cursor cache
  • Check internet connection
  • Update MCP server version

Prerequisites

  • Cursor IDE (latest version)
  • Node.js 18+ installed
  • Basic TypeScript/React knowledge
  • Cedar-OS project or willingness to create one

Support