feat: add MCP Server and REST API for chat analysis#1
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
packages/mcp-server/) that exposes ChatLab's chat analysis capabilities via MCP protocol and REST APIlist_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/api/v1/for programmatic access without MCPTest plan
cd packages/mcp-server && npm install && npm run buildsucceedsnode dist/index.js --db-dir <path>starts stdio MCP servernode dist/index.js --http --port 3000 --db-dir <path>starts HTTP server/api/v1/sessions, etc.) return valid JSONexecute_sqlrejects non-SELECT statementshttps://claude.ai/code/session_01U2bFTH9Gme7yYN8q4gE6YB