bach-codecommander-mcp 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/LICENSE +21 -0
- package/README.md +209 -0
- package/SECURITY.md +40 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1419 -0
- package/dist/index.js.map +1 -0
- package/package.json +60 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## [1.0.0] - 2026-02-14
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- Initial release with 14 developer-focused tools
|
|
9
|
+
- Code Analysis: `cc_analyze_code`, `cc_analyze_methods`, `cc_extract_classes`
|
|
10
|
+
- Import Management: `cc_organize_imports`, `cc_diagnose_imports`
|
|
11
|
+
- JSON Tools: `cc_fix_json`, `cc_validate_json`
|
|
12
|
+
- Encoding & Text: `cc_fix_encoding`, `cc_cleanup_file`, `cc_fix_umlauts`, `cc_scan_emoji`
|
|
13
|
+
- Format Conversion: `cc_convert_format`
|
|
14
|
+
- Documentation: `cc_generate_licenses`, `cc_md_to_pdf`
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025-2026 Lukas (BACH)
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
# BACH CodeCommander MCP Server
|
|
2
|
+
|
|
3
|
+
[](https://opensource.org/licenses/MIT)
|
|
4
|
+
[](https://www.npmjs.com/package/bach-codecommander-mcp)
|
|
5
|
+
[](https://nodejs.org/)
|
|
6
|
+
|
|
7
|
+
A developer-focused **Model Context Protocol (MCP) server** that gives AI assistants code analysis, JSON repair, encoding fix, import organization, and format conversion capabilities.
|
|
8
|
+
|
|
9
|
+
**14 tools** optimized for developers - the coding companion to [FileCommander](https://github.com/lukisch/bach-filecommander-mcp).
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Why CodeCommander?
|
|
14
|
+
|
|
15
|
+
While FileCommander handles filesystem operations, CodeCommander focuses on **code intelligence**:
|
|
16
|
+
|
|
17
|
+
- **Python Code Analysis** - AST-based class/method extraction, complexity metrics, import analysis
|
|
18
|
+
- **JSON Repair** - Fix broken JSON automatically (trailing commas, single quotes, BOM, comments)
|
|
19
|
+
- **Import Organization** - Sort and deduplicate Python imports per PEP 8
|
|
20
|
+
- **Encoding Fix** - Repair Mojibake and double-encoded UTF-8 (27+ patterns)
|
|
21
|
+
- **Umlaut Repair** - Fix broken German characters (70+ patterns)
|
|
22
|
+
- **Format Conversion** - Convert between JSON, CSV, and INI
|
|
23
|
+
- **Cross-platform** - Works on Windows, macOS, and Linux
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Installation
|
|
28
|
+
|
|
29
|
+
### Prerequisites
|
|
30
|
+
|
|
31
|
+
- [Node.js](https://nodejs.org/) 18 or higher
|
|
32
|
+
|
|
33
|
+
### Option 1: Install from NPM
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
npm install -g bach-codecommander-mcp
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
### Option 2: Install from Source
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
git clone https://github.com/lukisch/bach-codecommander-mcp.git
|
|
43
|
+
cd bach-codecommander-mcp
|
|
44
|
+
npm install
|
|
45
|
+
npm run build
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Configuration
|
|
51
|
+
|
|
52
|
+
### Claude Desktop
|
|
53
|
+
|
|
54
|
+
Add to your `claude_desktop_config.json`:
|
|
55
|
+
|
|
56
|
+
**Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
|
|
57
|
+
**macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
58
|
+
|
|
59
|
+
#### If installed globally via NPM:
|
|
60
|
+
|
|
61
|
+
```json
|
|
62
|
+
{
|
|
63
|
+
"mcpServers": {
|
|
64
|
+
"codecommander": {
|
|
65
|
+
"command": "bach-codecommander"
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
#### If installed from source:
|
|
72
|
+
|
|
73
|
+
```json
|
|
74
|
+
{
|
|
75
|
+
"mcpServers": {
|
|
76
|
+
"codecommander": {
|
|
77
|
+
"command": "node",
|
|
78
|
+
"args": ["/absolute/path/to/bach-codecommander-mcp/dist/index.js"]
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Using Both Servers Together
|
|
85
|
+
|
|
86
|
+
FileCommander and CodeCommander are designed to work side by side:
|
|
87
|
+
|
|
88
|
+
```json
|
|
89
|
+
{
|
|
90
|
+
"mcpServers": {
|
|
91
|
+
"filecommander": {
|
|
92
|
+
"command": "bach-filecommander"
|
|
93
|
+
},
|
|
94
|
+
"codecommander": {
|
|
95
|
+
"command": "bach-codecommander"
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
---
|
|
102
|
+
|
|
103
|
+
## Tools Overview
|
|
104
|
+
|
|
105
|
+
### Code Analysis (3 tools)
|
|
106
|
+
|
|
107
|
+
| Tool | Description |
|
|
108
|
+
|------|-------------|
|
|
109
|
+
| `cc_analyze_code` | Full code analysis: classes, functions, imports, LOC, complexity |
|
|
110
|
+
| `cc_analyze_methods` | Detailed method analysis: params, decorators, visibility, data flow |
|
|
111
|
+
| `cc_extract_classes` | Extract Python classes/functions as separate text blocks |
|
|
112
|
+
|
|
113
|
+
### Import Management (2 tools)
|
|
114
|
+
|
|
115
|
+
| Tool | Description |
|
|
116
|
+
|------|-------------|
|
|
117
|
+
| `cc_organize_imports` | Sort & deduplicate Python imports per PEP 8 |
|
|
118
|
+
| `cc_diagnose_imports` | Detect unused imports, duplicates, circular import risks |
|
|
119
|
+
|
|
120
|
+
### JSON Tools (2 tools)
|
|
121
|
+
|
|
122
|
+
| Tool | Description |
|
|
123
|
+
|------|-------------|
|
|
124
|
+
| `cc_fix_json` | Repair broken JSON (BOM, trailing commas, comments, single quotes) |
|
|
125
|
+
| `cc_validate_json` | Validate JSON with detailed error position and context |
|
|
126
|
+
|
|
127
|
+
### Encoding & Text (3 tools)
|
|
128
|
+
|
|
129
|
+
| Tool | Description |
|
|
130
|
+
|------|-------------|
|
|
131
|
+
| `cc_fix_encoding` | Fix Mojibake / double-encoded UTF-8 (27+ patterns) |
|
|
132
|
+
| `cc_cleanup_file` | Remove BOM, NUL bytes, trailing whitespace, normalize line endings |
|
|
133
|
+
| `cc_fix_umlauts` | Repair broken German umlauts (70+ patterns, HTML entities, escapes) |
|
|
134
|
+
|
|
135
|
+
### Scanning (1 tool)
|
|
136
|
+
|
|
137
|
+
| Tool | Description |
|
|
138
|
+
|------|-------------|
|
|
139
|
+
| `cc_scan_emoji` | Scan files for emojis with codepoint info |
|
|
140
|
+
|
|
141
|
+
### Format & Documentation (2 tools)
|
|
142
|
+
|
|
143
|
+
| Tool | Description |
|
|
144
|
+
|------|-------------|
|
|
145
|
+
| `cc_convert_format` | Convert between JSON, CSV, and INI formats |
|
|
146
|
+
| `cc_generate_licenses` | Generate third-party license file (npm/pip) |
|
|
147
|
+
|
|
148
|
+
### Export (1 tool)
|
|
149
|
+
|
|
150
|
+
| Tool | Description |
|
|
151
|
+
|------|-------------|
|
|
152
|
+
| `cc_md_to_pdf` | Convert Markdown to styled HTML (printable as PDF) |
|
|
153
|
+
|
|
154
|
+
**Total: 14 tools**
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## Shared Tools
|
|
159
|
+
|
|
160
|
+
5 tools exist in both FileCommander and CodeCommander for convenience:
|
|
161
|
+
|
|
162
|
+
| FileCommander | CodeCommander | Function |
|
|
163
|
+
|---------------|---------------|----------|
|
|
164
|
+
| `fc_fix_json` | `cc_fix_json` | JSON repair |
|
|
165
|
+
| `fc_validate_json` | `cc_validate_json` | JSON validation |
|
|
166
|
+
| `fc_fix_encoding` | `cc_fix_encoding` | Encoding repair |
|
|
167
|
+
| `fc_cleanup_file` | `cc_cleanup_file` | File cleanup |
|
|
168
|
+
| `fc_convert_format` | `cc_convert_format` | Format conversion |
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
## Tool Prefix
|
|
173
|
+
|
|
174
|
+
All tools use the `cc_` prefix (CodeCommander) to avoid conflicts with FileCommander's `fc_` prefix and other MCP servers.
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
## Security
|
|
179
|
+
|
|
180
|
+
See [SECURITY.md](SECURITY.md) for detailed security information.
|
|
181
|
+
|
|
182
|
+
Key points:
|
|
183
|
+
- All file-modifying tools support `dry_run` mode
|
|
184
|
+
- Backup creation is enabled by default for destructive operations
|
|
185
|
+
- No built-in sandboxing - security is delegated to the MCP client
|
|
186
|
+
- Designed for local development use via stdio transport
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
## Development
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
npm install
|
|
194
|
+
npm run dev # Watch mode
|
|
195
|
+
npm run build # One-time build
|
|
196
|
+
npm start # Start server
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
---
|
|
200
|
+
|
|
201
|
+
## Changelog
|
|
202
|
+
|
|
203
|
+
See [CHANGELOG.md](CHANGELOG.md) for the full version history.
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
## License
|
|
208
|
+
|
|
209
|
+
[MIT](LICENSE) - Lukas (BACH)
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Security Policy
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
BACH CodeCommander MCP Server is a developer tool that analyzes and modifies source code files. It operates with the running user's filesystem permissions.
|
|
6
|
+
|
|
7
|
+
## Risk Assessment
|
|
8
|
+
|
|
9
|
+
### Medium Risk Tools
|
|
10
|
+
| Tool | Risk | Description |
|
|
11
|
+
|------|------|-------------|
|
|
12
|
+
| `cc_organize_imports` | Modifies source files | Changes Python import order |
|
|
13
|
+
| `cc_fix_json` | Modifies files | Repairs JSON content |
|
|
14
|
+
| `cc_fix_encoding` | Modifies files | Changes file encoding |
|
|
15
|
+
| `cc_cleanup_file` | Modifies files | Removes whitespace/BOM/NUL |
|
|
16
|
+
| `cc_fix_umlauts` | Modifies files | Replaces character sequences |
|
|
17
|
+
| `cc_md_to_pdf` | Creates files | Generates PDF output |
|
|
18
|
+
|
|
19
|
+
### Low Risk Tools (Read-Only)
|
|
20
|
+
| Tool | Description |
|
|
21
|
+
|------|-------------|
|
|
22
|
+
| `cc_analyze_code` | Reads and analyzes code |
|
|
23
|
+
| `cc_analyze_methods` | Reads and analyzes methods |
|
|
24
|
+
| `cc_extract_classes` | Reads and extracts class info |
|
|
25
|
+
| `cc_diagnose_imports` | Reads and diagnoses imports |
|
|
26
|
+
| `cc_validate_json` | Reads and validates JSON |
|
|
27
|
+
| `cc_scan_emoji` | Reads and scans for emojis |
|
|
28
|
+
| `cc_generate_licenses` | Reads installed packages |
|
|
29
|
+
| `cc_convert_format` | Reads input, writes output |
|
|
30
|
+
|
|
31
|
+
## Recommendations
|
|
32
|
+
|
|
33
|
+
- All file-modifying tools support `dry_run` and/or `create_backup` options
|
|
34
|
+
- Use `dry_run=true` to preview changes before applying
|
|
35
|
+
- Review changes before deploying to production
|
|
36
|
+
- This server is designed for local development use via stdio transport
|
|
37
|
+
|
|
38
|
+
## Reporting
|
|
39
|
+
|
|
40
|
+
Report security issues at https://github.com/lukisch/bach-codecommander-mcp/issues
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* BACH CodeCommander MCP Server
|
|
4
|
+
*
|
|
5
|
+
* A developer-focused MCP server for code analysis, JSON repair,
|
|
6
|
+
* encoding fix, import organization, and format conversion.
|
|
7
|
+
*
|
|
8
|
+
* Copyright (c) 2025-2026 Lukas (BACH). Licensed under MIT License.
|
|
9
|
+
* See LICENSE file for details.
|
|
10
|
+
*
|
|
11
|
+
* @author Lukas (BACH)
|
|
12
|
+
* @version 1.0.0
|
|
13
|
+
* @license MIT
|
|
14
|
+
*/
|
|
15
|
+
export {};
|
|
16
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;;;;;;GAYG"}
|