ncode

CLI docs MCP servers

ncode CLI Features

MCP servers

MCP servers#

MCP (Model Context Protocol) servers add their tools to the agents. ncode supports two transports:

TransportWhat you give it
stdio (a local process)a command, its arguments, and environment variables (KEY=VALUE)
http (streamable HTTP)a URL and request headers (Name: value)

A server is either global (every project) or scoped to one project. It can be switched off without deleting it, and each of its tools has its own switch: a tool you turn off is not offered to any agent. The environment variables and headers you enter are stored like your other keys.

A tool the server marks as read-only is treated like a read and never asks. Every other MCP tool is treated like a shell command: blocked in Read-only, asked about in Auto, allowed in Full access.

Adding a server in Settings#

Open Settings (F2) at MCP servers. There you can:

  • add a stdio server (a command, its arguments and KEY=VALUE environment variables) or an HTTP server (a URL and Name: value headers);
  • import the servers of a .mcp.json file, the format other coding tools use;
  • switch a server, or single tools of it, on and off;
  • reconnect a server after you changed or restarted it.

Environment values and headers are masked on screen. Probing a server runs as a task with its seconds shown; c cancels it.

Adding a server from a script#

sh
ncode config record add mcp_server docs --http https://mcp.example.com/mcp
printf '%s' "$DOCS_TOKEN" | ncode config secret mcp_server:docs.headers.Authorization --stdin

ncode config record add mcp_server files --stdio npx -y @modelcontextprotocol/server-filesystem .
ncode config record add mcp_server github --stdio github-mcp-server stdio
printf '%s' "$GITHUB_TOKEN" | ncode config secret mcp_server:github.env.GITHUB_PERSONAL_ACCESS_TOKEN --stdin

Header and environment values that are secrets go through config secret … --stdin, never the command line. Then:

sh
ncode config mcp toggle docs       # switch the server off or on
ncode config mcp reconnect docs    # reconnect it
ncode config records mcp_server    # list your servers