Vivek Haldar

MCP Knife: A CLI Swiss Army Knife for MCP Servers

This single command-line pipeline takes an API, stands up an MCP server for it, reshapes its tools, and generates a full interactive UI — with zero hand-written code:

mcpknife boot --prompt "Free Dictionary API https://dictionaryapi.dev/" \
  | mcpknife mod --prompt "Create one tool: given a word, return synonyms and antonyms" \
  | mcpknife ui

Three stages, composed with Unix pipes. The first reads API docs and generates an MCP server. The second transforms its tools with a natural language prompt. The third generates an interactive web UI. The output is a running MCP app you can use in ChatGPT or any MCP host — built entirely from the command line.

MCP Knife is open source (Apache 2.0) and available on npm. If you want to understand how each piece works and what’s happening under the hood, keep reading.

Three Subcommands, One Pipeline

MCP Knife has three subcommands, each handling one stage of the journey:

mcpknife boot

Given a natural language prompt and some API documentation, boot stands up an entirely new MCP server. Under the hood, this uses MCP Boot, which works in two phases: at startup, an LLM reads your prompt and API docs, plans which tools to create, and generates JavaScript handler functions for each one. At runtime, those cached handlers execute in a sandboxed Node.js VM — no further LLM calls, no per-invocation costs.

For example:

mcpknife boot --prompt "Free Dictionary API https://dictionaryapi.dev/"

That’s it. You now have a running MCP server wrapping the dictionary API.

mcpknife mod

The server from boot might expose more tools than you need, or you might want to reshape them. The mod subcommand transforms tools on an existing MCP server using natural language. It’s built on MCP Blox, which acts as a programmable proxy — it intercepts tool definitions, uses an LLM to generate transformation code, and runs that code in a sandbox.

You can rename tools, hide ones you don’t want, reformat outputs, or compose multiple upstream tools into a single new synthetic tool. All with a prompt:

mcpknife mod --prompt "Create one tool: given a word, return its synonyms and antonyms"

mcpknife ui

Finally, ui auto-generates an interactive web interface for your MCP server. This is powered by MCP Generative UI, a proxy layer that discovers your server’s tools and uses an LLM to create self-contained HTML interfaces for each one. It supports both the MCP Apps standard and the OpenAI Apps SDK (for ChatGPT integration).

mcpknife ui

No prompt needed — the default UI is usually good enough. But if you want to customize, you can pass a styling prompt, or use the built-in _ui_refine tool to iteratively improve the generated UI with natural language feedback.

Composability

You can compose the above invocations using good old Unix pipes. Each stage reads an upstream server URL from stdin and outputs its own URL to stdout. MCP Knife itself is a lightweight process multiplexer, not a monolith. The OS kernel handles the pipes, signal propagation (Ctrl+C, exit codes) flows cleanly through the chain, and each stage is independently replaceable.

A typical pipeline will start with boot, have a few mods in the middle, and end with ui.

You can also use each subcommand standalone. Want to add a UI to an existing MCP server? Just run mcpknife ui --upstream "npx some-mcp-server". Want to reshape tools without changing anything else? Pipe into mcpknife mod. The pieces work together or apart.

Live Example: Dictionary Synonyms App

In the full demo video below, I walk through this exact pipeline with the Free Dictionary API. The three-stage pipeline produces an MCP app that takes a word and displays its synonyms and antonyms in a clean, generated UI — no hand-coded frontend.

And if the UI isn’t quite right? You can refine it. The _ui_refine tool accepts natural language feedback like “show synonyms and antonyms in two columns side by side” and regenerates the interface. You keep iterating until you’re satisfied.

Configuration

All the LLM-powered stages need an API key and model specification. Rather than passing these on every command, you can create a ~/.mcpkniferc config file:

{
  "provider": "anthropic",
  "model": "claude-sonnet-4-20250514",
  "apiKey": "sk-ant-..."
}

CLI flags override config, and project-level .mcpkniferc files override the global one.

Installation

npm install -g mcpknife

Requires Node.js 18+. The repo is open source under the Apache 2.0 license.

Underlying tools

MCP Knife is the culmination of three separate tools I built over the past few weeks:

Each of these works standalone, but MCP Knife makes them composable in a way that feels natural on the command line. I’d love to hear your feedback — try it out, let me know what you build, and open issues on the GitHub repo if you run into anything.