Skip to content

Conversation

@sanggggg
Copy link
Collaborator

Summary

Add retrochat-mcp crate that exposes chat session query and analytics capabilities via Model Context Protocol (MCP). This enables AI assistants like Claude and Cursor to query and analyze chat history.

Features

  • Read-only MCP server with stdio transport
  • 4 MCP tools:
    • list_sessions - Query and filter chat sessions with pagination
    • get_session_detail - Get full session details with all messages
    • search_messages - Full-text search across all messages
    • get_session_analytics - Get analytics for a session
  • Comprehensive error handling and validation (UUID, dates)
  • Pretty-printed JSON responses for easy AI consumption
  • Unit tests for all components (9 tests passing)
  • Documentation in CLAUDE.md with configuration examples

Technical Details

  • Uses rmcp 0.11 with server, macros, and transport-io features
  • Shares database with CLI/TUI (read-only access)
  • Logs to stderr to avoid interfering with stdio transport
  • Supports RUST_LOG environment variable for log level control

Usage

# Run MCP server
cargo mcp

# Run tests
cargo tmcp

# With debug logging
RUST_LOG=debug cargo mcp

Configuration

Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "retrochat": {
      "command": "/path/to/retrochat-mcp",
      "args": []
    }
  }
}

Cursor (.cursor/mcp.json):

{
  "mcpServers": {
    "retrochat": {
      "command": "cargo",
      "args": ["run", "-p", "retrochat-mcp"],
      "cwd": "/path/to/retrochat"
    }
  }
}

Testing

  • All unit tests passing (9/9)
  • Clippy clean with -D warnings
  • Release build successful
  • Formatted with cargo fmt

Files Changed

  • Added crates/retrochat-mcp/ crate (5 files, 813 lines)
  • Updated workspace Cargo.toml with new member and dependencies
  • Updated .cargo/config.toml with mcp and tmcp aliases
  • Updated CLAUDE.md with comprehensive MCP server documentation

Add retrochat-mcp crate that exposes chat session query and analytics
capabilities via Model Context Protocol (MCP). This enables AI assistants
like Claude and Cursor to query and analyze chat history.

Features:
- Read-only MCP server with stdio transport
- 4 tools: list_sessions, get_session_detail, search_messages, get_session_analytics
- Comprehensive error handling and validation (UUID, dates)
- Pretty-printed JSON responses for AI consumption
- Unit tests for all components (9 tests)
- Documentation in CLAUDE.md with configuration examples

Technical details:
- Uses rmcp 0.11 with server, macros, and transport-io features
- Shares database with CLI/TUI (read-only access)
- Logs to stderr to avoid interfering with stdio transport
- Supports RUST_LOG for log level control

Usage:
  cargo mcp  # Run MCP server
  cargo tmcp # Run tests
@sanggggg sanggggg merged commit f7d85da into main Dec 17, 2025
5 checks passed
@sanggggg sanggggg deleted the feat/add-mcp-server branch December 17, 2025 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants