Skip to content

Feature: export_codebase MCP tool — export indexed codebase as text for LLM planning #862

Description

@rulrok

What problem does this solve?

I use a custom tool to concatenate all my codebase into a text file to paste into ChatGPT/DeepSeek/Qwen to draft an initial implementation plan before running agents — saves tokens and improves planning accuracy for initial draft.

Currently: get_architecture returns JSON (great for agents, not for LLM context). I manually copy files → lose import relationships → LLM makes assumptions.

Need: A command that exports the indexed codebase as plain text I can copy-paste into chat LLMs.

Proposed solution

Add an MCP tool export_codebase that outputs structured text:

codebase-memory-mcp cli export_codebase '{"project":"myapp"}'

Alternatives considered

JSON-only export — Could reuse get_architecture as-is, but JSON doesn't paste well into chat interfaces; text is more natural.
Markdown format — Possible as a format option, but text is simpler and more portable.
Server-side compression — Could gzip large exports, but text is already token-efficient; not needed.

Confirmations

  • I searched existing issues and this is not a duplicate.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions