BACH CodeCommander

编码与调试

by lukisch

15 tools for code analysis, JSON repair, encoding fix, import organization, and PDF export.

什么是 BACH CodeCommander

15 tools for code analysis, JSON repair, encoding fix, import organization, and PDF export.

README

<p align="center"> <img src="assets/codecommander_banner.jpg" alt="CodeCommander banner" width="700"> </p>

ellmos CodeCommander MCP Server

🇩🇪 Deutsche Version

Part of the ellmos-ai family.

License: MIT npm version CodeCommander tests Node.js

A developer-focused Model Context Protocol (MCP) server that gives AI assistants code analysis, structural Python editing, JSON repair, encoding fix, import organization, format conversion, file diff, and regex testing capabilities.

21 tools optimized for developers - the coding companion to FileCommander.

Discoverability: Published on npm as ellmos-codecommander-mcp, visible on Glama, and prepared for the official MCP Registry with server.json under io.github.ellmos-ai/ellmos-codecommander-mcp.


Why CodeCommander?

While FileCommander handles filesystem operations, CodeCommander focuses on code intelligence:

  • Python Code Analysis - AST-based class/method extraction, complexity metrics, import analysis
  • BACH-derived Python Helpers - runtime import diagnostics, structural edits, indentation checks, and template-based code generation
  • JSON Repair - Fix broken JSON automatically (trailing commas, single quotes, BOM, comments)
  • Import Organization - Sort and deduplicate Python imports per PEP 8
  • Encoding Fix - Repair Mojibake and double-encoded UTF-8 (27+ patterns)
  • Umlaut Repair - Fix broken German characters (70+ patterns)
  • Format Conversion - Convert between JSON, CSV, INI, YAML, TOML, XML, and TOON
  • File Diff - Compare two files with unified diff output (LCS algorithm)
  • Regex Tester - Test regular expressions with match details, groups, and replace preview
  • Markdown Export - Convert Markdown to professional HTML/PDF with code blocks, tables, nested lists, blockquotes
  • Cross-platform - Works on Windows, macOS, and Linux

Installation

Prerequisites

Option 1: Install from NPM

bash
npm install -g ellmos-codecommander-mcp

Option 2: Install from Source

bash
git clone https://github.com/ellmos-ai/ellmos-codecommander-mcp.git
cd ellmos-codecommander-mcp
npm install
npm run build

Configuration

Claude Desktop

Add to your claude_desktop_config.json:

Windows: %APPDATA%\Claude\claude_desktop_config.json macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

If installed globally via NPM:

json
{
  "mcpServers": {
    "codecommander": {
      "command": "ellmos-codecommander"
    }
  }
}

If installed from source:

json
{
  "mcpServers": {
    "codecommander": {
      "command": "node",
      "args": ["/absolute/path/to/ellmos-codecommander-mcp/dist/index.js"]
    }
  }
}

Using Both Servers Together

FileCommander and CodeCommander are designed to work side by side:

json
{
  "mcpServers": {
    "filecommander": {
      "command": "ellmos-filecommander"
    },
    "codecommander": {
      "command": "ellmos-codecommander"
    }
  }
}

Tools Overview

Code Analysis (3 tools)

ToolDescription
cc_analyze_codeFull code analysis: classes, functions, imports, LOC, complexity
cc_analyze_methodsDetailed method analysis: params, decorators, visibility, data flow, BACH guardrails
cc_extract_classesExtract Python classes/functions as separate text blocks, optionally including pycutter-style inline content

Import Management (3 tools)

ToolDescription
cc_organize_importsSort & deduplicate Python imports per PEP 8
cc_diagnose_importsDetect unused imports, duplicates, circular import risks
cc_runtime_import_diagnoseRun isolated Python runtime imports with timeouts, init.py analysis, and circular-import hints

JSON Tools (2 tools)

ToolDescription
cc_fix_jsonRepair broken JSON (BOM, trailing commas, comments, single quotes)
cc_validate_jsonValidate JSON with detailed error position and context

Encoding & Text (3 tools)

