CodeWeaver MCP Server

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.

Category
访问服务器

README

CodeWeaver MCP Server

TypeScript MCP License: MIT

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 .gitignore and 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 .gitignore rules
  • 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 output specified: Success message with file path and size
  • If output omitted: 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

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选