Skip to content

Instantly share code, notes, and snippets.

@aneeshkp
Created February 12, 2026 13:17
Show Gist options
  • Select an option

  • Save aneeshkp/b6cd1edf811f2e0353576c75b08220d4 to your computer and use it in GitHub Desktop.

Select an option

Save aneeshkp/b6cd1edf811f2e0353576c75b08220d4 to your computer and use it in GitHub Desktop.
Comparison: ptp-operator-mcp-server vs ptp-mcp-server — Architecture, Gaps, and Improvements

PTP MCP Server Comparison: ptp-operator-mcp-server vs ptp-mcp-server

Executive Summary

Both repositories provide Model Context Protocol (MCP) servers for monitoring and diagnosing Precision Time Protocol (PTP) infrastructure on OpenShift clusters. They share the same author (Aneesh Puttur / Red Hat) and solve the same core problem — enabling AI agents (e.g., Claude) to interact with PTP infrastructure through natural language.

However, they differ significantly in maturity, architecture, language, and feature depth.

Dimension ptp-operator-mcp-server ptp-mcp-server
Language Node.js (primary) + Python (alt) Python only
Cluster Access Kubernetes API client (native) oc CLI via subprocess.run()
MCP Tools 16+ tools 8 tools
In-Cluster Agent Yes (ptp_agent.py) No
Real-Time Events Yes (cloud-event-proxy subscription) No
Hardware Detection Yes (ethtool, NIC vendor support) No
Containerization 3 Dockerfiles + K8s manifests None (draft PR adds one)
NLQ Engine No (relies on LLM) Yes (regex-based pattern matching)
ITU-T G.8275.1 No Yes (compliance validation)
Commits 15 (over 2.5 weeks) 4 (single day)
Development Period Sep 24 – Oct 10, 2025 Jul 20, 2025
Verdict More functional & operational Earlier prototype, niche strengths

Architecture Comparison

ptp-operator-mcp-server — Architecture

┌─────────────────────────────────────────────────────────────────┐
│                     Claude Desktop / MCP Client                 │
└──────────────────────────┬──────────────────────────────────────┘
                           │ MCP Protocol (stdio or TCP)
                           ▼
┌─────────────────────────────────────────────────────────────────┐
│              MCP Server (Node.js — index.js)                    │
│                                                                 │
│  ┌──────────────┐  ┌──────────────┐  ┌────────────────────┐    │
│  │ Pod Discovery│  │ Log Analysis │  │ Hardware Detection │    │
│  │ & Status     │  │ (FAULTY,     │  │ (ethtool -T,       │    │
│  │              │  │  SLAVE, etc) │  │  NIC vendors)      │    │
│  └──────┬───────┘  └──────┬───────┘  └────────┬───────────┘    │
│         │                 │                    │                │
│  ┌──────┴─────────────────┴────────────────────┴──────────┐    │
│  │          @kubernetes/client-node (native API)           │    │
│  └────────────────────────┬───────────────────────────────┘    │
│                           │                                     │
│  ┌────────────────────────┴───────────────────────────────┐    │
│  │         PTP Agent Connection (HTTP → port 8081)         │    │
│  └────────────────────────┬───────────────────────────────┘    │
└───────────────────────────┼─────────────────────────────────────┘
                            │
            ┌───────────────┼───────────────────┐
            │               ▼                   │
            │  ┌──────────────────────────┐     │
            │  │  PTP Agent (Python)      │     │
            │  │  (ptp_agent.py)          │     │
            │  │                          │     │
            │  │  • cloud-event-proxy     │     │
            │  │    subscription          │     │  OpenShift
            │  │  • Real-time event       │     │  Cluster
            │  │    detection (<5s)       │     │
            │  │  • Health API (/health)  │     │
            │  └──────────┬───────────────┘     │
            │             │                     │
            │             ▼                     │
            │  ┌──────────────────────────┐     │
            │  │  PTP Operator            │     │
            │  │  ├── linuxptp-daemon     │     │
            │  │  ├── cloud-event-proxy   │     │
            │  │  └── PtpConfig CRDs      │     │
            │  └──────────────────────────┘     │
            └───────────────────────────────────┘

Key traits:

  • Native Kubernetes API access (no CLI dependency)
  • In-cluster agent for real-time event streaming
  • Two transport modes: stdio (local) and TCP (remote)
  • Hardware detection via ethtool execution in containers
  • Dual language: Node.js primary, Python alternative

