{% extends "base.html" %} {% block title %}Developer - MCP Network Diagnostics{% endblock %} {% block content %}

Developer / API

Integrate MCP Network Diagnostics into your application via stdio (Claude Desktop) or HTTP transport.

Quick Start: Claude Desktop

Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):

Consumer Mode (Edge diagnostics only)

{
  "mcpServers": {
    "network-diagnostics": {
      "command": "/path/to/uv",
      "args": ["--directory", "/path/to/mcp-network-diagnostics", "run", "mcp-network"]
    }
  }
}

Tools available: check_my_connection, why_is_it_slow, trace_path, scan_local_network, record_baseline, compare_to_baseline

Operator Mode (Device diagnostics)

{
  "mcpServers": {
    "network-diagnostics": {
      "command": "/path/to/uv",
      "args": ["--directory", "/path/to/mcp-network-diagnostics", "run", "mcp-network", "--collector", "simulated"]
    }
  }
}

Adds: list_devices, get_device_status, diagnose_latency, predict_trends, detect_anomalies

HTTP Transport

For remote API access or multi-client scenarios, use HTTP transport:

# Start HTTP MCP server
uv run mcp-network --transport streamable-http --port 8000 --path /mcp

# With authentication required
uv run mcp-network --transport streamable-http --port 8000 --require-auth

Endpoint: http://localhost:8000/mcp

Rate limits: Per-key (based on role) + global (default 1000 req/min, set MCP_NETWORK_GLOBAL_RPM to override).

Authentication

When --require-auth is set, send your API key with every request:

Authorization: Bearer mcp_<key_id>_<secret>

Create keys via:

Roles and Tools

Keys are assigned a role. Each role inherits tools from lower roles.

Tools by Role

{% for role, tools in role_tools.items() %}
{{ role }}
    {% for t in tools %}
  • {{ t }}
  • {% endfor %}
{% endfor %}

Example API Calls

# List available tools
curl -X POST http://localhost:8000/mcp \
  -H "Authorization: Bearer mcp_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

# Call a tool
curl -X POST http://localhost:8000/mcp \
  -H "Authorization: Bearer mcp_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"check_my_connection","arguments":{}}}'

Server Status

Check enabled transports and configuration:

curl http://localhost:8080/status/dev

Returns JSON with transport type, collector mode, and feature flags.

Security Notes

See SECURITY.md for the full threat model.

{% endblock %}