mcp-wrap
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-wrap
Wrap any command-line tool as an MCP (Model Context Protocol) server — offline, zero dependencies.
You have scripts and CLI tools that already do useful work. AI clients like Claude Desktop or Cursor can only call them if they speak MCP. mcp-wrap is the bridge: declare your tools in one JSON file, and mcp-wrap serves them over stdio as JSON-RPC 2.0 — no SDK, no build step, no network, nothing to install beyond Node.js.
Install
Requires Node.js ≥ 18. No dependencies.
# from a clone of this repository
npm install -g . # or: npm link
# or run it in place
node src/cli.js --helpRelated MCP server: cli2mcp
Quick start
mcp-wrap init # writes mcp-wrap.config.json (a sample)
mcp-wrap check mcp-wrap.config.json
mcp-wrap serve mcp-wrap.config.jsonserve speaks MCP on stdin/stdout, so it is normally launched by an MCP client, not run by hand.
Config format
{
"name": "my-tools",
"version": "1.0.0",
"timeoutMs": 30000,
"maxOutputBytes": 65536,
"tools": [
{
"name": "echo",
"description": "Echo the given text back, unchanged.",
"command": "echo",
"args": ["{text}"],
"arguments": {
"text": { "type": "string", "required": true, "description": "Text to echo" }
}
},
{
"name": "disk-usage",
"description": "Show disk usage for a path.",
"command": "df",
"args": ["-h", "{path}"],
"timeoutMs": 5000,
"arguments": {
"path": { "type": "string", "required": false, "default": "." }
}
}
]
}name/version— reported to clients as the server identity.timeoutMs— default per-call timeout (30 s). A tool may override it with its owntimeoutMs.maxOutputBytes— per-call output cap for stdout and stderr (64 KiB default). Output past the cap is truncated and the call is reported as an error.Each tool has a
name, adescription, acommand, and anargstemplate array.{name}placeholders inargsare replaced with the string form of the matching call argument.argumentsdeclares each argument'stype(string,number, orboolean), whether it isrequired, an optionaldescription, and an optionaldefault. mcp-wrap generates the tool'sinputSchemafrom this declaration, validates every call against it, and rejects undeclared placeholders at load time.
Safety model
Commands are spawned with an argv array and no shell (shell: false). Argument values reach the operating system as single argv entries, so values containing ;, $(), backticks or pipes are inert data — they cannot inject extra commands. Combined with the timeout and output caps, a wrapped tool cannot hang the client or flood it.
Connect it to Claude Desktop
Add the server to your claude_desktop_config.json:
{
"mcpServers": {
"my-tools": {
"command": "node",
"args": ["/path/to/mcp-wrap/src/cli.js", "serve", "/path/to/mcp-wrap.config.json"]
}
}
}Restart the client; the declared tools appear alongside the built-in ones. The same command/args shape works for Cursor and other stdio MCP clients.
Commands
Command | What it does |
| Run the MCP server on stdio until stdin closes |
| Write a sample config (default |
| Validate a config and list the tools it will expose (no server started) |
Protocol coverage
Implements the core MCP method set over the stdio transport (newline-delimited JSON-RPC 2.0): initialize (echoes the client's requested protocol version), notifications/initialized (accepted silently), ping, tools/list, and tools/call. Results use the standard MCP content: [{ "type": "text", ... }] shape with isError for failed commands. Malformed requests get proper JSON-RPC errors: -32700 parse error, -32600 invalid request, -32601 method not found, -32602 invalid params (including unknown tools and missing/mistyped arguments).
Limitations
Honest list — mcp-wrap is deliberately small:
stdio transport only. No HTTP, SSE, or WebSocket transport, so it cannot serve remote or multi-client setups.
Argument schemas are a simple subset of JSON Schema: flat objects with
string/number/booleanproperties,required,description, anddefault. No nested objects, arrays, enums, or string formats.Placeholders are substituted into argument strings only — a tool's
commanditself is fixed by the config, by design.No support yet for MCP resources, prompts, sampling, roots, progress notifications, or cancellation of an in-flight call (a call still ends at its timeout).
Tool output is returned as a single text block; binary output is decoded as UTF-8 text.
Development
npm test # node --test: config validation, CLI, and live protocol tests over stdioLicense
MIT — see LICENSE.
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
MCP server for progressive tool usage at any scale (see https://klavis.ai)
Guard wraps stdio MCP servers: risky calls wait for a person; no answer, no run. Remote: cooperative
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
MCP server for Superserve sandboxes: create, exec, and manage Firecracker microVMs
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceTurns any CLI command into an MCP server via a declarative YAML config, enabling safe, typed tool execution with no shell injection.MIT
- AlicenseNot gradedqualityCmaintenanceEnables turning any command-line tool into an MCP server with auto-generated JSON schema, supporting stdio, timeouts, and stderr capture.MIT
- FlicenseAqualityDmaintenanceEnables exposing custom tools such as dice rolling and integer addition as MCP servers over stdio and HTTP transports.2-
- AlicenseNot gradedqualityCmaintenanceEnables developers to expose any dev tool as a safe, audited MCP server with permission tiers, audit logging, and automatic argument validation.MIT