localhost:

Agent skill

The localhost-mcp agent skill: what it teaches Claude Code, Codex and other agents about running dev servers through localhost app, and how to install it.

The localhost repository ships an agent skill, skills/localhost-mcp/SKILL.md: a short Markdown file that teaches a coding agent to run your Services through localhost mcp instead of a shell. It needs the MCP server connected; the skill only tells the agent how to use it.

What it tells the agent

  • Use the MCP tools, not a shell, for long-running processes. No pnpm dev, npm start, cargo run or docker compose up of its own. One-shot commands (tests, a build, a migration) are still fine in a shell.
  • Find the Project, then reuse its Services: list_projects, pick the one whose folder holds the code it works on, then list_services, naming everything by Key.
  • Check status before saying something is running. Only running means running.
  • Read before retrying: status and logs when a start fails, ports on a portConflict, then tell you or start on a free port for that Run.
  • Respect what you started: a Service you started in the app shows "startedBy": "app", and the agent asks before stopping it. One a localhost up runs in a terminal isn’t started twice.
  • Don’t invent Projects. The MCP server can’t add or edit them, so the agent asks you to add a missing one in the app.

When an agent uses it

The skill’s description tells the agent when to load it: whenever it needs a project’s app running (to test a change, call an endpoint, open a page), when a dev server fails or a port is taken, or before saying anything is running. Agents that support skills read that description and load the rest when a task matches. You can also ask for it by name.

The MCP server itself also sends the agent short instructions when it connects, so an agent without the skill gets the essentials. The skill makes them the default and adds the rules above.

Install it

Copy the localhost-mcp folder (with its SKILL.md) to where your agent looks for skills:

Agent For you, in every project For one project
Claude Code ~/.claude/skills/localhost-mcp/SKILL.md .claude/skills/localhost-mcp/SKILL.md
Codex ~/.agents/skills/localhost-mcp/SKILL.md .agents/skills/localhost-mcp/SKILL.md

For example, for Claude Code:

mkdir -p ~/.claude/skills/localhost-mcp
curl -fL -o ~/.claude/skills/localhost-mcp/SKILL.md \
  https://raw.githubusercontent.com/marcellosso/localhost/main/skills/localhost-mcp/SKILL.md

A skill in a project folder is shared with everyone who works on it once you commit it. Other agents with their own skill or rules formats, such as Cursor, can take the same text; or add these lines to your project’s AGENTS.md:

## Running the project
Use the localhost MCP server to run this project's Services, never a shell:
start_service / start_project to run, status before saying anything is running,
logs and ports when something fails or a port is taken.

Why agents should run dev servers through localhost, and what they can do with it: localhost for AI coding agents.

Edit this page on GitHub

Install localhost for macOS

Two quick steps, usually under a minute.

  1. Drag it to Applications

    Open localhost-0.2.0.dmg and drag localhost to Applications.

    Download localhost-0.2.0.dmg

    Or download it from Terminal, which macOS doesn’t block, so you can skip step 2:

    curl -fLO https://github.com/marcellosso/localhost/releases/download/v0.2.0/localhost-0.2.0.dmg && open localhost-0.2.0.dmg
  2. Open it the first time

    localhost isn’t notarized by Apple yet, so macOS blocks the first launch once:

    1. Click Done in the warning.
    2. Open System Settings › Privacy & Security and scroll to Security.
    3. Click Open Anyway, and confirm with your password or Touch ID.

    Or run this in Terminal, then open localhost:

    xattr -dr com.apple.quarantine /Applications/localhost.app

macOS 15 or later · Apple silicon or Intel

  1. Run the installer

    Open localhost_0.2.0_x64-setup.exe. It installs for your user only, no administrator rights needed.

    Download localhost_0.2.0_x64-setup.exe
  2. Get past SmartScreen

    The installer isn’t signed by a known publisher yet, so Windows says “Windows protected your PC”:

    1. Click More info.
    2. Check that the file is localhost_0.2.0_x64-setup.exe.
    3. Click Run anyway.

Windows 10 or 11 · x64 · WSL 2 for Projects in WSL

  1. Download your package

  2. Install it

    From the folder you downloaded it to:

    sudo apt install ./localhost-app_0.2.0_amd64.deb
    sudo dnf install ./localhost-app-0.2.0-1.x86_64.rpm
    chmod +x localhost-app_0.2.0_amd64.AppImage && ./localhost-app_0.2.0_amd64.AppImage

    Secrets need a Secret Service (GNOME Keyring, KWallet). On stock GNOME the tray icon needs the AppIndicator extension.

x86_64 · Ubuntu 22.04+ · Debian 12+ · Fedora

On another system?Install guide →