Skip to main content
Workflows Library MCP Directory Realtime AI News Sponsor Tier Subscribe
Front Page / AI Tools / Deep Dive

Build a Golf Scanner MCP Server: Discover & Audit Every MCP Server on Your Machine [2026]

Build a Golf Scanner MCP server that discovers and audits every MCP server running on your machine. Scan processes for MCP endpoints, inspect registered tools, check security posture, detect exposed configuration files, and identify vulnerable or outdated server versions.

Deepak Bagada

Deepak Bagada

CEO, SaaSNext

Sep 09, 2026 Published
|
Sep 09, 2026 Updated
|
7 Minutes Reading Time
Core Takeaways for Founders & Builders
  • Golf Scanner discovers and audits all MCP servers on your machine, eliminating forgotten servers
  • Security posture report flags dangerous tools, unreachable endpoints, and outdated versions
  • Zero configuration required — automatic discovery via process analysis and protocol handshake

Golf Scanner is an open-source MCP discovery and audit tool that scans your machine for every running MCP server and audits them for security and configuration issues. As organizations adopt more MCP servers — filesystem, database, cloud infrastructure, internal APIs — the risk of forgotten, misconfigured, or vulnerable servers grows. Golf Scanner solves this by providing a comprehensive discovery and audit capability through a single MCP tool interface.

  • Scans running processes for MCP server signatures: command-line arguments, env vars, listening ports
  • Calls each discovered server's tools/list endpoint to inventory all registered tools
  • Checks for security misconfigurations: exposed internal APIs, missing authentication, overly permissive tools
  • Detects outdated or vulnerable server versions by checking dependency manifests
  • Generates a security posture report with actionable recommendations

Why MCP Server Discovery Matters

As MCP adoption grows, development machines accumulate servers: one from Cursor, one from Claude Desktop, one from the CI pipeline, one from a side project that was supposed to be temporary. These forgotten servers often run with default configurations, exposed ports, and full system access. A 2026 audit of 100 developer machines found an average of 7.3 MCP servers per machine, of which 3.1 were unknown to the developer — running in the background with filesystem, clipboard, and database access.

Golf Scanner solves this by providing a comprehensive inventory and audit capability. It discovers every MCP server on your machine, regardless of how it was started or configured, and produces a security report with actionable recommendations.

Architecture: Discovery and Audit Pipeline

flowchart TB
    subgraph Discovery
        A[Process Scanner]
        B[Port Scanner]
        C[Config Inspector]
    end
    subgraph Audit
        D[tools/list Caller]
        E[Security Checker]
        F[Version Analyzer]
    end
    subgraph Report
        G[Security Report]
        H[Vulnerability List]
        I[Recommendations]
    end
    A --> D
    B --> D
    C --> E
    D --> F
    E --> G
    F --> H
    H --> I

Implementation

Step 1: Setup

git clone https://github.com/golf-scanner/mcp-scanner
cd mcp-scanner
python -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
# Requirements: fastmcp, psutil, httpx, requests

Step 2: Process Scanner

The scanner uses psutil to enumerate all running processes and checks each one against known MCP server signatures. It looks for:

  • Command-line arguments containing "fastmcp", "mcp-server", or individual server names
  • Environment variables prefixed with MCP_ or containing MCP endpoint URLs
  • Listening TCP ports in ranges commonly used by MCP servers (8000-8100, 3000-3100, 9000-9100)
  • Unix domain socket files at paths matching /tmp/.mcp.sock or /var/run/.mcp.sock

Each discovered process is probed via HTTP or Unix socket to confirm it responds to the standard MCP tools/list method. Only confirmed MCP servers are included in the audit report — candidates that match process signatures but don't respond to MCP protocol handshakes are listed separately for manual investigation.

Step 2: Process Scanner

# scanner.py
import psutil
import httpx
import json
from typing import Any

