Code2prompt MCP Server

A tool to convert code snippets into AI prompts for documentation or explanation purposes.

Local serverstdioPython

What is the Code2prompt MCP server?

Code2prompt MCP server is a locally run integration for AI assistants that speak the Model Context Protocol. A tool to convert code snippets into AI prompts for documentation or explanation purposes.

What you get

Code2Prompt is a powerful command-line tool that generates comprehensive prompts from codebases, designed to streamline interactions between developers and Large Language Models (LLMs) for code analysis, documentation, and improvement tasks.

  • File Selection — Navigate through the directory structure and select files using keyboard controls
  • Visual Feedback — The interface provides visual cues to help you understand which files are selected or ignored

Setting it up

The server ships on PyPI as code2prompt, so your MCP client can launch it on demand — there is no separate build step. Add the server block to your client's configuration, restart it, and the tools register themselves.

What the assistant can call

Once Code2prompt is connected, these are the calls the assistant has available:

  • Installation — The Installation tool exposed by this server

Before you rely on it

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • MCP clients confirm each tool call by default. Leave that on until you have watched what the code2prompt mcp server does with a few real requests.

Choosing this one

Plenty of file and storage access servers cover similar ground. The differences that matter in practice are scope of access and how much setup stands between you and a working tool call. Code2prompt's toolset — Installation — is a fair guide to whether it matches your workflow. It is maintained by Raphael MANSUY; worth a glance at recent repository activity before you build anything load-bearing on it.

We check each listing at SyncDev against the project's documentation before it goes live — if something here drifts out of date, it is a bug worth reporting.

Available tools

ToolWhat it does
InstallationThe Installation tool exposed by this server.

How to install the Code2prompt MCP server

{
  "mcpServers": {
    "code2prompt": {
      "command": "uvx",
      "args": ["code2prompt"]
    }
  }
}

Add to claude_desktop_config.json, then restart Claude Desktop.

Example prompts to try

  • Use Code2prompt to Installation.

Frequently asked questions

It connects Code2prompt to MCP-compatible AI assistants such as Claude and Cursor, exposing 1 tool (Installation) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Code2prompt directly.