ptp-mcp-server — Architecture

┌─────────────────────────────────────────────────────────────────┐
│                     Claude Desktop / MCP Client                 │
└──────────────────────────┬──────────────────────────────────────┘
                           │ MCP Protocol (stdio)
                           ▼
┌─────────────────────────────────────────────────────────────────┐
│              MCP Server (Python — ptp_mcp_server.py)            │
│                                                                 │
│  ┌──────────────┐  ┌──────────────┐  ┌────────────────────┐    │
│  │ Config Parser│  │ Log Parser   │  │ NLQ Engine         │    │
│  │ (ptp_config_ │  │ (ptp_log_    │  │ (ptp_query_        │    │
│  │  parser.py)  │  │  parser.py)  │  │  engine.py)        │    │
│  └──────┬───────┘  └──────┬───────┘  └────────┬───────────┘    │
│         │                 │                    │                │
│  ┌──────┴─────────────────┴────────────────────┴──────────┐    │
│  │          subprocess.run("oc ...")  ← fragile            │    │
│  └────────────────────────┬───────────────────────────────┘    │
│                           │                                     │
│  ┌────────────────────────┴───────────────────────────────┐    │
│  │         PTP Data Models (ptp_model.py)                  │    │
│  │         • ClockType, BMCARole, SyncStatus enums         │    │
│  │         • ITU-T G.8275.1 compliance validation          │    │
│  │         • Clock hierarchy construction                  │    │
│  └────────────────────────────────────────────────────────┘    │
└───────────────────────────┼─────────────────────────────────────┘
                            │  oc CLI calls
                            ▼
            ┌───────────────────────────────────┐
            │  OpenShift Cluster                │
            │  ┌──────────────────────────┐     │
            │  │  PTP Operator            │     │
            │  │  ├── linuxptp-daemon     │     │
            │  │  ├── cloud-event-proxy   │     │
            │  │  └── PtpConfig CRDs      │     │
            │  └──────────────────────────┘     │
            └───────────────────────────────────┘

Key traits:

  • oc CLI subprocess calls (requires oc installed and authenticated)
  • Built-in NLQ engine with regex-based pattern matching
  • ITU-T G.8275.1 compliance validation (telecom-specific)
  • Richer data models (ClockType, BMCARole, SyncStatus)
  • No in-cluster component, no real-time events
  • stdio transport only

Feature-by-Feature Comparison

MCP Tools

Tool Category ptp-operator-mcp-server ptp-mcp-server
List/Discover PTP Pods list_ptp_pods — (implicit via oc)
Get PTP Config get_ptp_configs, get_ptp_config get_ptp_config
Get PTP Logs get_daemon_logs, get_proxy_logs get_ptp_logs, search_logs
Fault Analysis analyze_ptp_faults (severity scoring)
Metrics (Prometheus) get_ptp_metrics (port 9091)
Health Check check_ptp_status check_ptp_health
Grandmaster Status get_grandmaster_status
Sync Analysis analyze_sync_status (DPLL, offsets)
Clock Hierarchy get_clock_hierarchy
Natural Language Query — (relies on Claude LLM) query_ptp (built-in NLQ)
Hardware Detection get_hardware_info, list_ptp_interfaces, map_ptp_hardware, check_interface_ptp_support, get_nic_details
Command Execution exec_ptp_command
Event Monitoring monitor_ptp_events
Node PTP Devices get_node_ptp_configs
ITU-T Compliance Built into ptp_model.py

Infrastructure & Deployment

Aspect ptp-operator-mcp-server ptp-mcp-server
Dockerfiles 3 (server, agent, combined) None (draft PR adds 1)
K8s Manifests Full set (Deployment, Service, SA, RBAC) None (draft PR adds some)
RBAC ClusterRole with PTP-specific permissions None defined
Security Hardening Non-root user, read-only FS, dropped caps None
Transport Modes stdio + TCP/HTTP stdio only
In-Cluster Agent Yes (ptp_agent.py, port 8081) No
Container Registry
CI/CD None None
Tests Stubs only (npm test not implemented) Test files exist but require live cluster
Releases None None

Code Quality & Documentation

