Skip to main content
Glama
mcp-copilotcli-history

mcp-copilotcli-history

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

When using uv no specific installation is needed:

uvx mcp-copilotcli-history

Using pip

pip install mcp-copilotcli-history

After installation, run as a module:

python -m mcp_copilotcli_history

Configuration

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 pattern

  • event_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 for

  • max_results (optional): Maximum results (default: 20)

search_tool_usage

Find sessions where specific tools were used.

Arguments:

  • tool_name (optional): Tool name to filter by

  • max_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-history

License

MIT

Available Tools

6 tools
get_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

    A4.1/5.0

    Scored across 6 tools

    Disambiguation5/5

    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.

    Naming Consistency5/5

    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.

    Tool Count5/5

    6 tools is an ideal size for a focused history server. It covers all core operations without being overwhelming or insufficient.

    Completeness4/5

    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

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables 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
    • F
      license
      A
      quality
      F
      maintenance
      Enables AI assistants to query local ChatLab chat history using natural language, with tools for session listing, message retrieval, and analytics.
      17
      14 npm
      -
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables 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.
      -
    • F
      license
      Not graded
      quality
      C
      maintenance
      Enables 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.
      -