Repository navigation
Make localhost ready for MCP directories: mcp serve, server.json, glama.json, Dockerfile, README, v0.4.0 prep - #64
Merged
Conversation
…e; CLI 0.2.0 with mcpName
…to the MCP Registry
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…r end to end on Windows too
…ve on /agents, and pin the Dockerfile to 0.4.0
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #63
Summary
Nothing but the child writes to stdout.
mainreturns a Promise forserveonly, andbin/getlocalhost.jsawaits it.install,uninstallandstatusare unchanged.Checklist
mcp serve [--read-only]: done, as sketched above.parse()takes--read-onlyforinstallandserve, rejects it foruninstallandstatus, and rejects--clientand--dry-runforserve.servereusesrefuse()frominstall, so the missing-app, broken and no---read-onlymessages are the same ones. Tests intest/serve.test.jscover:--read-only;--read-onlywithout app support;It also has two end-to-end tests that run
mcp servein a realnodeprocess:node mcp [--read-only]runs a script namedmcpthat echoes stdin and exits 3). It checks that stdout carries exactly the server's bytes, that--read-onlyis passed on, and that exit code 3 comes back throughserve.localhostshell script (localhost 9.9.9, echoes stdin onmcp) found through the real--version/--helpprobes. It's skipped on Windows because the fixture is a shell script. USAGE,packages/cli/README.md(a new "Any MCP client" section) and the npm description now covermcp serve.package.json:
mcpName: io.github.marcellosso/localhost, version0.2.0. No other file lists the CLI version.server.json: as specified. 2025-12-11 is still the latest released schema; the registry repo has only a draft beyond it. The description is 87 characters, not 86, still within 100.
test/server-json.test.jschecks thatname === mcpName, that both versions equalpackage.json's, the identifier, themcp serveargs and the description length. CI'sclifilter now includesserver.jsonand.mcp.json. I left outicons: the schema allows them, but the image URL only exists after merge. It can come later.glama.json: done, and valid against Glama's schema. Glama's schema has only
maintainers, so the logo isn't referenced there.Dockerfile: done. It's pinned with
ARG VERSION=0.4.0, and a comment says to bump it with each release.--build-arg VERSION=latestresolves the latest tag through thereleases/latestredirect. Until v0.4.0 is published, a plaindocker build .fails, because the v0.4.0.debis a 404. Build with--build-arg VERSION=latestuntil then. It runslocalhost --versionat build time and purges curl afterwards. The header comment says it's for introspection only..mcp.json: done. Effect on contributors: Claude Code treats a root
.mcp.jsonas a project-scoped server. It asks each contributor before enabling it, unless they setenableAllProjectMcpServersorenabledMcpjsonServers. Once approved, it takes precedence over a user-scope server with the same name (local > project > user), so in this repo it replaces the app's ownlocalhostentry. Both run the same app binary, but until CLI 0.2.0 is on npm,npxfetches 0.1.0, which has noserve, so that server fails. CONTRIBUTING.md says to decline it, or to list it indisabledMcpjsonServers. Cursor reads.cursor/mcp.json, not the root file, and Codex ignores it.README: a new subsection at the end of "Coding agents (MCP)",
### How do I add the localhost MCP server to Claude Code, Cursor or Codex?, so the#coding-agents-mcpanchors still work. It opens with a one-sentence definition oflocalhost mcp, and the tool list says the six editing tools need the app 0.4.0 or later. It has:npx -y @getlocalhost/cli mcp install [--read-only];claude mcp add --scope user localhost -- npx -y @getlocalhost/cli mcp serve; I added--scope userto match the README's other commands);codex mcp add …, or the[mcp_servers.localhost]block);core/localhost-cli/src/mcp/tools.rsandtools/edits.rs;<!-- mcp-name: io.github.marcellosso/localhost -->.I checked the CLI syntax with
claude mcp add --help(2.1.317) andcodex mcp add --help(0.166.0). Skipped: the Cursor deeplink, because I couldn't verify its current format. The FAQ is untouched, so it stays in sync withfaq.ts. The site's/docs/mcpgets amcp serverow and a "With npx" section, the agents FAQ answer, which feedsllms.txt, mentionsmcp serve, and so does step 4 ("Or set it up by hand") on/agents. The "With npx" section opens with a one-line definition.Logo:
assets/logo-400.png, rendered fromapps/desktop/src-tauri/icons/icon.svgwithsips(1024 px, then 400×400). It has no version number.v0.4.0 prep: following RELEASING.md, the tag is the only version, so
tauri.conf.json,MARKETING_VERSIONand the crates are untouched.0.4.0.md(released: false) covers:--read-only, also from MCP: create, update and delete Projects and Services, and localhost mcp --read-only #55;npx @getlocalhost/cli mcp install|uninstall|status, from Add npx @getlocalhost/cli mcp install: connect agents to localhost mcp from a terminal #57;mcp serve, from this PR;I left out the site, CI and publishing-workflow PRs (Show the Homebrew install across the site #43, CI: run each job only when files it depends on change #47, Website redesign: the labelled panel, landing and every page (#46) #50, Landing hero: GitHub link, per-OS install links and a quieter header Download #54, Site: hero platform links go to the docs; compare page and FAQ cover the MCP write tools #58, Publish @getlocalhost/cli from CI with npm trusted publishing #60, Site: guides, per-tool compare pages, no-Docker wording and the npx fix on /compare #62). "From the release after 0.3.0" in the CLI README now says 0.4.0. Nothing is tagged or released. CONTRIBUTING has a new "Publishing to the MCP Registry" section (
mcp-publisher validate,login github,publish, after npm 0.2.0). None of it was run exceptvalidate.Evidence
cd packages/cli && npm test: 53 pass, 0 fail (Node 24.10, macOS), and 53 tests with 0 failures on Linux innode:18-slimandnode:22-slim(the one skip there is the existing "no Claude Desktop for Linux" test). Before: 39 tests, andmcp servewasUnknown command “mcp serve”.LOCALHOST_STORAGE_ROOT:initialize, thennotifications/initialized, thentools/listpiped intonode packages/cli/bin/getlocalhost.js mcp serve. It exited 0, stdout held exactly 2 JSON-RPC responses (ids 1 and 2, 9 tools), and stderr was empty.mcp serve --read-onlyagainst 0.3.0 printedlocalhost 0.3.0 has no `localhost mcp --read-only` yet…to stderr, put 0 bytes on stdout and exited 1.bininnode:22-slim): exit 1, 0 bytes on stdout, and the Linux install steps with https://www.getlocalhost.app on stderr.server.json:mcp-publisher validate(v1.8.7, release binary, SHA-256 checked) reported✅ server.json is valid. Also valid offline against the 2025-12-11 schema withnpx ajv-cli@5.0.0+ajv-formats@3.0.1(draft-07), andglama.jsonagainst Glama's schema.docker build --platform=linux/amd64succeeded withVERSION=latest(v0.3.0) and withVERSION=0.3.0. The pinned default, 0.4.0, can only build once that release exists; the image is 137 MB. Piping the issue'sinitialize+initialized+tools/list, plus alist_projectscall, intodocker run -i --rmreturned ids 1, 2 and 3,serverInfo.version 0.3.0, 9 tools and{"projects": []}. Built on an Apple-silicon Mac through emulation.npm cican't run insite/. It haspnpm-lock.yamland nopackage-lock.json("can only install with an existing package-lock.json"), so I usedpnpm install --frozen-lockfile && pnpm run build, which completed. Indist/changelog.html, 0.4.0 shows as Unreleased and 0.3.0 asv0.3.0. Every anchor the changelog links to exists (#tools,#read-only,#connect-from-a-terminal,#with-npx,/docs/install#homebrew-macos).publish-cli.yml -f dry-run=trueon this branch (run 41732144725): success. On Linux, Node 24, it rannpm test, checked that 0.2.0 isn't on npm yet, rannpm pack --dry-run(skill included) andnpm publish --dry-run. npm still lists only0.0.0-stageand0.1.0.Not verified locally: Windows. CI runs the CLI tests on
windows-latest, including the real-spawn end-to-end test. The first CI run failed 7servetests there. They never reached the fake spawn: the test helper built alinuxfixture, whose command path used Windows separators on a Windows host whilecandidates()for Linux looked for a POSIX one, sofindAppfound no app. That was a test bug, not a bug inserve. The helper now handsfindAppthe fixture's own command on every OS. The same run's macOS Rust job timed out inlocalhost-core/tests/ports.rs(no Listener appeared: Elapsed). This PR changes nothing incore/; the job only ran because the PR editsci.yml. The new tools (15) are verified only from the code, because the installed app and the latest release are 0.3.0.After merge (Marcel)
gh workflow run packages.yml -R marcellosso/localhost --ref main).v0.4.0and publish the draft. The changelog flips to released by itself.gh workflow run publish-cli.yml -R marcellosso/localhost --ref main(CLI 0.2.0).mcp-publisher login github && mcp-publisher publish.Until step 3,
npx -y @getlocalhost/cli mcp serveresolves to 0.1.0, which has noserve. The README's npx instructions start working once 0.2.0 is published.Merge Danger
Door: two-way. It's docs, new root files, a new subcommand and a version field. Nothing is published by merging.
Blast Radius: small.
install,uninstallandstatusbehave as before, and their tests pass unchanged. The root.mcp.jsonprompts Claude Code users in this repo, as described above. The CLI job now also runs whenserver.jsonor.mcp.jsonchange.