Token导航 LogoToken导航

MCP Server · 运维云端

PTP MCP Server

用于监控和分析OpenShift集群中精确时间协议(PTP)系统的模型上下文协议(MCP)服务器,提供配置分析、实时日志监控、自然语言查询和健康检查等功能。

stdio官方级别未说明来源级核验工具 8
Python网络监控云端部署

快速开始

作者 / 组织
aneeshkp
提供方
aneeshkp
运行时
Python

工具数量

8

来源目录标注

资源数量

0

来源目录标注

提示词数量

0

来源目录标注

GitHub Star

1

仓库热度

收录来源

3 个

MCP World

选型结论

PTP MCP Server 属于运维云端类 MCP Server,公开资料标注 8 个工具,通过stdio 本地进程接入,客户端适配情况以官方文档为准,有可以直接复制的安装命令;接入前先确认权限范围。

分类

运维云端

传输方式

stdio

认证方式

无需认证

部署方式

公开资料未说明

安装与配置

安装命令

pip install -r requirements.txt

公开命令不是通用的启动方式,拼不出可靠配置示例;请在客户端 MCP 配置里按官方文档填写 command 和 args。

上手步骤

  1. 1

    准备运行环境

    stdio 服务在本地起进程,需要先装好 Python,再按安装命令拉取依赖。

  2. 2

    安装服务

    复制下面的安装命令执行;命令里带占位符的位置换成自己的密钥或路径。

  3. 3

    写入客户端配置

    在客户端的 MCP 配置里填启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4

    验证是否可用

    连接成功后客户端会列出 8 个工具,随便调一个只读工具确认能返回结果。

接入前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

详细介绍

PTP MCP服务器

模型上下文协议(MCP)服务器,用于监控和分析OpenShift集群中的精确时间协议(PTP)系统。

🚀 特性

  • PTP配置分析:从OpenShift解析和验证PTP配置
  • 实时日志监控:使用智能解析访问linuxptp守护进程日志
  • 自然语言查询:用简单的英语询问有关PTP状态的问题
  • 健康监测:全面的PTP系统健康检查
  • 同步分析:监视同步状态、偏移和BMCA状态
  • 时钟层次结构:跟踪特级大师和时钟层次信息
  • ITU-T合规性:根据ITU-T G.8275.1标准验证配置

📋 先决条件

  • Python 3.8或更高版本
  • OpenShift命令行界面(oc)已安装并配置
  • 在安装了PTP操作员的情况下访问OpenShift集群
  • PTP命名空间(openshift-ptp)存在

🛠️ 安装

  1. 克隆存储库:
   git clone https://github.com/aneeshkp/ptp-mcp-server.git
   cd ptp-mcp-server
  1. 安装依赖项:
   pip install -r requirements.txt
  1. 验证OpenShift访问权限:
   oc whoami
   oc get namespace openshift-ptp

🧪 快速测试

运行综合测试套件:

python quick_test.py

预期产量:

🔍 PTP MCP Server API Quick Test
==================================================
Tests Passed: 8/8
Success Rate: 100.0%
🎉 ALL TESTS PASSED! Your API is ready for agent integration.

📚 API终点

1.配置API

from ptp_tools import PTPTools
tools = PTPTools()
result = await tools.get_ptp_config({"namespace": "openshift-ptp"})

2.日志API

result = await tools.get_ptp_logs({"lines": 1000})

3.搜索API

result = await tools.search_logs({"query": "dpll", "time_range": "last_hour"})

4.卫生API

result = await tools.check_ptp_health({"check_config": True, "check_sync": True})

5.自然语言API

result = await tools.query_ptp({"question": "What is the current grandmaster?"})

6、特级大师状态API

result = await tools.get_grandmaster_status({"detailed": True})

7.同步状态API

result = await tools.analyze_sync_status({"include_offsets": True})

8.时钟层次结构API

result = await tools.get_clock_hierarchy({"include_ports": True})

🚀 使用示例

基本健康检查

import asyncio
from ptp_tools import PTPTools

async def check_health():
    tools = PTPTools()
    health = await tools.check_ptp_health({})
    
    if health["success"]:
        print(f"Status: {health['overall_status']}")
        for check_name, result in health["checks"].items():
            print(f"{check_name}: {result}")
    else:
        print(f"Error: {health.get('error')}")

asyncio.run(check_health())

自然语言查询

async def ask_question():
    tools = PTPTools()
    response = await tools.query_ptp({
        "question": "What is the current grandmaster?"
    })
    
    if response["success"]:
        print(f"Answer: {response['response']}")
    else:
        print(f"Error: {response.get('error')}")

asyncio.run(ask_question())

日志分析

async def analyze_logs():
    tools = PTPTools()
    
    # Get recent logs
    logs = await tools.get_ptp_logs({"lines": 500})
    
    # Search for specific events
    sync_loss = await tools.search_logs({"query": "sync loss"})
    clock_changes = await tools.search_logs({"query": "clockClass change"})
    
    print(f"Total logs: {logs['logs_count']}")
    print(f"Sync loss events: {sync_loss['matching_logs']}")
    print(f"Clock changes: {clock_changes['matching_logs']}")

asyncio.run(analyze_logs())

🔧 MCP服务器

启动MCP服务器以与MCP兼容客户端集成:

