Skip to content

feat: add MCP Server and REST API for chat analysis#1

Merged
gamesme merged 2 commits intomainfrom
claude/api-mcp-server-XXS3m
Mar 24, 2026
Merged

feat: add MCP Server and REST API for chat analysis#1
gamesme merged 2 commits intomainfrom
claude/api-mcp-server-XXS3m

Conversation

@gamesme
Copy link
Owner

@gamesme gamesme commented Mar 24, 2026

Summary

  • Add standalone MCP Server (packages/mcp-server/) that exposes ChatLab's chat analysis capabilities via MCP protocol and REST API
  • Support stdio transport (for Claude Code, Cursor, etc.) and SSE/HTTP transport (for remote access)
  • Implement 11 MCP tools: list_sessions, search_messages, get_recent_messages, get_members, get_member_stats, get_member_name_history, get_time_stats, get_conversation_between, get_message_context, execute_sql, get_schema
  • Add REST API endpoints under /api/v1/ for programmatic access without MCP
  • Runs independently without the Electron app, using read-only SQLite access with connection caching

Test plan

  • cd packages/mcp-server && npm install && npm run build succeeds
  • node dist/index.js --db-dir <path> starts stdio MCP server
  • node dist/index.js --http --port 3000 --db-dir <path> starts HTTP server
  • MCP tools return correct results when tested via MCP Inspector
  • REST API endpoints (/api/v1/sessions, etc.) return valid JSON
  • execute_sql rejects non-SELECT statements

https://claude.ai/code/session_01U2bFTH9Gme7yYN8q4gE6YB

claude added 2 commits March 24, 2026 09:41
Expose ChatLab's chat analysis capabilities as an independent MCP Server
(packages/mcp-server/) that runs standalone without the Electron app.

Features:
- MCP protocol support via stdio and SSE transports
- REST API endpoints for programmatic access
- 11 MCP tools: list_sessions, search_messages, get_recent_messages,
  get_members, get_member_stats, get_member_name_history, get_time_stats,
  get_conversation_between, get_message_context, execute_sql, get_schema
- Read-only SQLite access with connection caching
- Cross-platform default database directory detection

https://claude.ai/code/session_01U2bFTH9Gme7yYN8q4gE6YB
@gamesme gamesme merged commit 3131941 into main Mar 24, 2026
@gamesme gamesme deleted the claude/api-mcp-server-XXS3m branch March 24, 2026 11:32
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