NC

nextstat/chatgpt2md

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

20 stars 1 forks 质量 62 趋势 10MIT

将ChatGPT导出为Markdown,支持全文搜索和Claude的MCP服务器

概览

带着你的ChatGPT历史访问Claude。包含全文搜索功能。 一个快速的CLI工具,可以将你的ChatGPT导出文件转换为有序的Markdown文件,构建搜索索引,并提供MCP服务器,使Claude能够原生搜索和读取你的对话历史。 - 将 ChatGPT 导出(ZIP 或 JSON)转换为干净的 Markdown 文件 - 内置全文搜索,由 Tantivy 驱动 - MCP 服务器,包含 3 个工具用于 Claude 集成 - Claude 桌面和 Claude Code 的一命令自动安装 - 支持 macOS 和 Windows - 单一二进制,无运行时依赖 1. 前往 chatgpt.com 2.点击你的个人资料图标(左下角) > 3.前往4。点击> 5。等待OpenAI的邮件(通常几分钟内到达) 6.从邮件中的链接下载ZIP文件 ZIP文件里有你所有聊天记录conversations.json。 导出时包含你所有的对话——如果你有成千上万的聊天记录,这可能需要一段时间。

概述(AI 翻译)

带着你的ChatGPT历史访问Claude。包含全文搜索。

一个快速的CLI工具,可以将你的ChatGPT导出文件转换为有序的Markdown文件,构建搜索索引,并提供MCP服务器,使Claude能够原生搜索和读取你的对话历史。

主要功能:

  • 将ChatGPT导出(ZIP或JSON)转换为干净的Markdown文件
  • 内置全文搜索,由 Tantivy 驱动
  • MCP服务器,包含3个Claude集成工具
  • Claude Desktop 和 Claude Code 的一命令自动安装
  • 适用于macOS和Windows平台
  • 单一二进制,无运行时依赖

目录

  • 快速入门
  • 步骤1:导出您的ChatGPT数据
  • 步骤2:安装chatgpt2md
  • 步骤3:转换您的导出
  • 步骤4:连接Claude
  • 第五步:用它!
  • 命令参考
  • 手动MCP配置
  • 输出结构
  • 源头构建
  • 许可证

快速启动

步骤1:导出您的ChatGPT数据

  1. 前往 chatgpt.com
  2. 点击你的个人资料图标(左下角)> 设置
  3. 前往数据控制
  4. 点击导出数据 > 确认导出
  5. 等待OpenAI的邮件(通常几分钟内到达)
  6. 通过邮件中的链接下载ZIP文件

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

chatgpt2md

Take your ChatGPT history with you to Claude. Full-text search included.

A fast CLI tool that converts your ChatGPT export into organized Markdown files, builds a search index, and provides an MCP server so Claude can search and read your conversation history natively.

Key features:

  • Converts ChatGPT export (ZIP or JSON) to clean Markdown files
  • Built-in full-text search powered by Tantivy
  • MCP server with 3 tools for Claude integration
  • One-command auto-install for Claude Desktop and Claude Code
  • Works on macOS and Windows
  • Single binary, no runtime dependencies

Table of Contents

Quick Start

# Install
cargo install --git https://github.com/NextStat/chatgpt2md

# Convert your ChatGPT export
chatgpt2md export.zip

# Install MCP into Claude (auto-configures everything)
chatgpt2md install --index ./chatgpt_chats/.index --chats ./chatgpt_chats

# Restart Claude — done!

Step 1: Export Your ChatGPT Data

  1. Go to chatgpt.com
  2. Click your profile icon (bottom-left) > Settings
  3. Go to Data controls
  4. Click Export data > Confirm export
  5. Wait for the email from OpenAI (usually arrives within a few minutes)
  6. Download the ZIP file from the link in the email

The ZIP file contains conversations.json with all your chat history.

Tip: The export includes ALL your conversations — this may take a while if you have thousands of chats.

Step 2: Install chatgpt2md

Download the latest release for your platform from the Releases page:

Platform File
macOS (Apple Silicon) chatgpt2md-aarch64-apple-darwin.tar.gz
macOS (Intel) chatgpt2md-x86_64-apple-darwin.tar.gz
Windows chatgpt2md-x86_64-pc-windows-msvc.zip
Linux chatgpt2md-x86_64-unknown-linux-gnu.tar.gz
# macOS / Linux: extract and move to PATH
tar xzf chatgpt2md-*.tar.gz
sudo mv chatgpt2md /usr/local/bin/

Option B: Install from source

Requires Rust 1.85+:

cargo install --git https://github.com/NextStat/chatgpt2md

Option C: Build locally

git clone https://github.com/NextStat/chatgpt2md
cd chatgpt2md
cargo build --release
# Binary is at ./target/release/chatgpt2md

Step 3: Convert Your Export

在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "chatgpt-history": { "command": "/path/to/chatgpt2md", "args": ["serve", "--index", "/path/to/chatgpt_chats/.index", "--chats", "/path/to/chatgpt_chats"] } } }