Skip to main content
Glama
megamen32

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: codex-mcp-server

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
toYesTarget harness
sourcePathYesAbsolute path to the source session file (.jsonl or .db)
projectPathNoFor OpenCode target: project directory path

TDQS

A3.9/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must carry the burden. It mentions auto-detection of format, which is helpful, but fails to disclose side effects (e.g., whether the conversion creates a new file, overwrites, or returns output) or any permissions needed. The disclosure is adequate but not comprehensive.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two concise sentences with no redundant information. Every word adds value: it defines the tool, states auto-detection, and gives usage context. Perfectly sized and front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema and no annotations, the description covers purpose and when-to-use but lacks information about the result of conversion (output format, file creation, return value). It is moderately complete for a simple tool but could include more detail about what happens after conversion.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so parameters are already documented. The description adds contextual value (auto-detection logic) but does not elaborate on parameter specifics like allowed values for 'to' or path constraints. Baseline 3 is appropriate as the description adds marginal extra meaning.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool converts a session file by its direct file path and lists the auto-detected formats. It distinguishes from sibling 'convert_session' by emphasizing the file path method, providing a specific verb-resource-scope combination.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description says 'Useful when you know the exact file location', which implies when to use, but does not explicitly provide when-not-to-use or compare to siblings like convert_session. The guidance is clear but lacks exclusionary context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
toYesTarget harness
fromYesSource harness
sessionIdYesSession ID to convert
projectPathNoFor OpenCode target: explicitly use this project-local .opencode/opencode.db; omitted uses the current global OpenCode database
searchPathsNoFor OpenCode source: paths to search for databases

TDQS

B3.3/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It describes the process (read, transform, write) but omits important behavioral traits like whether the source is modified, required permissions, or potential side effects. The uniqueness claim is helpful but insufficient.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise with two sentences, no redundancy, and front-loads the core purpose. However, it could be more structured with bullet points for clarity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no output schema and 5 parameters (3 required), the description fails to explain return values or the role of optional parameters (projectPath, searchPaths). The conversion process is described but completeness for decision-making is lacking.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the baseline is 3. The description adds no additional meaning to parameters beyond what the schema already provides. It does not explain relationships between parameters or provide usage examples.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool converts a session between harnesses, using verbs 'reads', 'transforms', and 'writes'. It distinguishes from siblings by noting that OpenCode conversion is uniquely supported, making the purpose highly specific.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description hints at usage for OpenCode conversion but does not explicitly state when to use this tool versus siblings like convert_by_path or preview_conversion. No when-not-to-use guidance is provided.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
harnessYesWhich harness to list sessions from
cwdPrefixNoFilter by CWD prefix (e.g. '~/apps' to find sessions in that directory tree)
searchPathsNoAdditional paths to search for OpenCode databases (only for opencode harness)

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description must bear full burden. It states the tool lists sessions and shows fields, but does not explicitly declare read-only nature, potential rate limits, or pagination. A score of 3 reflects adequate but not explicit disclosure.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three concise sentences: action, output fields, usage. Front-loaded and no redundancy. Every sentence adds value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple list tool with 3 parameters all documented in schema, the description covers output fields and usage. It does not mention pagination or largest possible result set, but given the tool's simplicity, it is nearly complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already describes all parameters. The description adds no additional parameter-level meaning beyond referencing harness and fields shown. Baseline of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's action ('List convertible sessions'), specifies the output fields, and distinguishes it from sibling conversion tools by indicating its role in finding session IDs.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly says 'Use this to find the session ID to convert', which provides clear usage context. While it doesn't detail when not to use or list alternatives, the sibling tools are implicitly different (conversion vs. listing).

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
toYesTarget harness
fromYesSource harness
sessionIdYesSession ID to preview
searchPathsNoFor OpenCode source: paths to search for databases

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries full burden. It states 'without actually writing anything' clarifying it's read-only, and describes output content. It does not mention permissions or error handling, but for a preview tool, the description is adequate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, front-loaded with the core action, and the second sentence elaborates on output. No unnecessary words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of an output schema, the description provides a good overview of the return type. It explains the parameters sufficiently with schema coverage. Could mention expected structure or error states, but overall complete for a preview tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so baseline is 3. The description adds context about what the preview shows, but does not add specific parameter-level meaning beyond what the schema provides. It adds marginal value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'preview' and the resource 'session conversion', and lists what it shows (message breakdown, tool call stats, compatibility notes). This distinguishes it from sibling tools like 'convert_session' which actually perform the conversion.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage by saying 'without actually writing anything', suggesting it's for safe preview. However, it does not explicitly state when to use this tool over alternatives like 'convert_session' or 'convert_by_path', though the context is clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 4 tool updatesv0.1.0
    • First observedconvert_by_path
    • First observedconvert_session
    • First observedlist_sessions
    • First observedpreview_conversion

TDQS

A4/5.0
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

ActivityMaintained
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables searching and retrieving Claude Code conversation history that would otherwise expire after 30 days. Supports full-text search, semantic search, and session management with automatic backup of all conversations.
    7
    28
    MIT
  • A
    license
    A
    quality
    C
    maintenance
    Bridges Claude and OpenAI's Codex CLI for AI-powered code analysis, generation, and review, with support for session management, web search, and structured output.
    6
    765
    628
    ISC
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables AI agents to list, inspect, and export OpenCode AI coding sessions as HTML/JSON archives with secret redaction and token statistics.
    1
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/megamen32/session-convert'

If you have feedback or need assistance with the MCP directory API, please join our Discord server