Codefetch MCP Server

Fetches all files in the current directory and outputs them in a Markdown file.

Local serverstdioTypeScript

What is the Codefetch MCP Server?

Fetches all files in the current directory and outputs them in a Markdown file.

What you get

Codefetch is a powerful tool that converts git repositories and local codebases into structured Markdown files optimized for Large Language Models (LLMs). It intelligently collects, processes, and formats code while respecting ignore patterns and providing token counting for various AI models.

  • 📁 Local Codebase Processing - Convert entire codebases into AI-friendly Markdown
  • 🔗 Git Repository Support - Fast GitHub API fetching with git clone fallback
  • 🐙 Multi-Platform Support - Works with GitHub, GitLab, and Bitbucket
  • 🎯 Smart Filtering - Respect .gitignore patterns and custom exclusions
  • 📊 Token Counting - Track tokens for GPT-4, Claude, and other models
  • 🚀 CLI & SDK - Use via command line or integrate programmatically

More MCP options

Compare MCP servers by category, or browse hosted MCP servers if you prefer an endpoint over a local process.

Maintainer setup documentation.

How to install the Codefetch MCP Server

{
  "mcpServers": {
    "codefetch": {
      "command": "npx",
      "args": ["-y", "codefetch"],
      "env": {
        "GITHUB_TOKEN": "your-value"
      }
    }
  }
}

Add to claude_desktop_config.json, then restart Claude Desktop.

Configuration

VariableDescriptionRequired
GITHUB_TOKENCredential the server authenticates with.Yes

Example prompts to try

  • “Use Codefetch to Configuration.”

Frequently asked questions

Fetches all files in the current directory and outputs them in a Markdown file. Confirm the tools offered by your installed version in the connected client. Tool availability and permissions depend on the server and account configuration.