Aspect ptp-operator-mcp-server ptp-mcp-server
Documentation Excellent (README, CLAUDE.md, API docs) Good (README, testing guides, integration guide)
Error Handling try-catch with structured MCP responses Basic try-except
Cluster Interaction Native K8s API client subprocess.run("oc ...")
Code Size ~3,500 lines JS + ~1,000 lines Python ~2,500 lines Python
Modularity Monolithic JS file (3,449 lines) Well-separated modules (6 files)
Data Models Inline/ad-hoc Proper dataclasses and enums
Commit History 15 commits over 2.5 weeks 4 commits in 1 day

Gaps Analysis

Gaps in ptp-operator-mcp-server

Gap Impact Severity
No ITU-T G.8275.1 compliance validation Cannot validate telecom-standard compliance Medium
No built-in NLQ engine Entirely dependent on external LLM for query interpretation Low (by design)
No structured data models No enums for ClockType, BMCARole, SyncStatus Medium
No grandmaster-specific status tool Grandmaster health not surfaced as a dedicated tool Low
No clock hierarchy visualization Cannot show clock topology Low
No sync status analysis (DPLL, offsets, BMCA) Limited sync diagnostics Medium
Monolithic main file (3,449 lines) Hard to maintain, test, and review Medium
No tests Cannot verify correctness or catch regressions High
No CI/CD No automated quality gates High
Placeholder package.json author Minor but indicates incomplete packaging Low

Gaps in ptp-mcp-server

Gap Impact Severity
No native Kubernetes API access Fragile oc subprocess calls; breaks without oc CLI High
No in-cluster agent Cannot receive real-time PTP events High
No hardware detection Cannot detect PTP-capable NICs or clock devices High
No Prometheus metrics integration Missing the primary observability data source High
No fault analysis with severity scoring Cannot classify fault severity (HEALTHY → CRITICAL) Medium
No command execution tool Cannot run diagnostic commands in PTP containers Medium
No event monitoring Cannot track Kubernetes events for PTP resources Medium
No containerization (main branch) Cannot deploy in-cluster without manual setup High
No RBAC definitions No security model for cluster access Medium
No TCP/HTTP transport Cannot be deployed remotely; stdio only Medium
Stub analysis methods detect_sync_loss, get_offset_trend, analyze_timing_traceability return empty data Medium
__pycache__ committed to git Minor hygiene issue Low
Unused dependencies kubernetes, asyncio-mqtt listed but not used Low
Naive clock_class_fallback 250-entry dict mapping N→N+1; doesn't reflect real ITU-T degradation Medium
No tests runnable without live cluster Cannot run automated tests in CI High

Verdict: Which Is More Functional and Operational?

ptp-operator-mcp-server is clearly more functional and closer to operational.

Why:

  1. 2x more MCP tools (16+ vs 8), covering hardware, metrics, events, faults, and command execution.
  2. Native Kubernetes API vs fragile oc subprocess calls — works without CLI tools installed.
  3. In-cluster agent enables real-time event detection (<5 seconds) that ptp-mcp-server cannot do.
  4. Production deployment story — Dockerfiles, K8s manifests, RBAC, security hardening all exist.
  5. Hardware detection — can identify PTP-capable NICs (Intel ICE, Mellanox mlx5_core, Broadcom tg3).
  6. Prometheus metrics integration provides the primary observability data source.
  7. More active development — 15 commits over 2.5 weeks vs 4 commits in a single day.
  8. Multiple deployment modes — local stdio, remote TCP, fully containerized.

Where ptp-mcp-server is stronger:

  1. Better code structure — well-separated Python modules vs one 3,449-line JS file.
  2. ITU-T G.8275.1 compliance — validates telecom-standard configurations.
  3. Built-in NLQ engine — can classify natural language queries without external LLM.
  4. Richer data models — proper enums and dataclasses for PTP concepts.
  5. Grandmaster and clock hierarchy — dedicated tools for clock topology.
  6. External contributor interest — draft PR from alegacy adding OLS integration and significant enhancements.

Recommended Improvements

For ptp-operator-mcp-server (the more mature repo)

