Skip to main content
Glama
session-convert

session-convert

by megamen32

session-convert

Move an AI coding session between Claude Code, Codex CLI, and OpenCode without losing the conversation.

Docs · Conversion reference · Русский

session-convert data flow

When the useful context is in the wrong coding agent, session-convert reads the source session, maps it to a common conversation, and writes the target agent's native JSONL or SQLite format. It is an MCP server for local, user-owned session files—not a hosted sync service.

What it does

  • Converts all six directions between Claude Code, Codex CLI, and OpenCode.

  • Reads Claude/Codex JSONL and current or legacy OpenCode SQLite layouts.

  • Preserves text, tool calls/results, reasoning where available, images, metadata, and model names.

  • Previews message counts, tool activity, and compatibility notes before writing.

  • Also exposes a direct-path conversion API for known .jsonl or .db files.

Related MCP server: pacifico

Install from source

There is no published package install documented here yet. For a source checkout, use Node.js 20+ and run:

git clone https://github.com/megamen32/session-convert.git
cd session-convert
npm ci
npm run build

Then point your MCP client at dist/index.js:

{
  "mcpServers": {
    "session-convert": {
      "command": "node",
      "args": ["/absolute/path/to/session-convert/dist/index.js"]
    }
  }
}

First conversion

Use list_sessions to find a session, preview_conversion to inspect the mapping, and convert_session to write it. convert_by_path is available when you already know the source file. The server accesses local session files using the permissions of the MCP client.

Learn more

License

MIT

Available Tools

4 tools
convert_by_pathA

Convert a session file by its direct file path. Auto-detects the format (Claude JSONL, Codex rollout JSONL, or OpenCode .db). Useful when you know the exact file location.

Inputs: to (required), sourcePath (required), projectPath.

convert_sessionB

Convert a session from one harness to another. Reads the session, transforms messages to the target format, and writes it to the target harness's native storage. OpenCode conversion (read/write) is uniquely supported — no other tool does this.

Inputs: to (required), from (required), sessionId (required), projectPath, +1 more.

list_sessionsA

List convertible sessions from a harness. Shows session ID, title, CWD, model, message count, and age. Use this to find the session ID to convert.

Inputs: harness (required), cwdPrefix, searchPaths.

preview_conversionA

Preview what a session conversion would look like without actually writing anything. Shows message breakdown, tool call stats, and compatibility notes for the target format.

Inputs: to (required), from (required), sessionId (required), searchPaths.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 4 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: listing sessions, converting by session ID, previewing conversions, and converting by file path. There is no overlap or ambiguity between them.

    Naming Consistency4/5

    All tools use snake_case with a verb_noun pattern. The two convert tools differ by the argument (session vs path), which is consistent but could be slightly confusing. Overall, naming is predictable and well-structured.

    Tool Count5/5

    With 4 tools, the set is well-scoped for session conversion. Each tool serves a necessary function: listing, converting by ID, previewing, and converting by path. No unnecessary tools and no missing essential operations.

    Completeness5/5

    The tool set covers the full conversion workflow: discovering sessions (list_sessions), previewing before conversion (preview_conversion), and converting via two methods (by session ID or by file path). No obvious gaps for the stated purpose.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables local archiving and searchable recall of AI coding sessions from Claude Code, Codex, Pi, and OpenCode via MCP, allowing agents to access past conversations as context.
      2
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables converting and migrating coding-agent instruction files and MCP server configurations between Claude Code, Codex CLI, Cursor and Gemini CLI, with read-only detection of existing configs, dry-run project migration, and a doc-linked compatibility matrix. Runs locally over stdio with no network calls or telemetry, writing files only when explicitly requested.
      5
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables Claude Code sessions to automatically capture and retrieve architectural decisions, code changes, bug fixes, and configuration context across sessions using local SQLite storage and hybrid semantic/keyword search.
      79 PyPI
      1
      MIT