ToolDescription
cc_fix_encodingFix Mojibake / double-encoded UTF-8 (27+ patterns)
cc_cleanup_fileRemove BOM, NUL bytes, trailing whitespace, normalize line endings
cc_fix_umlautsRepair broken German umlauts (70+ patterns, HTML entities, escapes)

Scanning (1 tool)

ToolDescription
cc_scan_emojiScan files for emojis with codepoint info

Format & Documentation (2 tools)

ToolDescription
cc_convert_formatConvert between JSON, CSV, INI, YAML, TOML, XML, and TOON formats
cc_generate_licensesGenerate third-party license file (npm/pip)

Developer Utilities (2 tools)

ToolDescription
cc_diff_filesCompare two files with unified diff output (configurable context lines)
cc_regex_testTest regex patterns against text/files with match details, groups, and replace preview

Python Assistance (3 tools)

ToolDescription
cc_check_indentationDetect missing colons, unindented return/yield statements, and mixed tab/space indentation
cc_generate_python_codeGenerate Python functions, classes, dataclasses, CLI stubs, tests, exceptions, and modules from templates
cc_python_structural_editInspect and apply structural Python edits with preview, test-file, syntax-check and backup modes

Export (2 tools)

ToolDescription
cc_md_to_htmlMarkdown to standalone HTML with CSS styling (headers, code blocks, tables, nested lists, blockquotes, images, checkboxes)
cc_md_to_pdfMarkdown to PDF via headless browser (Edge/Chrome). Falls back to HTML if no browser is available

Total: 21 developer tools (cc_set_language is also available for runtime language switching)


Shared Tools

7 tools exist in both FileCommander and CodeCommander for convenience:

FileCommanderCodeCommanderFunction
fc_fix_jsoncc_fix_jsonJSON repair
fc_validate_jsoncc_validate_jsonJSON validation
fc_fix_encodingcc_fix_encodingEncoding repair
fc_cleanup_filecc_cleanup_fileFile cleanup
fc_convert_formatcc_convert_formatFormat conversion (JSON/CSV/INI/YAML/TOML/XML/TOON)
fc_md_to_htmlcc_md_to_htmlMarkdown to HTML export
fc_md_to_pdfcc_md_to_pdfMarkdown to PDF export

Tool Prefix

All tools use the cc_ prefix (CodeCommander) to avoid conflicts with FileCommander's fc_ prefix and other MCP servers.


Security

See SECURITY.md for detailed security information.

Key points:

  • File-modifying tools support preview/dry-run modes where applicable
  • Backup creation is enabled by default for destructive operations
  • No built-in sandboxing - security is delegated to the MCP client
  • Designed for local development use via stdio transport

Development

bash
npm install
npm run dev    # Watch mode
npm run build  # One-time build
npm start      # Start server
npm test       # Run test suite (vitest)

Testing

The project includes a comprehensive test suite covering all 21 developer tools and i18n behavior.

bash
npm test              # Run all tests
npx vitest run        # Same as above
npx vitest --watch    # Watch mode

Tests are verified on Windows, macOS, and Linux.

GitHub Actions runs the build, Vitest suite, and npm package check on Node.js 20, 22, and 24.


Changelog

See CHANGELOG.md for the full version history.


License

MIT - Lukas Geiger (ellmos-ai)


History

This project was originally developed as BACH CodeCommander (bach-codecommander-mcp). It has been renamed to ellmos CodeCommander (ellmos-codecommander-mcp) as part of the ellmos-ai organization.

The legacy package name bach-codecommander-mcp is deprecated. Please use ellmos-codecommander-mcp instead:

bash
npm uninstall -g bach-codecommander-mcp
npm install -g ellmos-codecommander-mcp

ellmos-ai Ecosystem

This MCP server is part of the ellmos-ai ecosystem — AI infrastructure, MCP servers, and intelligent tools.

MCP Server Family

ServerToolsFocusnpm
FileCommander44Filesystem, process management, interactive sessionsellmos-filecommander-mcp
CodeCommander17Code analysis, AST parsing, import managementellmos-codecommander-mcp
Clatcher12File repair, format conversion, batch operationsellmos-clatcher-mcp
n8n Manager18n8n workflow management via AI assistantsn8n-manager-mcp
ControlCenter10MCP stack discovery, profile management, control planeellmos-controlcenter-mcp

