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 分