ncp (short for No Context Pollution) is a minimal, spec-compliant Model Context Protocol (MCP)
client for the command line, on macOS and Linux.
Experimental, need more humans that tells me what doesn't work.
ncp passes the official conformance test for the latest and previous spec version,
excluding the optional extension (because I don't use those).
See MCP feature support section below for details.
My regular uses are for remote HTTP MCP + HTTPS proxy + MCP text only tool, which is pretty smooth so far.
Almost all of the code is generated by an LLM. Beware of bugs in it; I have only tried it, not proved it correct. For some human-facing section like this one, it's still written by hand. Proof of my humanhood available upon request.
MCP tools fill the LLM context, lazy loading and Code Mode is uneven across harnesses, and
each harness needs its own MCP registration and login. ncp puts MCP behind
the shell tool that agents already have.
The long version
The primary driver was frustration.
LLM context window has increased a lot in the past few years. But, most of the time I see people caring less about what stays in the context. This is Jevons paradox in play.
Anthropic already covered this problem on November 2025. That's ages ago in AI era.
One year later after that post, the implementation of lazy MCP load using tool search are still mixed. Anthropic and some inference providers support it via beta request headers. Some harness provide this with client side search. On organization managed inference provider, sometimes these "beta" headers are deemed risky and disabled.
There's also the fact that every harness is its own MCP client. This means registering and even reauthenticating for every combination of MCP and harness you use.
In the earlier Anthropic link, it also describes "Programmatic Tool Calling". This depends on inference provider supporting it, and doesn't even support tools provided by MCP. Again, some harness supports this client side as Code Mode, e.g. OpenCode. Code Mode idea itself is even older and has been posted by Cloudflare on September 2025.
So, why not make use of existing programmatic tool environment, Bash/shell tool? This also aligns with recent trend of LLM being directed to use generic shell commands instead of harness specific tool. You might have seen this already, e.g. Claude model uses grep+sed or Python instead of built in File edit tool.
MCP as CLI is not new. There are already several implementations. Respectfully, I disagree on those implementations because of their implementation choices. e.g. requiring Python or Bun runtime, or pulling a KV for logs on use.
All that leads to starting something based on my preference:
- standalone binary,
- Unix philosophy, do one thing well,
- secure by default.
ncphas no daemon, so each command starts a new session. A stdio server stops after each command and loses its state.
With mise:
mise use -g github:darcien/ncp
Or download the archive for your platform from
Releases, and put ncp on your
PATH.
git clone https://github.com/darcien/ncp
cd ncp
cargo install --locked --path crates/ncp
Add an MCP server, then call its tools:
ncp server add <server-name> -- <server-command> [<arg>...] # stdio server
ncp server add <server-name> <server-url> # HTTP server
ncp tool list <server-name>
ncp tool show <server-name> <tool-name>
ncp tool call <server-name> <tool-name> [<key>=<value>...]Replace each part in < > and its brackets:
<server-name>: a name that you choose. Use letters, digits,-and_.<server-url>: thehttpsURL of the server.httpworks only for a loopback host.<server-command>and<arg>: the command that starts the stdio server, and its arguments.<tool-name>: a name fromncp tool list.<key>=<value>: an argument fromncp tool show.
A part in [ ] is optional, and ... means that you can repeat it.
ncp server add adds the server to the project file .mcp.json. To use a
server in all directories, add --global. This adds it to the global file
~/.config/ncp/mcp.json.
The commands that use a server read both files. When both files have the same
server name, ncp uses the entry of the project file.
ncp runs the servers of a project file only after you trust the file.
ncp server add trusts a file that it makes. To trust another file, or a file
that changed, run ncp trust.
If an HTTP server needs a login, run ncp auth login <server-name>.
Example using a public server:
ncp server add --global cloudflare-docs https://docs.mcp.cloudflare.com/mcp
ncp tool list cloudflare-docs
ncp tool show cloudflare-docs search_cloudflare_documentation
ncp tool call cloudflare-docs search_cloudflare_documentation query="Workers KV"You can also join the server name and the tool name with ., : or /:
ncp tool call cloudflare-docs.search_cloudflare_documentation query="Workers KV"Example for scripts:
# With -, ncp reads the arguments from stdin, as one JSON object
ncp tool call cloudflare-docs search_cloudflare_documentation - <<'EOF'
{"query": "Workers KV"}
EOF
# With JSON output, stdout has the MCP result. Get each URL from it
ncp --output-format json tool call cloudflare-docs search_cloudflare_documentation query="Workers KV" \
| jq -r '.structuredContent.results[].url' | sort -uncp writes results to stdout and messages to stderr.
In a pipeline, the shell gives the exit code of the last program. In the second
example, this is sort, so the pipeline gives 0 when ncp fails. In bash or
zsh, to make the pipeline fail when ncp fails, run set -o pipefail first.
For all commands and options, run ncp --help, or add --help to a command.
A secret has a name and a value. The command has only the name. ncp asks for
the value, or reads it from a pipe, and stores it in the macOS Keychain or the
Linux Secret Service.
# HTTP server
ncp server add <server-name> <server-url> \
--header 'Authorization: Bearer ${API_KEY}' --secret API_KEY
# stdio server
ncp server add <server-name> --env 'SERVER_VAR=${API_KEY}' --secret API_KEY \
-- <server-command> [<arg>...]API_KEY: the name of the secret. Choose a name. Use letters, digits and_, and do not start with a digit.${API_KEY}: a template, not the value. The server entry keeps this text. Each timencpuses the server, it replaces the template with the value. The single quotes stop the shell from replacing it.SERVER_VAR: the environment variable that the stdio server reads. Find the name in the documentation of the server.
ncp sends a value that you store for an HTTP server only to the origin of
<server-url>. A value that you store for a stdio server goes only to stdio
servers.
To get the value of ${API_KEY}, ncp uses the first of these that exists:
- The variable
API_KEYin the environment ofncp, also when it is empty. - The macOS Keychain or the Linux Secret Service.
- The credential file, if you stored the value with
--credential-store file.
Target MCP spec versions:
2026-07-282025-11-25
See the conformance results.
| Area | Supported | Not supported |
|---|---|---|
| Transports | stdio, Streamable HTTP | HTTP+SSE (2024-11-05) |
| Authorization (HTTP) | OAuth with pre-registration, Client ID Metadata Documents, or Dynamic Client Registration | OAuth Client Credentials (client_credentials grant), Enterprise-Managed Authorization, DPoP proposal, Workload Identity Federation proposal |
| Server features | Tools, Resources (list, templates, read), Prompts | — |
| Server utilities | — | Completion, Logging |
| Client features | Elicitation (form and URL modes, with a TTY) | Sampling, Roots |
| Other features | Progress | Tasks, Subscriptions (resource updates and list changes) |
See CONTRIBUTING.md.
- Thanks
uvfor making Python development saner, showing what good DX should look like, and a heavy reference on the networking stack. - Thanks
misefor reducing the amount tool juggling I had to do and being a reference on the project trust model, esp. the paranoid mode. - Thanks Rust, all the open source dependencies, and FOSS as a whole that makes this possible in the first place.
TBA.
Use skill for now, create one with skill creator for the MCP server you want to use. Some harness supports registering custom tool, but skill is more universal.
Generally I write a skill for each MCP on my common usage with that server,
and tell agents to figure out uncommon use case by using ncp subcommands
just like other niche CLI tool.
MIT or Apache-2.0, at your choice.