npm package: @nish_ntr/chat-memory-mcp
Description: MCP server to search and retrieve VS Code Copilot Chat history with AI-powered summarization. Access your cross-workspace conversation history from any AI agent.
Author: nishntr
Latest version: 1.0.2

# Chat Memory MCP - Search & Summarize Your VS Code Chat History

[![npm version](https://img.shields.io/npm/v/@nish_ntr/chat-memory-mcp.svg)](https://www.npmjs.com/package/@nish_ntr/chat-memory-mcp)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Model Context Protocol](https://img.shields.io/badge/MCP-Protocol-blue.svg)](https://modelcontextprotocol.io)

An MCP (Model Context Protocol) server that enables AI agents in VS Code to search and retrieve content from past Copilot Chat sessions across all your workspaces. Enhance your AI coding agent (like Cline, Roo Code, or Claude) with persistent memory.

## Table of Contents
- [Features](#features)
- [Installation](#installation)
- [Tools Provided](#tools-provided)
- [Important Tips](#important-tips)
- [Data Privacy](#data-privacy)
- [License](#license)

## Features

- **✅ Continuous Memory**: Search through every conversation you've ever had with Copilot.
- **✅ Instant Summaries**: Get 5-8 sentence summaries of complex past discussions without polluting your context window.
- **✅ Cross-Workspace Access**: Access solutions and snippets from any project, instantly.
- **✅ Local & Secure**: Your data stays on your machine and is only summarized by your chosen LLM.

## Why use Chat Memory?

### ❌ Without Chat Memory

- **❌ Lost Context**: You lose valuable insights when switching between projects/workspaces.
- **❌ Repetitive Work**: You waste time re-asking Copilot the same questions you resolved yesterday.
- **❌ Isolated Knowledge**: Finding a specific code snippet or architectural decision from a past chat requires manually opening old workspaces.

### ✅ With Chat Memory

Chat Memory MCP connects your AI agent to your entire history of conversations. It retrieves up-to-date context from your past sessions and provides AI-generated summaries—placing them directly into your current prompt.


## Tools Provided

### 1. `search_vs_code_chats`

Search through past VS Code Copilot Chat sessions.

**Input:**
- `query` (string): Search query to find in chat titles and messages

**Output:**
- Array of matching sessions with metadata (sessionId, title, workspaceName, lastModified)

### 2. `get_vs_code_chat_content`

Retrieve an AI-generated summary of a specific chat session.

**Input:**
- `sessionId` (string): Absolute file path to the chat session JSON file (obtained from search results)

**Output:**
- AI-generated concise summary of the conversation (3-5 sentences)
- Chat title and message count
- Note: The full transcript is sent to the LLM for summarization but is NOT included in the response, keeping the prompt chain clean

## Installation

### Standard Installation

[![VS Code NPM](https://img.shields.io/badge/VS%20Code-NPM-007ACC?logo=visualstudiocode&logoColor=white)](https://insiders.vscode.dev/redirect?url=vscode%3Amcp%2Finstall%3F%7B%22name%22%3A%22chat-memory-mcp%22%2C%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22%40nish_ntr%2Fchat-memory-mcp%40latest%22%5D%7D)

For other clients (Claude Code, Roo Code, etc.), use the following command:

```json
{
  "mcpServers": {
    "chat-memory": {
      "command": "npx",
      "args": ["-y", "@nish_ntr/chat-memory-mcp@latest"]
    }
  }
}
```

## Important Tips

### Accessing History
Simply ask your agent:
> "Search my past chats for how I implemented JWT authentication in the other project."

### Clean Context
When you ask for content, the server uses **MCP Sampling** to summarize the conversation first. This means the agent gets a concise summary rather than the full transcript, keeping your token usage low and your focus sharp.

## Data Privacy

The server reads directly from your VS Code workspace storage locally.
- **Local Data**: Your data never leaves your machine except when sent to your chosen LLM for summarization.
- **Selective Context**: Only human-readable summaries are returned to the AI agent, keeping your full chats private from the immediate prompt history unless explicitly summarized.

The server automatically detects your OS and searches in:
- **macOS**: `~/Library/Application Support/Code/User/workspaceStorage/`
- **Windows**: `%APPDATA%\Code\User\workspaceStorage\`
- **Linux**: `~/.config/Code/User/workspaceStorage/`

## Contributing

Contributions are welcome! If you have suggestions for improvements or bug fixes, please open an issue or a pull request.

1. Fork the repository
2. Create your feature branch (`git checkout -b feature/AmazingFeature`)
3. Commit your changes (`git commit -m 'Add some AmazingFeature'`)
4. Push to the branch (`git push origin feature/AmazingFeature`)
5. Open a Pull Request

## License

MIT