Skip to main content
Glama

list_dev_servers

Find all local development servers running on TCP ports. Identifies framework, process ID, project name, and resource usage to help manage active projects.

Instructions

List all local dev servers (next, vite, rails, django, etc) listening on TCP ports. Returns port, pid, framework, project name, cwd, uptime, memory, cpu.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The core handler function that implements the 'list_dev_servers' tool logic. It calls scanListeningPorts(), filters processes via isDevProcess(), detects frameworks, and returns a sorted array of DevServer objects with port, pid, framework, project name, cwd, uptime, memory, and CPU info.
    export async function listDevServers(): Promise<DevServer[]> {
      const listeners = await scanListeningPorts();
      const out: DevServer[] = [];
      for (const l of listeners) {
        const info = await getProcessInfo(l.pid);
        if (!info) continue;
        if (!isDevProcess(l.process, info.cmdline)) continue;
        const fw = await detectFramework(info.cmdline, info.cwd);
        out.push({
          port: l.port,
          pid: l.pid,
          process: l.process,
          cmdline: info.cmdline,
          cwd: info.cwd,
          project_name: fw.project_name,
          framework: fw.framework,
          uptime_seconds: info.uptime_seconds,
          memory_mb: info.memory_mb,
          cpu_pct: info.cpu_pct,
          user: l.user,
        });
      }
      return out.sort((a, b) => a.port - b.port);
    }
  • src/index.ts:16-21 (registration)
    Tool registration in the TOOLS array. Defines 'list_dev_servers' with its name, description, and empty inputSchema (no required params).
    const TOOLS = [
      {
        name: "list_dev_servers",
        description: "List all local dev servers (next, vite, rails, django, etc) listening on TCP ports. Returns port, pid, framework, project name, cwd, uptime, memory, cpu.",
        inputSchema: { type: "object", properties: {}, additionalProperties: false },
      },
  • MCP CallToolRequestSchema handler that dispatches 'list_dev_servers' to the listDevServers() function and returns the result wrapped in a text content block.
    case "list_dev_servers": {
      const data = await listDevServers();
      return ok({ count: data.length, servers: data });
    }
  • The DevServer interface type definition that defines the shape of the output returned by list_dev_servers: port, pid, process, cmdline, cwd, project_name, framework, uptime_seconds, memory_mb, cpu_pct, user.
    export interface DevServer {
      port: number;
      pid: number;
      process: string;
      cmdline: string;
      cwd: string | null;
      project_name: string | null;
      framework: string | null;
      uptime_seconds: number;
      memory_mb: number;
      cpu_pct: number;
      user: string;
    }
  • Helper function isDevProcess() called within listDevServers to filter which listening TCP ports correspond to actual dev servers (node, python, ruby, etc.) based on a whitelist and regex fallback.
    function isDevProcess(processName: string, cmdline: string): boolean {
      const base = processName.split("/").pop() ?? processName;
      if (DEV_PROCESS_WHITELIST.has(base)) return true;
      // fallback: cmdline contains a dev runner
      return /\b(next|vite|nuxt|remix|astro|webpack|rails|django|flask|uvicorn|gunicorn|deno|bun)\b/.test(cmdline);
    }
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description must convey behavior. It implies read-only listing but does not explicitly state safety, permissions, or side effects; adequate but not thorough.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Single sentence, front-loaded with action and result, no filler text.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite no output schema, description fully enumerates return fields and covers key aspects of a list tool; no obvious gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

No parameters in schema; description adds no param info, which is fine since none exist. Baseline 4 applies for 0 params.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Description clearly states it lists local dev servers on TCP ports, specifying the exact fields returned (port, pid, framework, etc.). It distinguishes from siblings like find_zombies or kill_server.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Describes when to use (to list dev servers) but does not explicitly state when not to use or mention alternatives, though sibling names provide context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

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/HasanJahidul/localhost-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server