localhost app

io.github.marcellosso由 GitHub 账号 marcellosso 发布v0.2.0更新于 Nov 4, 2026

Start, stop and read logs of your local dev servers from Claude Code, Cursor and Codex.

概览

AI 生成的概览

把编码代理连接到 localhost 应用,让它们在本机启动、停止本地开发服务器并读取日志。

可以做什么
  • 通过 localhost 应用启动、停止本地开发服务器并读取日志
  • 新增、编辑或删除 Projects 与 Services(除非以只读模式运行)
  • 在 Claude Code、Claude Desktop、Cursor 和 Codex 中安装、卸载并查看 MCP 服务器与技能状态
  • 以 stdio 方式为任意 MCP 客户端运行服务器,支持只读模式和 dry-run 预览
适用场景
适合经常使用本地开发服务器、希望编码代理在对话中直接启动、停止或查看日志的人,也适合想一次性把该服务器接入多个代理的场景。
运行要求
必须已安装 localhost 应用,因为服务器运行的是该应用自带的 localhost 命令;只读模式需要 0.4.0 或更高版本的应用。需要 Node 18 或更高版本,通过 npx 运行,无依赖。未声明认证、环境变量或请求头。
安装前请注意
安装程序会写入代理配置文件,例如 ~/.claude.json、claude_desktop_config.json、~/.cursor/mcp.json 和 ~/.codex/config.toml,并安装技能目录;它会先备份文件,且不改动其他条目。非只读模式下服务器可新增、编辑或删除 Projects 与 Services。建议先用 dry-run 预览改动。

安装

在 SourceWeft 中

  1. 打开 控制台中的 localhost app,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

@getlocalhost/cli

Connects your coding agents to localhost mcp, the MCP server of localhost app, from a terminal:

sh
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:

AgentMCP server added toSkill 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-backups folder of localhost's data folder, before it first changes a file.
  • Running it again changes nothing.

Commands

sh
npx @getlocalhost/cli mcp install     # add the server and the skillnpx @getlocalhost/cli mcp uninstall   # remove them, and nothing elsenpx @getlocalhost/cli mcp status      # where each agent standsnpx @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-onlyFor 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-runPrints 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:

json
{  "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

sh
cd packages/clinpm testnode 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.

来源:packages/cli/README.md,提交 2ec6435

工具

0
SourceWeft 曾在隔离沙箱中以无凭据方式启动该软件包一次,以列出其工具,但未能完成:服务器未能启动。

版本历史

1
  1. v0.2.0最新Nov 4, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分