Source: ViewEdit

MCP and the command line

The Model Context Protocol (MCP) is a phone line between an editor and a program that stays running. A skill or an AGENTS.md note is a recipe card: it tells the agent which command to run. Those are different tools, and most command-line programs only need the card.

This page is about that editor protocol. WebMCP (document.modelContext) is a separate idea: tools a web page offers to an agent in the browser.

The recipe card

A skill, a rule, or a paragraph in the project notes says what to run. The agent installs the program if it is missing, runs the command, reads the result, and the program exits.

printf '%s' "$NEW" | envsafe set API_KEY --stdin

That command edits one file and ends. The safety rule lives in the program: the value arrives on a pipe or from another environment variable, and the program refuses a value typed on the command line. The agent can still ignore the card and run a worse command. The card is a request.

The phone line

An MCP server is a process the editor starts and leaves open. The editor writes a JSON message to the process’s standard input. The process does the work and writes a JSON reply. The process waits for the next message until the editor closes the pipe.

A typical entry looks like this:

{
  "mcpServers": {
    "envsafe": { "command": "envsafe", "args": ["mcp"] }
  }
}

envsafe mcp is the same editor as the command above, behind four named buttons. The button arguments have no slot for the secret, so the model cannot type the secret into the tool call. That is the reason to add the phone line: the host only has buttons, or the schema must make a dangerous argument impossible.

Each client has its own pipe. One shared process cannot read several clients' standard inputs. A host that opens a workspace for every repository it knows, and that loads the same MCP entry in each workspace, starts one server process per workspace. Those processes sit idle. They are the protocol working as specified, multiplied by the host.

Which door to use

Use the recipe card when the job is one command and the program already exits. Write the command in a skill or in the project’s agent notes. The agent runs it when the work needs it.

Use the phone line when at least one of these is true:

  • The host can press named tools and cannot run a shell.

  • A value must never appear in the tool arguments the model can see, and the schema can omit that slot.

  • The program is already a session: a database, a browser, a device, a long-running engine.

Put that entry in the project’s MCP config. A user-wide config starts the server in every workspace. Reserve the user-wide list for a server you want everywhere, such as a documentation lookup you call from any repo. A one-shot file editor does not belong there.

The local config does not travel to other people by itself. Project MCP files that you commit do. Commit one only when that project is the place the buttons are needed.

What stays expensive

A stdio server is a console program. On Windows, a host that forgets to hide the console opens a terminal titled with the program path. The window stays blank because the server prints nothing until a client sends a message. Closing the window kills that one server. The others, started with their input on a pipe, keep running with no window.

Stopping the processes is safe. The next workspace that loads the config starts another one. Removing the config entry is what stops the fan-out.