CommandCode
БесплатноНе проверенCodebase intelligence integration for Command Code via MCP.
Описание
Codebase intelligence integration for Command Code via MCP.
README
MCP server that brings Command Code's codebase intelligence into Claude Desktop, VS Code, Cursor, and any MCP-compatible AI tool.
6 tools. One chat window. No terminal copy-paste. Your AI assistant can now query your codebase, continue coding sessions, learn your style, and check system status — all inline.
What is Command Code?
Command Code is a coding agent that learns your codebase and adapts to your coding style. It answers questions about architecture, generates code suggestions that match your conventions, and maintains persistent conversation threads across sessions.
Without MCP: you type commandcode -p "explain this function" in a terminal, read the output, copy it back into chat.
With CommandCode MCP: you say "explain this function" in chat, and your AI calls commandcode_query for you. Answer appears inline. Same chat.
Tools
| Tool | What it does | CLI equivalent |
|---|---|---|
commandcode_query |
Ask a one-shot question about code | commandcode -p "query" |
commandcode_continue |
Continue the last conversation | commandcode -c -p "query" |
commandcode_resume |
Resume a named session or pick from history | commandcode --resume [name] |
commandcode_taste_learn |
Learn coding style from a repo | commandcode taste learn <source> |
commandcode_taste |
List/manage taste packages | commandcode taste list |
commandcode_info |
Show version, environment, config | commandcode info + commandcode status |
Installation
Prerequisites
- Node.js ≥ 18
- Command Code installed (
npm install -g command-code)
Install
Recommended (all OSes): npx
Don't install the MCP server globally — let your agent invoke it through npx:
npx -y commandcode-mcp
Why this is the best practice:
- No global install permissions (no
sudo, no Windows ACL issues). - Always the latest patch —
-yauto-accepts the prompt; npm caches the package so subsequent launches are fast. - Same command on macOS, Linux, and Windows — every MCP config below uses
npx -y commandcode-mcp. - Survives Node version managers (nvm, fnm, volta) — no stale shim pointing at a deleted Node version.
Alternative: global install
npm install -g commandcode-mcp
Use this if you want to invoke the binary by name (e.g. commandcode-mcp instead of npx -y commandcode-mcp). Be aware that on Windows this creates a .cmd shim — see the Windows notes below.
Sanity check
This should print the version banner to stderr and then wait for MCP traffic on stdin. The "hang" is expected — that's the stdio transport waiting for a client. Hit Ctrl+C to exit.
npx -y commandcode-mcp
# → commandcode-mcp v2.0.3 running on stdio
If you see a warning that the Command Code CLI is not found, either install it:
npm install -g command-code
…or point the MCP server at an existing binary:
# macOS / Linux
export COMMANDCODE_PATH=/usr/local/bin/commandcode
# Windows (PowerShell)
$env:COMMANDCODE_PATH = "C:\Tools\commandcode\dist\index.mjs"
Tip: On Windows, prefer pointing
COMMANDCODE_PATHat thedist/index.mjsscript rather than the.cmdshim. The resolver handles either, but the.mjsroute bypasses an extracmd.exehop.
Configuration
Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"commandcode": {
"command": "npx",
"args": ["-y", "commandcode-mcp"]
}
}
}
Or if installed globally:
{
"mcpServers": {
"commandcode": {
"command": "commandcode-mcp"
}
}
}
Claude Code (CLI)
macOS / Linux — one-liner, no JSON editing:
claude mcp add commandcode --transport stdio -- npx -y commandcode-mcp
Windows — use cmd /c to wrap npx:
claude mcp add commandcode --transport stdio -- cmd /c npx -y commandcode-mcp
Why
cmd /con Windows is required. On Windows,npxis a.cmdshim. Claude Code spawns stdio servers withshell: false, and Node ≥ 21 (CVE-2024-27980) refuses to launch.cmd/.batfiles in that mode. Withoutcmd /cyou'll seeMCP server "commandcode" Connection closedimmediately afterclaude mcp add. Wrapping throughcmd /cmakescmd.exeitself the spawned executable, which then resolves the.cmdshim correctly.
Scope the server to one project (writes .mcp.json in the project root) or to all projects:
# macOS / Linux
claude mcp add --scope project commandcode --transport stdio -- npx -y commandcode-mcp
claude mcp add --scope user commandcode --transport stdio -- npx -y commandcode-mcp
# Windows
claude mcp add --scope project commandcode --transport stdio -- cmd /c npx -y commandcode-mcp
claude mcp add --scope user commandcode --transport stdio -- cmd /c npx -y commandcode-mcp
With an explicit COMMANDCODE_PATH:
# macOS / Linux
claude mcp add commandcode --transport stdio \
--env COMMANDCODE_PATH=/usr/local/bin/commandcode \
-- npx -y commandcode-mcp
# Windows
claude mcp add commandcode --transport stdio `
--env COMMANDCODE_PATH=C:\Tools\commandcode\dist\index.mjs `
-- cmd /c npx -y commandcode-mcp
Verify: claude mcp list should show commandcode as connected. Inside a session, /mcp displays live server status.
VS Code / Cursor
Add to your MCP configuration (.vscode/mcp.json for VS Code, or Cursor's MCP settings):
{
"mcpServers": {
"commandcode": {
"command": "npx",
"args": ["-y", "commandcode-mcp"]
}
}
}
OpenCode
Edit opencode.json in your project root (or ~/.config/opencode/opencode.json globally) and add the server under the mcp key. OpenCode uses a command array (no separate args):
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"commandcode": {
"type": "local",
"command": ["npx", "-y", "commandcode-mcp"],
"enabled": true
}
}
}
JetBrains Junie
Open Settings → Tools → Junie → MCP Settings and click the edit icon, or directly edit ~/.junie/mcp.json (global) or .junie/mcp/mcp.json in the project root. The schema matches Claude Desktop's:
{
"mcpServers": {
"commandcode": {
"command": "npx",
"args": ["-y", "commandcode-mcp"]
}
}
}
Cline
VS Code extension: open the Cline MCP panel and add the server via its UI, or edit the settings file VS Code points to.
Cline CLI / JetBrains: edit ~/.cline/data/settings/cline_mcp_settings.json (create it if missing):
{
"mcpServers": {
"commandcode": {
"command": "npx",
"args": ["-y", "commandcode-mcp"]
}
}
}
Kilo Code
Kilo Code (v7.0.33+) uses a single config file at ~/.config/kilo/kilo.jsonc (global) or .kilo/kilo.jsonc in the project root. MCP servers go under the mcp key with a command array and environment (not env):
{
"mcp": {
"commandcode": {
"type": "local",
"command": ["npx", "-y", "commandcode-mcp"],
"environment": {},
"enabled": true,
"timeout": 10000
}
}
}
You can also use the interactive kilo mcp add prompt to write this entry for you.
Kiro CLI
Edit ~/.kiro/settings/mcp.json (global) or .kiro/settings/mcp.json in the workspace:
{
"mcpServers": {
"commandcode": {
"command": "npx",
"args": ["-y", "commandcode-mcp"],
"disabled": false,
"autoApprove": []
}
}
}
Custom CommandCode path
If CommandCode is installed in a non-standard location:
{
"mcpServers": {
"commandcode": {
"command": "npx",
"args": ["-y", "commandcode-mcp"],
"env": {
"COMMANDCODE_PATH": "/home/user/bin/commandcode"
}
}
}
}
OS-specific notes
The MCP server itself is OS-agnostic. The friction is in how each agent spawns it.
Windows
- Most agents (Claude Desktop, VS Code, Cursor, OpenCode, Junie, Cline, Kilo Code, Kiro CLI) accept
"command": "npx"directly — they handle the.cmdshim internally and you do not needcmd /c. - Claude Code (CLI) is the exception: prepend
cmd /cto the spawn command (see Claude Code above). This is a Node ≥ 21 +shell: falseconstraint, not a bug incommandcode-mcp. - If you set
COMMANDCODE_PATH, prefer the absolute path to thedist/index.mjsfile. The resolver also accepts a.cmdshim and will transparently wrap it throughcmd.exe, but pointing at the.mjsskips that hop. npxlives at%APPDATA%\npm\npx.cmdfor a defaultnpm install -gsetup. Node version managers (volta, fnm, nvm-windows) may put it elsewhere — the resolver's PATH walk handles either case.
macOS
- If you installed Node via Homebrew on Apple Silicon, the global npm prefix is
/opt/homebrew/lib/node_modules. The resolver probes this location automatically. - Quote any path containing spaces (e.g.
/Users/<you>/Library/Application Support/...) when settingCOMMANDCODE_PATH.
Linux
- Both
/usr/local/lib/node_modules(Node downloaded from nodejs.org) and~/.npm-global/lib/node_modules(when you've reconfigurednpm config set prefix) are probed automatically — noCOMMANDCODE_PATHneeded for the common cases. - On NixOS or other immutable distros where
/usr/localdoesn't exist, setCOMMANDCODE_PATHexplicitly.
All OSes
- The server prints
commandcode-mcp vX.Y.Z running on stdioto stderr (not stdout — stdout is reserved for MCP JSON-RPC traffic). Agents that surface stderr will display this banner; that's normal, not an error. - After the banner, the process appears to "hang" — it's actually awaiting MCP messages on stdin. Don't kill it from your agent's diagnostics; that's the protocol working as intended.
Usage Examples
Analyze your codebase
"What does the authentication middleware do and how is it wired to Express?"
The AI calls commandcode_query with your query. Command Code analyzes your codebase. Answer appears in chat.
Continue where you left off
"Continue my last session — refactor the user service to use the new caching layer"
The AI calls commandcode_continue. Command Code picks up the previous session's context. Multi-turn conversations across restarts.
Resume a named session
"Resume the 'pr-review' session"
The AI calls commandcode_resume with session_name: "pr-review". Your PR review thread comes back with full context.
Teach Command Code your style
"Learn coding style from the python/black repository"
The AI calls commandcode_taste_learn with source: "psf/black". Future code suggestions match Black's conventions.
Security
- Input validation: All tool inputs are validated for type, length, and dangerous characters (path traversal, shell injection)
- No shell interpolation: Arguments are passed directly to
spawn(), not through shell strings - Concurrency guard:
commandcode_continuecalls are serialized to prevent session corruption - CWD fallback: If a requested working directory doesn't exist, the server falls back to
process.cwd()instead of failing - Startup check: Server warns if CommandCode CLI is unreachable at startup, but doesn't crash
Development
git clone https://github.com/IMRAN104/commandcode-mcp.git
cd commandcode-mcp
npm install
npm run dev
Build
npm run build
Output goes to build/index.js.
Publishing
npm version patch # or minor / major
npm publish --otp=<code>
Contributing
See CONTRIBUTING.md for guidelines on reporting bugs, suggesting features, and submitting pull requests.
License
ISC © Imran
See LICENSE for details.
Установка CommandCode
У этого сервера нет опубликованного пакета — он собирается из исходников. Открой репозиторий и следуй инструкции в README.
▸ github.com/imran104/commandcode-mcpFAQ
CommandCode MCP бесплатный?
Да, CommandCode MCP бесплатный — установка в пару кликов через Unyly без оплаты.
Нужен ли API-ключ для CommandCode?
Нет, CommandCode работает без API-ключей и переменных окружения.
CommandCode — hosted или self-hosted?
Self-hosted: сервер запускается локально на твоей машине командой из раздела установки.
Как установить CommandCode в Claude Desktop, Claude Code или Cursor?
Открой CommandCode на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.
Похожие MCP
GitHub
PRs, issues, code search, CI status
автор: GitHubFilesystem
Secure file operations with configurable access controls.
Memory
Knowledge graph-based persistent memory system.
Template MCP Server
A CLI tool to create a new Model Context Protocol server project with TypeScript support, dual transport options, and an extensible structure
автор: mcpdotdirectCompare CommandCode with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории development
