AI 会话 MCP 服务器 logo

AI 会话 MCP 服务器

Community
yoavf

MCP server for searching and accessing your AI coding sessions from Claude Code, Gemini CLI, opencode, and OpenAI Codex. Also an uploader for aisessions.dev

Publisheryoavf
Repositoryai-sessions-mcp
LanguageGo
Forks
3
Stars
30
Available tools
0
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    AI 会话 MCP 服务器 exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    30 stars and 3 forks from the linked repository.

AI Sessions MCP Server

An MCP server that makes sessions from Claude Code, OpenAI Codex, Gemini CLI, opencode, Mistral Vibe, and GitHub Copilot CLI available to any MCP-compatible client.

Mostly written using Claude Code.

What It Does

Allows AI agents to search, list, and read your previous local coding sessions from multiple CLI coding agents. Useful for:

  • Finding past solutions to similar problems
  • Reviewing what you worked on recently
  • Learning from previous conversations
  • Resuming interrupted work

Demo

Installation

Quick Install

macOS (Intel and Apple Silicon), Linux (amd64 and arm64, including WSL), and Windows amd64 (Git Bash):

bash
curl -fsSL https://aisessions.dev/install.sh | bash

This installs the binary to ~/.aisessions/bin. Follow the instructions to add it to your PATH.

Custom installation directory:

bash
curl -fsSL https://aisessions.dev/install.sh | INSTALL_DIR=/custom/path bash

Manual Download

Download pre-built binaries from GitHub Releases.

Build from Source

Prerequisites: Go 1.25.13 or later

bash
go build -o bin/aisessions ./cmd/ai-sessions

Setup

After installation, configure your MCP client to use the binary:

Claude Code CLI

bash
claude mcp add --scope user --transport stdio ai-sessions -- ~/.aisessions/bin/aisessions

Or if using a custom install location:

bash
claude mcp add --scope user --transport stdio ai-sessions -- /path/to/aisessions

Verify the connection with claude mcp get ai-sessions.

Codex CLI and ChatGPT desktop app

Add the server from the CLI:

bash
codex mcp add ai-sessions -- ~/.aisessions/bin/aisessions

Codex CLI and the ChatGPT desktop app share ~/.codex/config.toml, so the server is available in both after you restart the desktop app. In ChatGPT, open Settings → MCP servers to check its status, or type /mcp in the composer.

For manual configuration, use an absolute path (the command is launched directly, without shell expansion):

toml
[mcp_servers.ai_sessions]
command = "/Users/YOUR_USERNAME/.aisessions/bin/aisessions"

Replace YOUR_USERNAME with your actual username, or use your custom install path.

Claude Desktop

Add to the config file opened from Settings → Developer → Edit Config:

json
{
  "mcpServers": {
    "ai-sessions": {
      "command": "/Users/YOUR_USERNAME/.aisessions/bin/aisessions"
    }
  }
}

Replace YOUR_USERNAME with your actual username, or use your custom install path.

Restart Claude Desktop, then open Developer settings or + → Connectors in a conversation to check the connection. Claude Desktop also supports packaged .mcpb extensions, but direct configuration remains useful for a standalone downloaded binary.

CLI Upload

The aisessions binary includes a CLI tool for uploading supported local agent transcripts to aisessions.dev for sharing.

Authentication

bash
aisessions login

Opens your browser to generate a CLI token. The token is saved locally in ~/.aisessions/config.json.

Uploading Sessions

Interactive mode (no file argument):

bash
aisessions upload

Displays a searchable list of recent upload-compatible sessions from Claude Code, Codex, Gemini CLI, Mistral Vibe, and GitHub Copilot CLI. Use arrow keys to navigate and select a session to upload. opencode sessions remain available through the MCP server but are omitted from the upload picker because its current store is a shared SQLite database rather than one transcript file per session.

Direct mode (with file path):

bash
aisessions upload /path/to/session.jsonl
aisessions upload /path/to/session.jsonl --title "Custom Title"

