# Remix MCP Server - Example Usage

This document provides practical examples of using the Remix MCP server to manage conversation context between AI chat sessions.

## Scenario: Documentation Project Conversations

Let's say you're working on a documentation project and want to keep track of related conversations.

### Step 1: Create a Root Conversation

Start with a main conversation about the documentation project:

```json
{
  "tool": "remix_conversation",
  "arguments": {
    "new_conversation_id": "docs-main",
    "title": "Documentation Project Planning",
    "task_description": "Planning the structure and approach for project documentation",
    "messages": [
      {
        "author": "User",
        "payload": "I need to create comprehensive documentation for our API"
      },
      {
        "author": "Copilot",
        "payload": "I recommend organizing the documentation into sections: Getting Started, API Reference, Authentication, and Examples. Let's start with the structure."
      },
      {
        "author": "User",
        "payload": "That sounds good. What should be in the Getting Started section?"
      },
      {
        "author": "Copilot",
        "payload": "The Getting Started section should include: Installation instructions, basic setup, and a simple 'Hello World' example."
      }
    ]
  }
}
```

### Step 2: Branch to Specific Topics

Create a child conversation focused on authentication:

```json
{
  "tool": "remix_conversation",
  "arguments": {
    "old_conversation_id": "docs-main",
    "new_conversation_id": "docs-auth",
    "title": "Authentication Documentation",
    "task_description": "Detailed discussion about documenting authentication methods",
    "messages": [
      {
        "author": "User",
        "payload": "Let's focus on the authentication documentation. We support OAuth2 and API keys."
      },
      {
        "author": "Copilot",
        "payload": "Great! For each authentication method, we should document: 1) How to obtain credentials, 2) How to make authenticated requests, 3) Common errors and troubleshooting"
      }
    ]
  }
}
```

Create another branch for API reference:

```json
{
  "tool": "remix_conversation",
  "arguments": {
    "old_conversation_id": "docs-main",
    "new_conversation_id": "docs-api-ref",
    "title": "API Reference Structure",
    "task_description": "Planning the API reference documentation",
    "messages": [
      {
        "author": "User",
        "payload": "How should we structure the API reference?"
      },
      {
        "author": "Copilot",
        "payload": "I suggest grouping endpoints by resource type, with each endpoint showing: method, path, parameters, request/response examples, and error codes."
      }
    ]
  }
}
```

### Step 3: Continue a Previous Conversation

Later, retrieve a conversation to continue it in a new chat session:

```json
{
  "tool": "continue_conversation",
  "arguments": {
    "conversation_id": "docs-auth"
  }
}
```

This returns all messages from that conversation, allowing you to provide context to a new AI chat.

### Step 4: View the Conversation Tree

See how all your conversations are related:

```json
{
  "tool": "read_conversation_tree",
  "arguments": {}
}
```

Response:
```json
{
  "tree": [
    {
      "id": "docs-main",
      "title": "Documentation Project Planning",
      "task_description": "Planning the structure and approach for project documentation",
      "children": [
        {
          "id": "docs-auth",
          "title": "Authentication Documentation",
          "task_description": "Detailed discussion about documenting authentication methods",
          "children": []
        },
        {
          "id": "docs-api-ref",
          "title": "API Reference Structure",
          "task_description": "Planning the API reference documentation",
          "children": []
        }
      ]
    }
  ]
}
```

### Step 5: Search Across Conversations

Search for OAuth mentions in all child conversations:

```json
{
  "tool": "search_children",
  "arguments": {
    "keywords": ["OAuth", "OAuth2"],
    "parent_conversation_id": "docs-main"
  }
}
```

Search for context from parent conversations:

```json
{
  "tool": "search_parents",
  "arguments": {
    "keywords": ["authentication", "API"],
    "child_conversation_id": "docs-auth"
  }
}
```

## Use Cases

### 1. Multi-Session Projects
When working on a long project, save conversation context at the end of each session and continue in the next session without losing context.

### 2. Branching Discussions
Start with a general discussion and branch into specific topics, maintaining the relationship between conversations.

### 3. Knowledge Base
Build a searchable knowledge base of your AI conversations, organized by topic and relationship.

### 4. Context Switching
Quickly switch between different aspects of a project while maintaining the ability to search across all related conversations.

### 5. Team Collaboration
Share conversation IDs with team members so they can continue or branch from your discussions.

## Tips

1. **Use Descriptive IDs**: Use meaningful conversation IDs like `project-auth-v2` instead of random UUIDs for easier reference.

2. **Write Clear Titles**: Make titles and task descriptions clear and searchable.

3. **Branch Strategically**: Create new branches when switching to a distinct subtopic.

4. **Search Effectively**: Use specific keywords that capture the essence of what you're looking for.

5. **Regular Backups**: The database is stored in `~/.remix-mcp/conversations.db` - back it up regularly.

## Integration with Different MCP Clients

### Claude Desktop

The server is configured to work with Claude Desktop. Add the following to your Claude config:

```json
{
  "mcpServers": {
    "remix": {
      "command": "node",
      "args": ["/path/to/remix-mcp/build/index.js"]
    }
  }
}
```

After restarting Claude Desktop, you'll see the remix tools available in the tool list.

### Other MCP Clients

The server follows the standard MCP protocol and should work with any compatible MCP client.

### Quick prompt

Use this prompt to save the current chat into a new conversation:

> remix this conversation, Save all the messages in this chat that you remember. New id: `<new-id>`, task_description: `<description>`, title: `<title>`