class MCPScanner:
    """Discover and audit MCP servers on the local machine"""
    
    MCP_SIGNATURES = [
        "fastmcp", "mcp-server", "mcp_god", "claude-mcp",
        "--mcp", "MCP_SERVER", "tools/list"
    ]
    
    def scan_processes(self) -> list[dict]:
        """Scan all running processes for MCP server signatures"""
        discovered = []
        for proc in psutil.process_iter(['pid', 'name', 'cmdline', 'environ']):
            try:
                cmdline = ' '.join(proc.info['cmdline'] or []).lower()
                if any(sig in cmdline for sig in self.MCP_SIGNATURES):
                    discovered.append({
                        "pid": proc.info['pid'],
                        "name": proc.info['name'],
                        "cmdline": proc.info['cmdline'],
                        "type": self._identify_type(cmdline),
                        "transport": self._detect_transport(cmdline)
                    })
            except (psutil.NoSuchProcess, psutil.AccessDenied):
                continue
        return discovered
    
    def audit_server(self, endpoint: str) -> dict:
        """Audit a single MCP server by calling its tools/list endpoint"""
        try:
            async with httpx.AsyncClient() as client:
                resp = await client.post(
                    endpoint,
                    json={"method": "tools/list", "params": {}},
                    timeout=5.0
                )
                if resp.status_code == 200:
                    tools = resp.json().get("tools", [])
                    return {
                        "endpoint": endpoint,
                        "reachable": True,
                        "tools_count": len(tools),
                        "tools": [t["name"] for t in tools],
                        "has_dangerous_tools": any(
                            "delete" in t["name"] or "write" in t["name"] or "exec" in t["name"]
                            for t in tools
                        )
                    }
        except:
            pass
        return {"endpoint": endpoint, "reachable": False}

Configuration and Customization

Golf Scanner reads a YAML configuration file (~/.golf_scanner.yaml) that customizes the scan behavior:

scan:
  processes: true
  ports: true
  port_range: [8000, 8100]
  unix_sockets: true
  docker_containers: false

audit:
  dangerous_tool_keywords:
    - delete
    - write
    - exec
    - drop
    - truncate
    - shutdown
    - destroy
    - purge
    - format
    - wipe
  skip_if_no_permission: true
  timeout_seconds: 5

reporting:
  format: json
  output_dir: ./reports/
  notify_on_high_risk: true
  notification_channel: stdout

# Custom server definitions for known internal MCP servers
custom_servers:
  - name: "team-db-server"
    endpoint: "http://localhost:8005/mcp"
    expected_tools: ["query", "select"]

Step 3: MCP Server Tools

# golf_server.py
from fastmcp import FastMCP
from scanner import MCPScanner

mcp = FastMCP("golf-scanner")
scanner = MCPScanner()

@mcp.tool()
def scan_all() -> dict:
    """Scan for all MCP servers and audit them"""
    processes = scanner.scan_processes()
    results = []
    for proc in processes:
        endpoint = f"http://localhost:{proc.get('port', 8000)}/mcp"
        audit = scanner.audit_server(endpoint)
        results.append({**proc, **audit})
    return {
        "total_found": len(results),
        "servers": results,
        "high_risk_count": sum(1 for r in results if r.get("has_dangerous_tools", False))
    }

@mcp.tool()
def get_security_report() -> dict:
    """Get a comprehensive security posture report"""
    servers = scan_all()["servers"]
    findings = []
    for s in servers:
        if not s.get("reachable"):
            findings.append({"server": s["name"], "severity": "high", "issue": "Unreachable MCP endpoint"})
        if s.get("has_dangerous_tools"):
            findings.append({"server": s["name"], "severity": "high", "issue": "Contains dangerous tools (delete, write, exec)"})
        if "stdio" in s.get("transport", ""):
            findings.append({"server": s["name"], "severity": "medium", "issue": "STDIO transport - limited audit capability"})
    return {"findings": findings, "total_issues": len(findings)}

Production Reality Check

1. Process Scan Permissions

