mcp-copilotcli-history
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-copilotcli-history search my Copilot history for discussions about terraform"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-copilotcli-history
An MCP server that provides tools for searching through GitHub Copilot's conversation history stored in ~/.copilot/session-state/.
Features
Search Sessions: Full-text search across all Copilot conversations
List Recent Sessions: View recent sessions with titles extracted from first user message
Session Statistics: Get aggregate stats about your Copilot usage
View Conversations: Read the full conversation from any session
Search by File: Find sessions that referenced specific files
Search Tool Usage: Find examples of how tools were used
Related MCP server: chatlab-mcp
Installation
Using uvx (recommended)
When using uv no specific installation is needed:
uvx mcp-copilotcli-historyUsing pip
pip install mcp-copilotcli-historyAfter installation, run as a module:
python -m mcp_copilotcli_historyConfiguration
Configure for Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"copilot-history": {
"command": "uvx",
"args": ["mcp-copilotcli-history"]
}
}
}{
"mcpServers": {
"copilot-history": {
"command": "python",
"args": ["-m", "mcp_copilotcli_history"]
}
}
}Configure for VS Code
Add the configuration to your user-level MCP configuration file. Open the Command Palette (Ctrl + Shift + P) and run MCP: Open User Configuration.
{
"servers": {
"copilot-history": {
"command": "uvx",
"args": ["mcp-copilotcli-history"]
}
}
}{
"servers": {
"copilot-history": {
"command": "python",
"args": ["-m", "mcp_copilotcli_history"]
}
}
}Configure for Zed
Add to your Zed settings.json:
"context_servers": {
"copilot-history": {
"command": "uvx",
"args": ["mcp-copilotcli-history"]
}
}Available Tools
search_sessions
Search through all Copilot session history for a pattern.
Arguments:
query(required): Search term or regex patternevent_type(optional): Filter by event type (user.message, assistant.message, etc.)max_results(optional): Maximum results to return (default: 20)case_sensitive(optional): Case-sensitive matching (default: false)
list_recent_sessions
List the most recent Copilot sessions with their titles.
Arguments:
limit(optional): Maximum sessions to return (default: 10)
get_session_stats
Get statistics about all Copilot session history.
get_session_conversation
Get the conversation from a specific session.
Arguments:
session_id(required): Session ID (full or partial)include_tool_calls(optional): Include tool call details (default: false)max_messages(optional): Maximum messages to return (default: 50)
search_by_file_path
Find sessions that referenced a specific file or path pattern.
Arguments:
file_pattern(required): File path or pattern to search formax_results(optional): Maximum results (default: 20)
search_tool_usage
Find sessions where specific tools were used.
Arguments:
tool_name(optional): Tool name to filter bymax_results(optional): Maximum results (default: 20)
Example Use Cases
Once configured, you can ask your AI assistant questions like:
"Search my Copilot history for discussions about terraform"
"What sessions did I have this week?"
"Find conversations where I worked on main.py"
"How did I use the create_file tool before?"
"Show me the conversation from session abc123"
Debugging
Use the MCP inspector to debug:
npx @modelcontextprotocol/inspector uvx mcp-copilotcli-historyLicense
MIT
Available Tools
6 toolsget_session_conversationA
Get the conversation from a specific session.
Retrieves the user and assistant messages from a session in chronological order, allowing you to review a past conversation.
Args: session_id: The session ID (full or partial) to retrieve include_tool_calls: Whether to include tool call details (default: False) max_messages: Maximum number of messages to return (default: 50)
Returns: List of messages from the session in chronological order
Inputs: session_id (required), max_messages, include_tool_calls. Returns: result
get_session_statsB
Get statistics about all Copilot session history.
Returns aggregate information about stored sessions including total count, size, date range, event types, and models used.
Returns: Dictionary with session statistics
Inputs: no named parameters.
list_recent_sessionsA
List the most recent Copilot sessions with their titles.
Use this to get an overview of recent conversations and find sessions to explore further.
Args: limit: Maximum number of sessions to return (default: 10)
Returns: List of recent sessions with metadata (id, title, date, model, size)
Inputs: limit. Returns: result
search_by_file_pathA
Find sessions that referenced a specific file or path pattern.
Searches through session history for mentions of file paths, useful for finding past work on specific files or directories.
Args: file_pattern: File path or pattern to search for (e.g., "main.py", "src/") max_results: Maximum number of results to return (default: 20)
Returns: List of sessions and entries that referenced the file pattern
Inputs: file_pattern (required), max_results. Returns: result
search_sessionsA
Search through all Copilot session history for a pattern.
This tool searches across all stored Copilot conversations to find messages, tool calls, and other events matching your query. Use this to find past discussions, code snippets, or decisions.
Args: query: The search term or regex pattern to find event_type: Optional filter for event type (user.message, assistant.message, tool.result) max_results: Maximum number of results to return (default: 20) case_sensitive: Whether to perform case-sensitive matching (default: False)
Returns: List of matching entries with session context and content snippets
Inputs: query (required), event_type, max_results, case_sensitive. Returns: result
search_tool_usageA
Find sessions where specific tools were used.
Search for tool invocations in past sessions, optionally filtered by tool name. Useful for finding examples of how tools were used.
Args: tool_name: Optional tool name to filter by (e.g., "create_file", "run_in_terminal") max_results: Maximum number of results to return (default: 20)
Returns: List of tool usage instances with context
Inputs: tool_name, max_results. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool targets a distinct aspect of session history: retrieval, statistics, listing, and various search types (by file path, full-text, tool usage). There is no overlap in functionality.
All tools use snake_case with a consistent verb_noun pattern (e.g., get_session_conversation, search_by_file_path). The naming is predictable and intuitive.
6 tools is an ideal size for a focused history server. It covers all core operations without being overwhelming or insufficient.
The tool set covers browsing, listing, and searching sessions comprehensively. Minor gaps exist: there is no tool to delete or export session history, which might be expected for a history management utility.
Maintenance
Related MCP Connectors
Search your AI chat history (ChatGPT, Claude, Codex) from any MCP client. Remote, private, read-only
Code intelligence for LLMs. Analyze, search, and retrieve code from any public git repository.
Ingest and search LogsLoom logs from coding agents.
Securely search and manage workspace context files for AI agents and teams.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables querying, searching, and analyzing Cursor IDE conversation history from SQLite workspaceStorage databases. Supports exporting chat data in multiple formats and provides workspace utilities for managing conversation data across projects.MIT
- FlicenseAqualityFmaintenanceEnables AI assistants to query local ChatLab chat history using natural language, with tools for session listing, message retrieval, and analytics.1714 npm-
- AlicenseNot gradedqualityCmaintenanceEnables searching, indexing, and recovering past AI chat sessions and agent actions from local AI coding tools, with optional vector database semantic search and direct filesystem access.-
- FlicenseNot gradedqualityCmaintenanceEnables read-only access to Kilo Code and Opencode conversation history stored in a local SQLite database, allowing users to list projects and sessions, read messages, and perform full-text keyword searches across all messages.-