AI Infrastructure

ProjectDescription
BACHText-based OS for LLMs — 113+ handlers, 550+ tools, 1870+ skills
clutchProvider-neutral LLM orchestration with auto-routing and budget tracking
rinnsalLightweight agent memory, connectors, and automation infrastructure
ellmos-stackSelf-hosted AI research stack (Ollama + n8n + Rinnsal + KnowledgeDigest)
MarbleRunAutonomous agent chain framework for Claude Code
gardenerMinimalist database-driven LLM OS prototype (4 functions, 1 table)
ellmos-testsTesting framework for LLM operating systems (7 dimensions)

Desktop Software

Our partner organization open-bricks bundles AI-native desktop applications — a modern, open-source software suite built for the age of AI. Categories include file management, document tools, developer utilities, and more.


Liability

Dieses Projekt ist eine unentgeltliche Open-Source-Schenkung im Sinne der §§ 516 ff. BGB. Die Haftung des Urhebers ist gemäß § 521 BGB auf Vorsatz und grobe Fahrlässigkeit beschränkt. Ergänzend gilt der Haftungsausschluss der MIT-Lizenz.

Nutzung auf eigenes Risiko. Keine Wartungszusage, keine Verfügbarkeitsgarantie, keine Gewähr für Fehlerfreiheit oder Eignung für einen bestimmten Zweck.

This project is an unpaid open-source donation under German law. Liability is limited to intent and gross negligence (§ 521 German Civil Code), supplemented by the MIT License warranty disclaimer. Use at your own risk.

常见问题

BACH CodeCommander 是什么?

15 tools for code analysis, JSON repair, encoding fix, import organization, and PDF export.

相关 Skills

前端设计

by anthropics

Universal
热门

面向组件、页面、海报和 Web 应用开发,按鲜明视觉方向生成可直接落地的前端代码与高质感 UI,适合做 landing page、Dashboard 或美化现有界面,避开千篇一律的 AI 审美。

想把页面做得既能上线又有设计感,就用前端设计:组件到整站都能产出,难得的是能避开千篇一律的 AI 味。

编码与调试
未扫描165.3k

网页应用测试

by anthropics

Universal
热门

用 Playwright 为本地 Web 应用编写自动化测试,支持启动开发服务器、校验前端交互、排查 UI 异常、抓取截图与浏览器日志,适合调试动态页面和回归验证。

借助 Playwright 一站式验证本地 Web 应用前端功能,调 UI 时还能同步查看日志和截图,定位问题更快。

编码与调试
未扫描165.3k

网页构建器

by anthropics

Universal
热门

面向复杂 claude.ai HTML artifact 开发,快速初始化 React + Tailwind CSS + shadcn/ui 项目并打包为单文件 HTML,适合需要状态管理、路由或多组件交互的页面。

在 claude.ai 里做复杂网页 Artifact 很省心,多组件、状态和路由都能顺手搭起来,React、Tailwind 与 shadcn/ui 组合效率高、成品也更精致。

编码与调试
未扫描165.3k

相关 MCP Server

GitHub

编辑精选

by GitHub

热门

GitHub 是 MCP 官方参考服务器,让 Claude 直接读写你的代码仓库和 Issues。

这个参考服务器解决了开发者想让 AI 安全访问 GitHub 数据的问题,适合需要自动化代码审查或 Issue 管理的团队。但注意它只是参考实现,生产环境得自己加固安全。

编码与调试
89.1k

by Context7

热门

Context7 是实时拉取最新文档和代码示例的智能助手,让你告别过时资料。

它能解决开发者查找文档时信息滞后的问题,特别适合快速上手新库或跟进更新。不过,依赖外部源可能导致偶尔的数据延迟,建议结合官方文档使用。

编码与调试
60.0k

by tldraw

热门

tldraw 是让 AI 助手直接在无限画布上绘图和协作的 MCP 服务器。

这解决了 AI 只能输出文本、无法视觉化协作的痛点——想象让 Claude 帮你画流程图或白板讨论。最适合需要快速原型设计或头脑风暴的开发者。不过,目前它只是个基础连接器,你得自己搭建画布应用才能发挥全部潜力。

编码与调试
49.5k

评论