Token导航 LogoToken导航TokenDH.com
Hinemos MCP logo
运维云端stdio官方级别未说明来源级核验

Hinemos MCP

MCP Server

Hinemos MCP Server是一个与Hinemos监控系统集成的服务器,提供节点状态检查、事件获取和作业执行等功能。

工具数

4

提示词数

0

GitHub Stars

0

资源数

0
PythonClaude云端部署Claude DesktopClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

shida2022

提供方

shida2022

最后核验

2026/5/17 20:20

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

pip install -r requirements.txt

详细介绍

Hinemos MCP Server 使用指南

安装过程

1.环境构筑

# リポジトリクローン
git clone /hinemos-mcp-server
cd hinemos-mcp-server

# 依存関係インストール
pip install -r requirements.txt

# 設定ファイル作成
cp .env.example .env
# .envファイルを編集してHinemos接続情報を設定

2. Hinemos接続设定

.env在文件中设置:

HINEMOS_BASE_URL=http://your-hinemos-server:8080/HinemosWS/
HINEMOS_USERNAME=your_username
HINEMOS_PASSWORD=your_password

3. Claude Desktop 协作

Claude Desktop 的配置文件(claude_desktop_config.json)中添加以下内容:

{
  "mcpServers": {
    "hinemos": {
      "command": "python",
      "args": ["/path/to/hinemos_mcp_server.py"],
      "env": {
        "HINEMOS_BASE_URL": "http://your-hinemos-server:8080/HinemosWS/",
        "HINEMOS_USERNAME": "your_username",
        "HINEMOS_PASSWORD": "your_password"
      }
    }
  }
}

可用功能

Tools(工具)

  1. check_node_status(节点id:str)

- 确认指定节点的监视状态 - 例: check_node_status("WEB-SERVER-01")

  1. get_critical_events(小时数:int=24)

- 获取重要事件 - 例: get_critical_events(12) #过去12时间

  1. execute_hinemos_job(job_id:str,target_node:str)

- Hinemos作业执行 - 例: execute_hinemos_job("BACKUP_JOB", "DB-SERVER-01")

  1. list_managed_nodes()

- 管理对象节点一览获取

Resources(资源)

  1. hinemos://monitor/status

- 当前监视状态

  1. hinemos://events/recent

- 最新事件信息

Prompts(提示

  1. 系统健康报告()

- 整个系统运行状况报告生成

  1. 偶发事件调查(event_id:str)

- 事故详细调查

使用例

Claude Desktop 使用示例

# ユーザー: システムの健全性レポートを作成してください

Claude: システム全体の健全性レポートを作成します。

[system_health_report() プロンプトを使用]
[check_node_status() で各ノードをチェック]
[get_critical_events() で重要なイベントを確認]

## システム健全性レポート

### 全体ステータス
- 総ノード数: 25台
- 正常稼働: 23台
- 警告状態: 2台
- エラー状態: 0台

### 重要なアラート
1. WEB-SERVER-02: CPU使用率 95% (警告)
2. DB-SERVER-01: ディスク使用率 88% (警告)

### 推奨アクション
1. WEB-SERVER-02のプロセス確認が必要
2. DB-SERVER-01のログクリーンアップ実行推奨

测试方法

1.连接测试

# test_connection.py
import asyncio
from hinemos_mcp_server import HinemosClient, HinemosConfig
import aiohttp

async def test_connection():
    config = HinemosConfig(
        base_url="http://localhost:8080/HinemosWS/",
        username="hinemos",
        password="hinemos123"
    )
    
    async with aiohttp.ClientSession() as session:
        client = HinemosClient(config, session)
        try:
            nodes = await client.get_node_list()
            print(f"接続成功: {len(nodes)} ノード取得")
        except Exception as e:
            print(f"接続エラー: {e}")

asyncio.run(test_connection())

2. MCP Inspector 测试

# MCP Inspectorを使用してサーバーをテスト
npx @modelcontextprotocol/inspector python hinemos_mcp_server.py

3.单体测试

# test_hinemos_mcp.py
import pytest
import asyncio
from unittest.mock import AsyncMock, MagicMock
from hinemos_mcp_server import HinemosClient, HinemosConfig

@pytest.fixture
def mock_session():
    session = AsyncMock()
    response = AsyncMock()
    response.text = AsyncMock(return_value='...')
    response.raise_for_status = MagicMock()
    session.post.return_value.__aenter__.return_value = response
    return session

@pytest.mark.asyncio
async def test_get_node_list(mock_session):
    config = HinemosConfig("http://test", "user", "pass")
    client = HinemosClient(config, mock_session)
    
    result = await client.get_node_list()
    assert result is not None
    mock_session.post.assert_called_once()

故障排除

常见问题

  1. 验证错误
   Error: 401 Unauthorized
   解決: HINEMOS_USERNAME と HINEMOS_PASSWORD を確認
  1. 连接超时
   Error: Connection timeout
   解決: HINEMOS_BASE_URL とネットワーク接続を確認
  1. SOAP 珀斯误差
   Error: XML parsing failed
   解決: Hinemosサーバーのレスポンス形式を確認

日志检查

# デバッグモードで実行
LOG_LEVEL=DEBUG python hinemos_mcp_server.py

Hinemos API 版本确认

# Hinemos WebService APIのWSDLを確認
curl http://your-hinemos-server:8080/HinemosWS/MonitorEndpoint?wsdl

自定义

添加新工具

@mcp.tool()
async def custom_monitoring_tool(parameter: str) -> List[TextContent]:
    """カスタム監視ツール"""
    ctx = mcp.get_context()
    client = HinemosClient(ctx.hinemos_config, ctx.session)
    
    # カスタムロジック実装
    result = await client.custom_api_call(parameter)
    
    return [TextContent(type="text", text=str(result))]

添加新资源

@mcp.resource("hinemos://custom/data")
async def get_custom_data() -> Resource:
    """カスタムデータリソース"""
    # カスタムデータ取得ロジック
    return Resource(
        uri="hinemos://custom/data",
        name="Custom Hinemos Data",
        description="Custom data from Hinemos",
        mimeType="application/```

目录标签

目录标签

PythonClaude云端部署监控系统本地部署节点管理事件处理作业执行

支持客户端

Claude DesktopClaude

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

session

工具数量(toolCount,工具数)

4

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdiosession部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

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

来源信息

继续浏览同类 MCP