python ptp_mcp_server.py

服务器提供以下MCP工具:

  • get_ptp_config -获取PTP配置
  • get_ptp_logs -获取linuxptp守护进程日志
  • search_logs -在日志中搜索模式
  • get_grandmaster_status -获取特级大师信息
  • analyze_sync_status -分析同步状态
  • get_clock_hierarchy -获取时钟层次结构
  • check_ptp_health -全面健康检查
  • query_ptp -自然语言界面

📊 演出

  • 平均响应时间:0.78秒
  • API最快:配置API(0.22s)
  • 并行操作:2.45秒成功4/4
  • 成功率:100%(8/8个终点)

🏗️ 建筑

ptp-mcp-server/
├── ptp_mcp_server.py      # Main MCP server
├── ptp_config_parser.py   # PTP configuration parser
├── ptp_log_parser.py      # Linuxptp log parser
├── ptp_model.py           # PTP data models
├── ptp_query_engine.py    # Natural language query engine
├── ptp_tools.py           # API endpoint implementations
├── quick_test.py          # Quick test suite
├── performance_test.py    # Performance benchmarking
└── requirements.txt       # Python dependencies

🔍 支持PTP概念

  • BMCA(最佳主时钟算法):时钟选择和层次结构
  • 时钟类型:OC(普通时钟)、BC(边界时钟)、TC(透明时钟)
  • 国际电联第8275.1号:配置文件合规性和验证
  • 同步:偏移跟踪、频率调整、同步状态
  • 国际象棋特级大师:主要时间源标识和状态
  • 时钟类:质量和可追溯性指标
  • 域名:PTP域配置(ITU-T为24-43)

🧪 测试

运行所有测试

python quick_test.py

性能测试

python performance_test.py

单个组件测试

# Test configuration parser
python -c "from ptp_config_parser import PTPConfigParser; import asyncio; asyncio.run(PTPConfigParser().get_ptp_configs())"

# Test log parser
python -c "from ptp_log_parser import PTPLogParser; import asyncio; asyncio.run(PTPLogParser().get_ptp_logs())"

📖 文档

🤝 贡献

  1. 分叉存储库
  2. 创建要素分支(git checkout -b feature/amazing-feature)
  3. 提交您的更改(git commit -m 'Add amazing feature')
  4. 推到分支(git push origin feature/amazing-feature)
  5. 打开拉取请求

📄 许可证

此项目根据MIT许可证获得许可-请参阅 许可证 文件以获取详细信息。

🙏 致谢

  • OpenShift PTP操作员团队
  • Linuxptp项目
  • 模型上下文协议(MCP)社区

📞 支持

对于问题和疑问:

______________________________________________________________________

状态: ✅ 生产就绪\ 最后更新:2025年1月\ 版本: 1.0.0

工具与能力

工具数量

8

资源数量

0

提示词数量

0

能力标签

时间同步Python本地部署网络监控OpenShift工具PTP分析日志解析

数量来自来源目录的标注,具体工具清单以官方文档为准。

典型使用场景

看服务状态

查询容器、日志和监控指标,定位异常。

执行部署变更

在权限范围内触发发布、回滚和环境切换。

核对资源用量

汇总用量,找出闲置和超额的部分。

选择建议

值得选的地方

  • 只提供 8 个工具,职责集中,接入后不容易误操作。
  • 有现成的安装命令,不用自己找入口,照着跑就能起服务。
  • 3 个目录同时收录,信息可以交叉核对。

先想清楚的地方

  • stdio 方式要求本地装好 Python,换机器要重新装一遍。
  • 第三方目录整理,版本更新和行为细节以官方仓库为准。

更适合

  • 需要在运维云端场景里让模型直接调用外部能力的人。
  • 想先快速试一下、能接受在本地跑服务的人。

不太适合

  • 完全不想在本地装环境的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

5 个同类
MCP Server工具数传输方式安装命令收录来源最后核验
PTP MCP Server

MCP World · 本页

8stdio有3 个2026-05-17
Ui Tars Desktop 8a825770

MCP World

0stdio有1 个2026-05-17
Elie222 MCP

MCP World

0未说明未标注1 个2026-05-17
Arizeai Phoenix MCP

MCP World

0stdio有3 个2026-05-17
Unity MCP 87ee506e

MCP World

42HTTP有2 个2026-05-17

按同分类和工具数量挑出最接近的几条,字段以各自详情页为准。

常见问题

5 条

PTP MCP Server 怎么安装?

公开资料给出的安装命令是 pip install -r requirements.txt,运行环境为 Python。装完后按客户端要求写进 MCP 配置,重启客户端生效。

PTP MCP Server 怎么在 Claude Desktop、Cursor 里配置?

它是stdio 本地进程,客户端配置里要写启动命令和参数,运行环境是 Python;保存后完全退出客户端再打开,配置才会生效。

PTP MCP Server 收费吗?

本站只整理公开资料,不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

PTP MCP Server 需要 API Key 吗?

公开资料标注为无需认证,装好就能连;如果实际调用时报鉴权错误,按官方文档补上凭据。

PTP MCP Server 支持哪些客户端?

公开资料没有标注具体客户端;能配置本地 MCP 命令的客户端都能接,配置方式参照官方文档。

来源信息

继续浏览同类 MCP