About localhost app
localhost app's CLI configures its MCP server and skill for coding agents on the same computer. It supports installation, removal, status checks, and serving the server to any stdio-based MCP client while preserving unrelated configuration.
Key features
- 01Install or remove server and skill entries
- 02Check agent connection status
- 03Serve MCP over stdio
- 04Read-only server option
- 05Dry-run configuration changes
- 06Back up files before editing
Use cases
- 01Connect Claude Code, Cursor, or Codex to localhost
- 02Set up the server for another stdio MCP client
- 03Preview configuration changes before applying
- 04Check or remove existing agent setup
MCP support
The CLI installs and manages localhost app's MCP server configuration for supported agents. Its serve command launches the server over stdio for any MCP client.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project README@getlocalhost/cli
Connects your coding agents to localhost mcp, the MCP server of localhost app, from a terminal:
npx @getlocalhost/cli mcp install
It adds a server named localhost to Claude Code, Claude Desktop, Cursor and Codex, whichever are on this computer, and installs the localhost-mcp skill where each agent reads skills. The server runs the localhost command that comes with the app, so the app must be installed: without it, this prints how to install it for your OS and changes nothing.
It writes what Settings → Agents in the app writes, and the app shows these agents as connected:
| Agent | MCP server added to | Skill installed in |
|---|---|---|
| Claude Code | ~/.claude.json, through claude mcp add-json --scope user when claude is installed | ~/.claude/skills/localhost-mcp/ |
| Claude Desktop (macOS, Windows) | claude_desktop_config.json in Claude's folder (~/Library/Application Support/Claude, %APPDATA%\Claude) | none: it has no skills folder |
| Cursor | ~/.cursor/mcp.json | ~/.cursor/skills/localhost-mcp/, unless Claude Code's or Codex's folder has it: Cursor reads those too |
| Codex | ~/.codex/config.toml | ~/.agents/skills/localhost-mcp/ |
- Only its own entries. Every other server and setting in the file stays as it was, comments and order included. A file it can't read is reported and left alone.
- A backup first, in the
agent-backupsfolder of localhost's data folder, before it first changes a file. - Running it again changes nothing.
Commands
npx @getlocalhost/cli mcp install # add the server and the skill
npx @getlocalhost/cli mcp uninstall # remove them, and nothing else
npx @getlocalhost/cli mcp status # where each agent stands
npx @getlocalhost/cli mcp serve # run the server, for an MCP client's configuration
| Option | |
|---|---|
--client <agent> | claude-code, claude-desktop, cursor or codex; claude for both Claude apps. Repeat it, or separate with commas, for more than one. Without it: every agent found on this computer. |
--read-only | For mcp install and mcp serve. The server runs localhost mcp --read-only, without the tools that add, edit or remove Projects and Services. Needs a localhost app that has it (0.4.0 or later). Installing again without it keeps a read-only server read-only. |
--dry-run | Prints what would change, as a diff, and changes nothing. |
Then start a new Claude Code session, quit and reopen Claude Desktop, check Cursor Settings → MCP, or restart Codex.
Any MCP client
mcp serve is the server itself, for any client that starts MCP servers over stdio:
{
"mcpServers": {
"localhost": { "command": "npx", "args": ["-y", "@getlocalhost/cli", "mcp", "serve"] }
}
}
It finds the app's localhost command as mcp install does and runs localhost mcp with the client's stdin and stdout, passing on Ctrl-C and other signals and exiting as the server does. mcp serve --read-only runs localhost mcp --read-only. It writes nothing to stdout itself, since that is the client's channel: without the app, or with an app whose command doesn't run, it says why on stderr and exits with 1. claude mcp add --scope user localhost -- npx -y @getlocalhost/cli mcp serve and codex mcp add localhost -- npx -y @getlocalhost/cli mcp serve add it from a terminal.
More in the MCP docs. Node 18 or later; no dependencies.
Development
cd packages/cli
npm test
node bin/getlocalhost.js mcp status
The JSON and TOML editors are the same as the core's (core/localhost-core/src/agents/), and their tests too: change both together. npm pack copies the skill from skills/localhost-mcp into the package.
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.