mcp-forge
Wraps the local docker CLI as typed MCP tools by parsing docker --help, exposing subcommands and flags for safe command execution over stdio with policy checks and output truncation.
Wraps the local git CLI as typed MCP tools by parsing git --help, exposing subcommands and flags for safe command execution over stdio with policy checks and output truncation.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
mcp-forge
Wrap local CLI binaries (git, rg, docker, kubectl, internal scripts) as MCP tools over stdio without writing schema boilerplate or giving an agent raw shell access.
The problem
If you want an MCP client (Claude Desktop, Cursor, etc.) to use a local CLI tool, you usually end up doing one of two things:
Hand-writing JSON Schema wrappers for every flag and subcommand.
Giving the model a raw
bashtool and hoping it doesn't rungit reset --hard, read~/.ssh/id_rsa, or dump 40,000 lines of log output into the context window.
mcp-forge parses <binary> --help on startup, exposes a typed MCP tool over stdio, runs commands through execFile (no shell interpolation), blocks risky flags/paths, and trims oversized output before returning it to the client.
Related MCP server: fde-assessment
Usage
1. Run as an MCP stdio server
Add to claude_desktop_config.json or .cursor/mcp.json:
{
"mcpServers": {
"local-cli": {
"command": "npx",
"args": ["-y", "mcp-forge-compiler", "serve", "git", "rg", "docker", "kubectl"]
}
}
}2. Inspect generated JSON Schema
$ npx mcp-forge-compiler compile rg git3. Check how a command is evaluated by the policy rules
$ npx mcp-forge-compiler audit git reset --hardHow it works
src/parser.ts— Runs<binary> --helpand extracts subcommands, short/long flags, types (boolean,number,string,array),enumchoices, and default values. Supports GNU, POSIX, Rustclap, Gocobra, and Pythonargparseoutput formats.src/firewall.ts— Checksargvbefore spawning the process:FW001: Blocks destructive binaries (rm,dd,mkfs,shred, etc.)FW002: Rejects shell metacharacters (;,|,&,`,$())FW003: Blocks destructive flags (--force,--hard,--delete,-rf)FW005: Blocks reads/writes to sensitive paths (/etc/shadow,.ssh/id_rsa,.env)FW006: Enforces workspace path boundaries when--workspaceis set
src/truncator.ts— Keeps stdout/stderr within a token budget (--max-tokens, default1500). Keeps the header/top lines and bottom summary lines, pulls outERROR/FATALlines from the omitted middle section, and masks common credential patterns (sk-proj-*,ghp_*,AKIA*).src/server.ts— Newline-delimited JSON-RPC 2.0 server overstdin/stdoutimplementinginitialize,tools/list,tools/call, andping.
Library API
import {
parseCliHelp,
compileToMcpTools,
auditCommandExecution,
truncateCliOutput
} from 'mcp-forge-compiler';
const spec = parseCliHelp('rg', helpOutput);
const [tool] = compileToMcpTools(spec);
const audit = auditCommandExecution('rg', ['--ignore-case', 'TODO', 'src/'], {
allowedWorkingDir: '/workspace/app'
});
const out = truncateCliOutput(rawStdout, {
maxTokens: 1200,
preserveDiagnosticLines: true,
scrubSecrets: true
});Development
npm run build
npm test
npm run demoLicense
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Generate a typed SDK, CLI, and MCP server from any OpenAPI or GraphQL spec, and keep them current.
Statically audits MCP tool surfaces for token cost, schema quality, and design issues.
Capability-routed CLI/MCP: signed provenance exports, WCAG-validated themes, sovereign deploy modes.
Convert, lint and generate LLM tool schemas for OpenAI, Anthropic, Gemini and MCP
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceEnables turning any command-line tool into an MCP server with auto-generated JSON schema, supporting stdio, timeouts, and stderr capture.MIT
- FlicenseNot gradedqualityCmaintenanceEnables MCP tool calls with strict schema validation and stdio isolation, while providing a security gateway for tool-level authorization, streaming PII redaction, and model failover routing.-
- FlicenseNot gradedqualityCmaintenanceEnables secure discovery and invocation of sandboxed filesystem, repository inspection, and utility tools through a unified MCP client with schema validation, timeouts, and execution traces.-
- AlicenseNot gradedqualityBmaintenanceEnables developers to expose a single set of tool definitions as MCP server tools over stdio or Streamable HTTP, so Claude Code, Codex, Claude Desktop and Cursor can call them with risk-based annotations, human-approved irreversible writes, typed structured results and long-running job handling built in. It also ships the same tools as a CLI from one source, keeping both surfaces in parity.594 npmApache 2.0