CodeWeaver MCP Server
Converts entire codebases into a single, AI-readable Markdown document with structured directory trees and syntax highlighting. It enables AI assistants to analyze complete project contexts for tasks like code reviews, documentation, and refactoring.
README
CodeWeaver MCP Server
Transform your entire codebase into a single, AI-readable Markdown document through the Model Context Protocol.
English | įŽäŊ䏿
CodeWeaver MCP Server brings powerful code packaging capabilities to AI assistants like Claude Code. It converts complex project structures into clean, navigable Markdown files - perfect for code reviews, documentation, AI analysis, and sharing with teams.
Why CodeWeaver MCP?
đ Seamless AI Integration
- Native MCP Protocol: Works out-of-the-box with Claude Code and other MCP-compatible AI assistants
- Zero Context Switching: Access codebase packaging directly from your AI workflow
- Instant Results: Get Markdown output immediately or save to file
đĻ Complete Codebase Visibility
- Full Structure Capture: Beautiful tree-view of your entire project hierarchy
- All Code Included: Every file's content embedded with proper syntax highlighting
- Smart Filtering: Respects
.gitignoreand supports custom ignore patterns
đĄ Perfect for Multiple Use Cases
For AI Analysis
- Feed entire codebases to AI models (ChatGPT, Claude, etc.)
- Enable comprehensive code understanding without manual file sharing
- Perfect for code reviews and refactoring discussions
For Documentation
- Generate instant project snapshots
- Create shareable codebase documentation
- Archive project states at key milestones
For Team Collaboration
- Share complete project context with teammates
- Onboard new developers faster
- Facilitate remote code discussions
For Code Reviews
- Package pull requests with full context
- Review entire features in one document
- Track code changes across multiple files
Features
đ¯ Pure TypeScript Implementation
- No External Dependencies: Built entirely in TypeScript - no Go, Python, or other runtimes required
- Fast & Lightweight: Efficient file scanning and processing
- Cross-Platform: Works on macOS, Linux, and Windows
đ ī¸ Powerful Customization
- Flexible Filtering: Include/exclude files with glob patterns
- Gitignore Support: Automatically respects your
.gitignorerules - Custom Patterns: Add project-specific ignore patterns
- Multiple Output Modes: Return content directly or save to file
đ Smart Markdown Output
- Syntax Highlighting: Automatic language detection for 20+ programming languages
- Clean Formatting: Professional tree structure using box-drawing characters
- Organized Layout: Logical file ordering (directories first, alphabetical)
- Relative Paths: Clear file location references
Installation
Prerequisites
- Node.js 18 or later
- npm or yarn
Quick Install
# Clone and build
git clone https://github.com/yourusername/codeweaver-mcp-server.git
cd codeweaver-mcp-server
npm install
npm run build
Add to Claude Code
claude mcp add codeweaver node /absolute/path/to/codeweaver-mcp-server/dist/index.js
Or manually add to ~/.claude/config.json:
{
"mcpServers": {
"codeweaver": {
"command": "node",
"args": ["/absolute/path/to/codeweaver-mcp-server/dist/index.js"]
}
}
}
Usage
Basic Usage
Pack current directory:
codeweaver_pack_codebase({
path: "."
})
Save to File
codeweaver_pack_codebase({
path: "./src",
output: "codebase.md"
})
Include Gitignored Files
codeweaver_pack_codebase({
path: ".",
include_gitignored: true
})
Custom Ignore Patterns
codeweaver_pack_codebase({
path: ".",
ignore_patterns: ["*.log", "tmp/*", "*.tmp"]
})
Output Format
CodeWeaver generates clean, structured Markdown:
# project-name
## Directory Structure
âââ src â âââ index.ts â âââ utils.ts âââ package.json
## Files
### src/index.ts
```typescript
// Full file content with syntax highlighting
import { helper } from './utils';
...
src/utils.ts
// Full file content
export function helper() { ... }
## Supported Languages
Automatic syntax highlighting for:
- TypeScript/JavaScript (`.ts`, `.tsx`, `.js`, `.jsx`)
- Python (`.py`)
- Go (`.go`)
- Rust (`.rs`)
- Java (`.java`)
- C/C++ (`.c`, `.cpp`, `.h`, `.hpp`)
- C# (`.cs`)
- Ruby (`.rb`)
- PHP (`.php`)
- Swift (`.swift`)
- Kotlin (`.kt`)
- SQL (`.sql`)
- Shell (`.sh`)
- YAML (`.yaml`, `.yml`)
- JSON (`.json`)
- XML (`.xml`)
- HTML (`.html`)
- CSS (`.css`)
- Markdown (`.md`)
## Default Ignore Patterns
CodeWeaver automatically skips:
- `node_modules/`
- `.git/`
- `dist/` and `build/`
- `.next/` and `.nuxt/`
- `vendor/`
- Python virtual environments (`venv/`, `.venv/`, `__pycache__/`)
- System files (`.DS_Store`, `Thumbs.db`)
## Real-World Examples
### Example 1: Share Code with ChatGPT
```typescript
// Pack your project
codeweaver_pack_codebase({
path: "./my-app",
output: "my-app-context.md"
})
// Copy the Markdown file content and paste into ChatGPT
// Now ChatGPT can see your entire codebase!
Example 2: Code Review Documentation
// Pack only source code
codeweaver_pack_codebase({
path: "./src",
ignore_patterns: ["*.test.ts", "*.spec.ts"],
output: "review-package.md"
})
Example 3: Project Snapshot
// Capture complete project state
codeweaver_pack_codebase({
path: ".",
output: `snapshot-${new Date().toISOString()}.md`
})
API Reference
codeweaver_pack_codebase
Parameters:
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
path |
string | â Yes | - | Directory path to pack |
output |
string | â No | - | Output file path (returns content if omitted) |
include_gitignored |
boolean | â No | false |
Include files listed in .gitignore |
ignore_patterns |
string[] | â No | [] |
Additional glob patterns to ignore |
Returns:
- If
outputspecified: Success message with file path and size - If
outputomitted: Complete Markdown content
Error Handling:
"Error: Path does not exist"- Invalid directory path"Error: Path is not a directory"- Path points to a file- Binary files automatically skipped with notice
Development
Build from Source
npm install
npm run build
Development Mode
npm run dev
Clean Build
npm run clean
npm run build
Why Choose CodeWeaver MCP?
â For AI-First Workflows: Built specifically for AI tools, unlike generic file packers â Zero Configuration: Works immediately with sensible defaults â Professional Output: Clean, readable Markdown that humans and AI love â Modern Stack: Pure TypeScript, no legacy dependencies â Active Development: Regularly updated with new features â MIT Licensed: Free for personal and commercial use
Comparison with Alternatives
| Feature | CodeWeaver MCP | Command-line tools | VSCode Extensions |
|---|---|---|---|
| AI Integration | â Native MCP | â Manual copy-paste | â ī¸ Limited |
| Zero Config | â Yes | â Complex flags | â Yes |
| Cross-Platform | â Yes | â ī¸ Varies | â ī¸ VSCode only |
| Real-time Use | â Yes | â No | â ī¸ Limited |
| TypeScript Native | â Yes | â Various | â ī¸ Varies |
Contributing
Contributions welcome! Please feel free to submit issues or pull requests.
License
MIT License - see LICENSE file for details
Acknowledgments
Inspired by the original CodeWeaver project and adapted for the Model Context Protocol ecosystem.
Made with â¤ī¸ for the AI development community
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
E2B
Using MCP to run code via e2b.