项目的 README,来自 github.com/vercel-labs/portless。合并为一个 markdown 文件:README.md。
Portless gives local dev servers stable, named .localhost URLs. It assigns each server an available port and runs a local reverse proxy that routes requests by hostname. Your bookmarks and test scripts keep working even when the app gets a different port.
For a Next.js project named myapp, the dev script change looks like this:
- "dev": "next dev" # http://localhost:3000
+ "dev": "portless run next dev" # https://myapp.localhost
Portless requires Node.js 24 or later and runs on macOS, Linux, and Windows.
npm install -g portless
From a project with a dev script in package.json, run:
portless
Portless starts the proxy if needed, then runs your dev script and prints a URL such as https://myapp.localhost.
By default, the proxy serves HTTPS on port 443. The first HTTPS run adds a local certificate authority to your system trust store and may prompt for sudo on macOS and Linux. See HTTPS setup, or pass --no-tls to use HTTP.
To choose the hostname yourself, pass a name and the dev server command. For example, from a Next.js project:
portless myapp next dev
With the default proxy settings, open https://myapp.localhost.
To use the proxy whenever you run npm run dev, prefix the command in your dev script with portless run. To pin the version for your project, use npm install -D portless and commit the lockfile.
| Task | How |
|---|---|
| Run two branches side by side | Use portless run to give a linked Git worktree its own URL, such as https://fix-ui.myapp.localhost. |
| Start apps in a monorepo | Run portless from the workspace root. Use portless.json to override app names or scripts. |
| Name a server that's already running | With the proxy running, use portless alias api 8080 for a local HTTP server on port 8080. See Docker Compose for Compose services. |
| Look up app URLs | Use portless list to see active routes or portless get myapp to print a URL by name. |
| Open a dev server on another device | Use LAN mode on macOS or Linux, or share through a tunnel such as localtunnel. |
Run portless doctor if a URL doesn't load. If a route hostname will not resolve, the command that registered it warns and points to portless hosts sync.
Install the Portless skill to teach your agent how to start dev servers and find their URLs:
npx skills add vercel-labs/portless
Add the MCP server to let a client list routes, look up URLs, and wait for an app to be ready. Clients that support MCP Tasks can receive long-running calls as tasks, and --task-grace-ms sets how long a call can run before the server returns a task. Destructive and network-changing tool calls ask for confirmation through form elicitation when the client supports it; --elicit chooses the categories. Clients on MCP 2026-07-28 can also poll or stream route and readiness change events. Use the CLI to start dev servers.
{ "mcpServers": { "portless": { "command": "portless", "args": ["mcp"] } } }
Clients that support Skills over MCP can load the bundled portless and oauth skills from the MCP server in every tool profile.
Use Node.js 24 or later and pnpm 11. From the repository root, run pnpm install, then pnpm --filter portless build and pnpm --filter portless test for the CLI in packages/portless. See the docs workspace for site development and AGENTS.md for change and release requirements.
These companion tools are maintained independently by their authors, not by Vercel.