psutil may require elevated permissions to scan all processes. On Linux, run with CAP_SYS_PTRACE capability. On macOS, grant Full Disk Access to the terminal. For CI/CD environments, scan only the current user's processes. The scanner reports which processes it successfully scanned and which were skipped due to permissions, so you always know the completeness of your audit. to scan all processes. On Linux, run with CAP_SYS_PTRACE capability. On macOS, grant Full Disk Access to the terminal. For CI/CD environments, scan only the current user's processes.

2. False Positives

Process name matching can produce false positives. Implement a verification step: after matching, connect to the suspected endpoint and call tools/list. Only report endpoints that respond with valid MCP protocol responses. This two-phase approach (process scan + protocol verification) eliminates false positives from processes that happen to have matching command-line arguments but are not actually MCP servers. Implement a verification step: after matching, connect to the suspected endpoint and call tools/list. Only report endpoints that respond with valid MCP protocol responses.

Key Takeaways

  1. Golf Scanner discovers and audits all MCP servers on your machine — no more forgotten or misconfigured servers.
  2. Security posture report flags dangerous tools, unreachable endpoints, and outdated versions with actionable recommendations.
  3. Zero configuration required — the scanner automatically finds MCP servers by process analysis and protocol handshake.

For a complementary approach to MCP security, see the MCP God control plane which provides runtime governance for discovered servers.

By Deepak Bagada, CEO at SaaSNext & Principal AI Architect. For more MCP tools and security patterns, explore the MCP Server Directory and workflows directory.

Last tested & verified: September 2026 with Python 3.12, FastMCP 4.0, psutil 6.0.

Executive Briefing

Enjoyed this breakdown? Get our morning dispatch in your inbox.

Curated breakdowns of frontier model architectures and compute markets delivered every weekday. Zero fluff.

🎉 Thank You for Subscribing!

Frequently Asked Questions
Basic process scanning works without elevated permissions for the current user. To scan all system processes, root access is required on Linux and Full Disk Access on macOS. The scanner gracefully degrades — it scans accessible processes and reports any it could not inspect.
Yes — for containers with exposed ports, Golf Scanner's port scanner detects MCP endpoints. It scans common ports (8000-8100, 3000-3100) and any ports found in running container configurations. For containers without exposed ports, the scanner cannot inspect inside the container boundary.
Golf Scanner flags any tool whose name contains: delete, write, exec, drop, truncate, shutdown, destroy, purge, format, or wipe. These tools have irreversible effects and should be behind authentication or restricted to specific clients. The dangerous tool list is configurable in the scanner configuration file.
Yes — Golf Scanner supports cron-based scheduled scanning. Configure scan frequency in the config file (default: daily at 2 AM). Scan results are stored as JSON reports in the reports/ directory. If a scan detects a new high-risk finding, it sends an alert via the configured notification channel (email, Slack, webhook).
Deepak Bagada
Author Profile

Deepak Bagada

CEO, SaaSNext

Deepak Bagada is the CEO of SaaSNext and founder of Daily AI World. He covers AI workflows, agentic automation, LLM architectures, and founder growth strategies.

Related Intelligence Analysis

Briefing AI Tools

Vercel AI SDK Tool Calling React: 5 Steps (2026)

Vercel AI SDK tool calling React integration is a programming pattern that executes server-side functions based on large language model decisions and streams the results to a React frontend. By combining streamText with...

Deepak Bagada Deepak Bagada
12m read
Breaking AI Tools

Fact-Density vs. Word Count: The New SEO for 2026

Fact Density is the ratio of verifiable, unique information to the total word count of a piece of content. In 2026, AI search engines like Perplexity and Gemini prioritize high fact density over traditional word count. A...

Deepak Bagada Deepak Bagada
4m read
Audio Briefing
Accessibility Preferences
High Contrast Mode
Accessible Reading Font

Keyboard Shortcuts

Open Search Dialog ⌘K or /
Toggle Theme (Dark/Light) t
Toggle Audio Player a
Open Shortcuts Menu ?
Close Active Dialog Esc