# Improvement Priority Description
1 Add unit tests Critical The npm test script is a stub. Add tests using Jest or Mocha with mocked K8s API responses. Without tests, no change can be made with confidence.
2 Split monolithic index.js High The 3,449-line file should be broken into modules: tools/, parsers/, agent/, transport/. This improves maintainability, testability, and code review.
3 Add CI/CD pipeline High Add GitHub Actions for linting (eslint), testing, and container image builds. Gate merges on passing tests.
4 Port ITU-T G.8275.1 validation from ptp-mcp-server Medium Telecom users need compliance validation. The ptp_model.py logic can be ported to JS or the Python server.
5 Add structured data models Medium Define TypeScript interfaces or classes for ClockType, BMCARole, SyncStatus instead of ad-hoc string comparisons.
6 Add grandmaster status tool Medium Port get_grandmaster_status and get_clock_hierarchy from ptp-mcp-server.
7 Add sync analysis tool Medium Port analyze_sync_status (DPLL, offsets, BMCA) from ptp-mcp-server.
8 Security: restrict exec_ptp_command Medium Currently allows arbitrary command execution in PTP containers. Add an allowlist of safe commands or require explicit user confirmation.
9 Add Helm chart Medium Replace raw K8s manifests with a Helm chart for configurable deployment (namespace, resources, RBAC, agent toggle).
10 Create GitHub releases with tags Low Despite claiming v1.0.0 in package.json, there are no git tags or releases. Adopt semantic versioning.
11 Fix package.json metadata Low Replace placeholder author ("Your Name <[email protected]>") with actual author info.
12 Add MCP resource notifications for DPLL Low Extend real-time notifications to cover DPLL state changes (relevant for 5G RAN).

For ptp-mcp-server (the earlier prototype)

# Improvement Priority Description
1 Replace oc subprocess with Kubernetes Python client Critical The kubernetes package is already a dependency but unused. Switch ptp_config_parser.py and ptp_log_parser.py to use kubernetes.client API. This eliminates the oc CLI dependency and makes the server portable to any K8s cluster.
2 Add in-cluster agent Critical Without real-time event subscription (via cloud-event-proxy), the server is limited to polling logs. Port the ptp_agent.py concept from ptp-operator-mcp-server.
3 Add hardware detection tools High Port get_hardware_info, list_ptp_interfaces, map_ptp_hardware from ptp-operator-mcp-server.
4 Add Prometheus metrics integration High PTP daemon exposes metrics on port 9091. Add a get_ptp_metrics tool to fetch and parse them.
5 Add fault analysis with severity scoring High Port analyze_ptp_faults from ptp-operator-mcp-server with HEALTHY/MINOR/MODERATE/CRITICAL classification.
6 Add Dockerfile and K8s manifests High The draft PR (#1) adds these — merge it. The server needs to be deployable in-cluster.
7 Implement stub methods High detect_sync_loss, get_offset_trend, analyze_timing_traceability return empty data. Implement them or remove them.
8 Add TCP/HTTP transport Medium stdio-only limits deployment to local Claude Desktop. Add SSE or streamable HTTP transport for remote deployment.
9 Fix clock_class_fallback mapping Medium The naive N→N+1 mapping doesn't reflect actual ITU-T G.8275.1 clock class degradation. Implement proper fallback rules per the standard.
10 Add RBAC definitions Medium Define a ClusterRole with minimum permissions needed for PTP monitoring.
11 Add unit tests with mocking High Current tests require a live cluster. Add pytest tests with unittest.mock to mock subprocess.run() and test parsers in isolation.
12 Remove __pycache__/ and add to .gitignore Low Compiled bytecode should not be in version control.
13 Clean up unused dependencies Low Remove kubernetes (if not switching to it) and asyncio-mqtt from requirements.txt, or implement their usage.
14 Add CI/CD pipeline High Add GitHub Actions for linting (ruff/flake8), testing, and container builds.

Cross-Repo Improvements (if consolidating)

# Improvement Priority Description
1 Consider merging into one repo High Both repos solve the same problem by the same author. Maintaining two creates fragmentation. The best path forward would be to merge ptp-mcp-server's strengths (data models, ITU-T validation, NLQ engine, code structure) into ptp-operator-mcp-server's more complete foundation.
2 Standardize on Python Medium The Python ecosystem has better MCP SDK support (mcp package), cleaner async patterns, and the telecom/PTP community is more Python-oriented. Consider making the Python implementation primary.
3 Add OpenShift Lightspeed (OLS) integration Medium The draft PR in ptp-mcp-server adds OLS "bring-your-knowledge" support. This should be a first-class feature in whichever repo survives.
4 Add multi-cluster support Low Both repos are single-cluster. For production telecom environments, multi-cluster PTP monitoring is essential.
5 Add a web dashboard Low Both README roadmaps mention this. A simple web UI for PTP status visualization would complement the MCP/AI interface.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment