MCP Claude Context Continuity MCP Server

Local setup required. This server has to be cloned and prepared on your machine before you register it in Claude Code.
1

Set the server up locally

Run this once to clone and prepare the server before adding it to Claude Code.

Run in terminal
npm install -g mcp-claude-context-continuity
2

Register it in Claude Code

After the local setup is done, run this command to point Claude Code at the built server.

Run in terminal
claude mcp add claude-context-continuity -- node "<FULL_PATH_TO_MCP_CLAUDE_CONTEXT_CONTINUITY>/dist/index.js"

Replace <FULL_PATH_TO_MCP_CLAUDE_CONTEXT_CONTINUITY>/dist/index.js with the actual folder you prepared in step 1.

README.md

Maintains conversation context for Claude CLI across multiple invocations.

MCP Claude Context Continuity

An MCP (Model Context Protocol) server that maintains conversation context for Claude CLI across multiple invocations.

Features

  • 🔄 Conversation Continuity: Leverages Claude CLI's --resume feature to maintain conversation context across multiple calls
  • 📝 Session Management: Save, restore, and branch conversations
  • 🖥️ Cross-platform: Supports Windows (via WSL), Linux, and macOS
  • Simple Implementation: All functionality in a single Python file

Requirements

  • Python 3.8+
  • Claude CLI (must be installed in WSL for all platforms)
  • FastMCP (pip install fastmcp)
  • WSL2 for Windows environments
  • Windows: Python must be installed on Windows (not in WSL)

Installation

Option 1: Using npm (Recommended)

npm install -g mcp-claude-context-continuity

After installation, the server will be available as a global command.

Option 2: Manual Installation

  1. Clone the repository:
git clone https://github.com/tethiro/mcp-claude-context-continuity.git
cd mcp-claude-context-continuity
  1. Install dependencies:
pip install -r requirements.txt

Configuration

Gemini CLI (Recommended)

Add the following to your Gemini configuration file:

Using npm global install (Simplest)

All platforms (~/.gemini/settings.json or %USERPROFILE%\.gemini\settings.json):

{
  "mcpServers": {
    "claude-cli-server": {
      "command": "mcp-claude-context-continuity"
    }
  }
}
Manual installation

Windows (%USERPROFILE%\.gemini\settings.json):

{
  "mcpServers": {
    "claude-cli-server": {
      "command": "wsl",
      "args": [
        "-e",
        "python3",
        "/mnt/c/path/to/mcp-claude-context-continuity/src/claude_cli_server.py"
      ]
    }
  }
}

WSL/Linux/macOS (~/.gemini/settings.json):

{
  "mcpServers": {
    "claude-cli-server": {
      "command": "python3",
      "args": [
        "/path/to/mcp-claude-context-continuity/src/claude_cli_server.py"
      ]
    }
  }
}

Claude Desktop

Add similar configuration to your Claude Desktop settings file.

Usage

Basic Usage

  1. Simple conversation:
execute_claude(prompt="Hello, I'm John")
  1. Continue conversation:
execute_claude(prompt="Do you remember my name?")
→ "Yes, you're John"

Session Management

  1. Save current session:
session_id = get_current_session()
  1. Start new session:
reset_session()
  1. Restore saved session:
set_current_session(session_id="saved_id")

Available Tools

Tool Description
execute_claude Execute Claude CLI with conversation continuity
execute_claude_with_context Execute with file context
get_execution_history Get execution history
get_current_session Get current session ID
set_current_session Set session ID
reset_session Reset session
clear_execution_history Clear history
test_claude_cli Test functionality

How Session Management Works

Using Claude CLI's --resume feature, you can return to any point in a conversation using session IDs:

Conversation 1: "I'm Alice" → session_id: AAA
Conversation 2: "I like reading" (--resume AAA) → session_id: BBB
Conversation 3: "My favorite book is..." (--resume BBB) → session_id: CCC

Later:
set_current_session("AAA") → State where only "Alice" is known
set_current_session("BBB") → State where "Alice" and "reading" are known

Troubleshooting

Claude CLI Not Found

Set the CLAUDE_PATH environment variable:

export CLAUDE_PATH=/path/to/claude

Windows Environment Notes

  • WSL2 is required
  • Install Claude CLI inside WSL
  • Use WSL format paths (/mnt/c/...)

License

MIT License


MCP Claude Context Continuity

Claude CLIの会話コンテキストを保持するMCP(Model Context Protocol)サーバーです。

特徴

  • 🔄 会話の継続性: Claude CLIの--resume機能を活用し、複数の呼び出し間で会話コンテキストを保持
  • 📝 セッション管理: 会話の保存、復元、分岐が可能
  • 🖥️ クロスプラットフォーム: Windows(WSL経由)、Linux、macOS対応
  • シンプルな実装: 単一のPythonファイルで全機能を提供

必要条件

  • Python 3.8以上
  • Claude CLI(WSL内にインストール必須)
  • FastMCP(pip install fastmcp
  • Windows環境の場合はWSL2
  • Windows: PythonはWindows側にインストール(WSL内ではなく)

インストール

方法1: npmを使用(推奨)

npm install -g mcp-claude-context-continuity

インストール後、グローバルコマンドとして利用可能になります。

方法2: 手動インストール

  1. リポジトリをクローン:
git clone https://github.com/tethiro/mcp-claude-context-continuity.git
cd mcp-claude-context-continuity
  1. 依存関係をインストール:
pip install -r requirements.txt

設定

Gemini CLI(推奨)

Geminiの設定ファイルに以下を追加:

npmグローバルインストールを使用(最も簡単)

全環境共通 (~/.gemini/settings.json または `%USERPROFILE%.gemi

Tools (8)

execute_claudeExecute Claude CLI with conversation continuity
execute_claude_with_contextExecute with file context
get_execution_historyGet execution history
get_current_sessionGet current session ID
set_current_sessionSet session ID
reset_sessionReset session
clear_execution_historyClear history
test_claude_cliTest functionality

Environment Variables

CLAUDE_PATHPath to the Claude CLI executable

Configuration

claude_desktop_config.json
{"mcpServers": {"claude-cli-server": {"command": "mcp-claude-context-continuity"}}}

Try it

Execute a new conversation with Claude asking for a summary of my project.
What is my current session ID?
Switch to my previous session ID to continue our discussion about the code refactor.
Reset the current session to start a fresh conversation.
Execute a prompt with additional context from my local file.

Frequently Asked Questions

What are the key features of MCP Claude Context Continuity?

Maintains conversation context across multiple CLI calls using the --resume feature. Supports saving, restoring, and branching of AI conversation sessions. Cross-platform compatibility for Windows (via WSL), Linux, and macOS. Simple implementation using a single Python file.

What can I use MCP Claude Context Continuity for?

Resuming long-running AI coding sessions without losing previous context. Branching conversations to explore different architectural solutions for the same problem. Managing multiple distinct AI project threads within the same CLI environment. Automating Claude CLI interactions while maintaining state across script executions.

How do I install MCP Claude Context Continuity?

Install MCP Claude Context Continuity by running: npm install -g mcp-claude-context-continuity

What MCP clients work with MCP Claude Context Continuity?

MCP Claude Context Continuity works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep MCP Claude Context Continuity docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare