portmap
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@portmapscan this project and tell me which localhost ports are actually listening"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
portmap
Your agent hardcoded localhost:3000. This maps what actually runs.
git clone https://github.com/paladini/portmap.git && cd portmap
npm ci && npm run build && node dist/cli.js scan /path/to/your-appDeterministic · No LLM · No network · Read-only
What is this?
portmap is a command-line tool + MCP server that answers one question:
Before your agent runs
curl localhost:3000, does anything actually listen there?
It fuses three layers of local dev reality into a single map:
Declared — ports in
vite.config,package.jsonscripts,.envURLs,docker-composeActual — what your OS says is listening right now (Windows, macOS, Linux)
Connected — how env vars (
VITE_API_URL,API_URL, …) link services together
Output: .portmap.json + actionable findings (PRT-01 … PRT-07) that agents and CI can consume without guessing.
Who is it for?
Developers tired of "kill port 3000" and "works on my machine" port drift
Teams using AI coding agents (Cursor, Claude Code, Copilot) that hardcode wrong localhost URLs
Monorepos where frontend and API live in sibling folders and env refs cross repos
Anyone who wants a 5-second sanity check before debugging API connectivity
What it is not
Expectation | Reality |
Starts/stops your dev servers | No — use Switchboard or PortPilot for lifecycle |
Manual port registry you maintain | No — portmap discovers from configs + OS |
Production monitoring / uptime | No — local dev topology only |
Uses an LLM to infer ports | No — 100% deterministic filesystem + socket table |
If you need to kill a process, use your OS tools. portmap tells you which port to hit before you waste twenty minutes.
Related MCP server: devenv-doctor-mcp
The problem
Every AI-assisted dev session hits this eventually:
Agent: fetch('http://localhost:3000/api/users')
Reality: Vite on :5173, API on :8080, nothing on :3000Why it happens:
Next.js defaults to
:3000— agents memorize thatVite defaults to
:5173— different stack, different portDocker remaps
8080:3000— the app listens inside the container, not where you think.env.localpoints at a port nobody started todayYou debug CORS, auth, and "network error" for twenty minutes when the real bug is PRT-04
portmap surfaces the mismatch in seconds — declared vs listening vs env — so you fix the URL, not the symptom.
How it works
Two scanners, one reconcile step, zero LLM:
┌─────────────────────────────────────────────────────────────┐
│ Your repo on disk │
├─────────────────────────────────────────────────────────────┤
│ 1. Static discovery │
│ package.json scripts · vite.config · .env localhost URLs│
│ docker-compose port mappings │
├─────────────────────────────────────────────────────────────┤
│ 2. Runtime scan (optional) │
│ OS listeners → port, PID, process, command line │
├─────────────────────────────────────────────────────────────┤
│ 3. Reconcile │
│ declared ↔ actual ↔ env references → service graph │
│ → .portmap.json + findings (PRT-01 … PRT-07) │
└─────────────────────────────────────────────────────────────┘
↓ ↓ ↓
CLI pretty MCP tools CI --min-findingsFull rule list: docs/FINDINGS.md · Before/after fixes: docs/EXAMPLES.md · JSON spec: docs/SCHEMA.md
Try it in 30 seconds
git clone https://github.com/paladini/portmap.git
cd portmap
npm ci && npm run build
npm run demo:mismatch # classic agent mistake → 3 errors
npm run demo:workspace # frontend + API in sibling folders → resolvedWhat demo:mismatch looks like
portmap — mismatch-app
root: …/fixtures/mismatch
Services:
[down] vite — Vite dev server
declared :5173 (vite.config.ts:server.port)
not listening
Env references:
NEXT_PUBLIC_API_URL=http://localhost:3000 → :3000 [unresolved]
VITE_API_URL=http://localhost:8080 → :8080 [unresolved]
Findings: 3 error(s), 0 warning(s)
✖ PRT-01 Declared port 5173 is not listening …
✖ PRT-04 NEXT_PUBLIC_API_URL points to localhost:3000 but nothing is listening …
✖ PRT-04 VITE_API_URL points to localhost:8080 but nothing is listening …That's the entire debug session an agent skips when it reads .portmap.json first.
Install & run
Option A — Clone (works today)
git clone https://github.com/paladini/portmap.git
cd portmap
npm ci && npm run build
node dist/cli.js scan /path/to/your-appOption B — npm (when published)
npx portmap scan .Typical workflow
Run
portmap scan .(ordeclare .if nothing is running yet)Read
references[]for correct localhost URLs — never assume:3000Fix PRT-04 (broken env URL) before debugging API connectivity
Write
.portmap.jsonfor future agent sessions:portmap scan . --writeOptional: gate CI with
--min-findings 1 --min-severity error
Commands
Command | What it does |
| Full scan: static configs + OS listeners |
| Static only — no running processes needed |
| List OS listeners (debug) |
| Multi-repo: resolve cross-folder env refs |
| Start read-only MCP stdio server |
Flags: --json · --markdown · --write (save .portmap.json) · --out <file> · --min-findings N · --quiet
Findings at a glance
ID | Rule | Severity |
PRT-01 | Declared port not listening | error |
PRT-02 | Listener without declared config | warning |
PRT-03 | Two services declare same port | error |
PRT-04 | Env URL points to port with no listener | error |
PRT-05 | Listener on different port than declared | warning |
PRT-06 | Docker host:container port mismatch | warning |
PRT-07 | Cross-workspace env ref unresolved | error |
Full catalog with fixes: docs/FINDINGS.md
MCP for agents (read-only)
Add to .cursor/mcp.json or Claude Code config:
{
"mcpServers": {
"portmap": {
"command": "node",
"args": ["/path/to/portmap/dist/cli.js", "mcp"]
}
}
}Tool | Use when |
| Full |
| Slim |
| "What URL should I use for |
| List PRT-* issues filtered by severity |
Skill for Cursor/Claude: .cursor/skills/portmap/SKILL.md
.portmap.json — the artifact agents read
portmap scan . --write
git add .portmap.json # optional: commit for stable agent contextSpec: docs/SCHEMA.md
Agent-readiness pipeline
Part of the paladini agent toolkit — three deterministic checks, zero LLM:
harness-score → Is the repo harness ready for agents?
portmap → Do ports and env URLs align locally?
unhappypath → Is the UI ready for real users?Tool | Question |
AGENTS.md, rules, hooks, CI maturity | |
portmap | Declared ports, listeners, env graph |
Loading, empty, error, retry UI states |
Limitations (honest)
PID → repo attribution is heuristic; low-confidence matches are flagged, not hidden
WSL / Docker networking — listeners inside containers may not appear as expected on the host
Runtime-only ports (hardcoded in JS with no config) won't be declared — PRT-02 may warn
YAML compose — v1 parses common
ports:patterns; exotic compose features are skippedPrefer false negatives over noisy false positives — if unsure, portmap stays quiet
Contributing
Issues, false-positive reports, and parser contributions welcome.
Channel | Link |
Bug report | |
False positive | |
Feature request | |
Questions & ideas |
See CONTRIBUTING.md · ROADMAP.md · CODE_OF_CONDUCT.md
Security issues: SECURITY.md — please do not file publicly.
Development
npm ci
npm run build
npm test
npm run demo:mismatch
npm run demo:workspaceAgent/contributor guide: AGENTS.md
License
MIT © 2026 Fernando Paladini
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityAmaintenanceEnables AI agents to discover, configure, and manage local development servers. Provides tools for app registration, port allocation, lifecycle control, and log access without manual config editing.338MIT
- AlicenseNot gradedqualityCmaintenanceEnables LLM clients to inspect local dev environments—Docker container health, pnpm workspace integrity, and stuck process detection—without manual terminal copy-pasting.MIT
- AlicenseNot gradedqualityBmaintenanceSee and control the local dev servers your coding agents leave running. Lists listeners with provenance — which agent, terminal and git worktree started each — kills strays, and allocates collision-free ports so parallel agents stop fighting over :3000.MIT
- AlicenseNot gradedqualityAmaintenanceMCP server for managing local dev ports on macOS. It enables AI agents to inspect listening ports, identify owning processes and parent chains, kill processes safely, wait for ports, and report LAN exposure.291MIT
Related MCP Connectors
Give your AI agent a persistent map of your project's structure, dependencies, and bugs.
Lints + auto-fixes how AI coding agents discover any new product. 24 rules, 6 tools, score 0-100.
Scan any URL for AI agent readability — Vercel Spec, llmstxt.org, and agent-protocol manifests.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/paladini/portmap'
If you have feedback or need assistance with the MCP directory API, please join our Discord server