Options

  • --title <title> - Set a custom title for the uploaded transcript
  • --url <url> - Override the API URL (https://aisessions.dev or a local development server)

MCP Usage

Once configured as an MCP server, you can ask:

  • "Let's continue my latest session from Claude Code"
  • "Show me my recent Codex sessions"
  • "Search my sessions for authentication bugs"
  • "How many times did Claude tell me I was absolutely right yesterday?"

How It Works

The server reads session files stored locally by various CLI coding agents:

  • Claude Code: ~/.claude/projects/[PROJECT_DIR]/*.jsonl
  • Gemini CLI: ~/.gemini/tmp/[PROJECT_HASH]/chats/session-*.jsonl (plus legacy .json recordings)
  • OpenAI Codex: ~/.codex/sessions/ and ~/.codex/archived_sessions/
  • opencode: ~/.local/share/opencode/opencode.db (plus the legacy storage/ JSON tree)
  • Mistral Vibe: ~/.vibe/logs/session/
  • GitHub Copilot CLI: ~/.copilot/session-state/[SESSION_ID]/events.jsonl (plus legacy flat JSONL files)

When you ask your AI agent to list or search sessions, the server reads these local stores through source-specific adapters; it does not launch the agent CLIs.

Available Tools

list_available_sources

Shows which AI CLI source adapters are available from the running server.

list_sessions

Lists recent sessions from all projects (newest first).

Arguments:

  • source (optional): Filter by claude, gemini, codex, opencode, mistral, or copilot
  • project_path (optional): Filter by specific project directory
  • limit (optional): Max results (default: 10)

Example: {"source": "claude", "limit": 20}

search_sessions

Searches session content using BM25 ranking. Returns results sorted by relevance score with contextual snippets.

Arguments:

  • query (required): Search term (supports multiple keywords)
  • source (optional): Filter by source
  • project_path (optional): Filter by project
  • limit (optional): Max results (default: 10)

Example: {"query": "authentication bug"}

Returns: Each match includes:

  • session: Session metadata (ID, source, project, timestamp)
  • score: Relevance score (higher = more relevant)
  • snippet: Contextual excerpt (~300 chars) showing where the match occurred

get_session

Retrieves full session content with pagination.

Arguments:

  • session_id (required): Session ID from list results
  • source (required): Which coding agent created it
  • page (optional): Page number (default: 0)
  • page_size (optional): Messages per page (default: 20)

Development

To keep formatting consistent and catch regressions early:

  • Install pre-commit and run pre-commit install to enable hooks (gofmt, go vet, go test).
  • Pushes to main and pull requests targeting main run the GitHub Actions workflow (.github/workflows/build.yml), which checks formatting, runs go vet, builds the binary, and executes go test -cover ./....

License

MIT

Installation

TypingMind
Prerequisites:

Node.js 18+

{
  "mcpServers": {
    "yoavf-ai-sessions-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "ai-sessions-mcp"
      ]
    }
  }
}

Use AI 会话 MCP 服务器 MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once AI 会话 MCP 服务器 is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add AI 会话 MCP 服务器 as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the AI 会话 MCP 服务器 MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "yoavf-ai-sessions-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "ai-sessions-mcp"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the AI 会话 MCP 服务器 MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the AI 会话 MCP 服务器 MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use AI 会话 MCP 服务器 to help me with this task?
AI 会话 MCP 服务器
Sure. I read it.
Here is what I found using AI 会话 MCP 服务器.

Frequently asked questions

What is the AI 会话 MCP 服务器 MCP server used for?

AI 会话 MCP 服务器 is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use AI 会话 MCP 服务器 MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use AI 会话 MCP 服务器 with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use AI 会话 MCP 服务器 MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With AI 会话 MCP 服务器 connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect AI 会话 MCP 服务器 MCP to TypingMind?

AI 会话 MCP 服务器 runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does AI 会话 MCP 服务器 MCP provide in TypingMind?

AI 会话 MCP 服务器 exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use AI 会话 MCP 服务器 MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If AI 会话 MCP 服务器 requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