Greenlake Audit Logs Mcp

io.github.HewlettPackard由 GitHub 账号 HewlettPackard 发布v1.1.2更新于 Oct 24, 2026

HPE GreenLake audit-logs MCP Server

发布方自己的服务:audit.domains - Domain Valuation

概览

AI 生成的概览

只读的 MCP 服务器,让 AI 助手通过平台 API 查询和分析 HPE GreenLake 审计日志。

可以做什么
  • 查询和分析审计日志,可按类别、用户和时间戳筛选,追踪用户活动与系统事件
  • 在动态模式下,通过三个通用元工具发现 API 端点、获取端点架构并执行调用
  • 使用 OAuth2 客户端凭据登录 HPE GreenLake,令牌缓存在内存中并自动刷新
适用场景
适用于使用 HPE GreenLake 的场景:希望助手调查工作区内谁做了什么,或在对话中直接查看审计事件以回答安全与合规问题。
运行要求
以 Python 包形式在本地通过 stdio 运行(需 Python 3.10 或更高版本及 uv 包管理器)。需要一个 HPE GreenLake 工作区及 API 凭据,通过环境变量提供:GREENLAKE_API_BASE_URL、GREENLAKE_CLIENT_ID、GREENLAKE_CLIENT_SECRET 和 GREENLAKE_WORKSPACE_ID。需要能访问 GreenLake API 的网络;MCP_TOOL_MODE 用于选择静态或动态工具模式。
安装前请注意
需要一个可访问工作区的 OAuth2 客户端密钥(GREENLAKE_CLIENT_SECRET),请勿提交到版本库或写入问题报告。文档称访问为只读且限定在配置的工作区内,但审计日志数据会发送给助手及模型提供方。可选的日志文件会写入本地日志目录。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Greenlake Audit Logs Mcp,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

HPE GreenLake MCP Servers

[License] [Python Versions] [Code style: ruff] [Security Policy] [CI Status]

A collection of Model Context Protocol (MCP) servers that enable AI assistants to interact with HPE GreenLake platform services.

Table of Contents

What is the Model Context Protocol?

The Model Context Protocol (MCP) is an open protocol that enables seamless integration between LLM applications and external data sources and tools. Whether you're building an AI-powered IDE, enhancing a chat interface, or creating custom AI workflows, MCP provides a standardized way to connect LLMs with the context they need.

What's in this Repository?

This repository contains production-ready MCP servers for HPE GreenLake platform services. Each server provides AI assistants with secure, read-only access to specific GreenLake APIs, enabling natural language interactions with your HPE infrastructure.

Key Features

  • Standardized Architecture: All servers follow consistent patterns for authentication, configuration, and error handling
  • OAuth2 Authentication: Secure access using HPE GreenLake workspace credentials with automatic token management
  • Dual Tool Modes: Each server supports both static (individual tools per endpoint) and dynamic (meta-tools) operation modes
  • Type-Safe: Built with Pydantic models for runtime validation and type safety
  • Production Ready: Comprehensive logging, error handling, and Docker support
  • Well Tested: Extensive unit and integration test coverage

Available MCP Servers

ServiceCategoryDescriptionKey Capabilities
DevicesInfrastructure & PlatformManage and query HPE GreenLake devices in your workspaceFilter by type, serial number, tags; retrieve device details by ID
WorkspacesInfrastructure & PlatformInteract with HPE GreenLake workspace management APIsList/query workspaces; retrieve details and configurations
SubscriptionsInfrastructure & PlatformAccess subscription information and licensing detailsView active subscriptions; query licensing; monitor subscription status
Audit LogsSecurity & ComplianceQuery and analyze HPE GreenLake audit logsFilter by category, user, timestamp; track user activities and system events
UsersUser & Access ManagementManage user accounts and access controlsList/query users; view permissions; monitor user activity
ReportingReporting & AnalyticsGenerate and retrieve reports on workspaces, devices, and subscriptionsCustomizable report types; async report tracking; date range and column filters
Service CatalogInfrastructure & PlatformAccess service catalog and provisioning informationView service offers, provisions, managers, manager-provisions and regions

Quick Start

Prerequisites

  • Python 3.10 or higher
  • uv package manager
  • HPE GreenLake workspace with API credentials

Configuration

All servers require the following HPE GreenLake credentials:

bash
export GREENLAKE_API_BASE_URL="https://global.api.greenlake.hpe.com"export GREENLAKE_CLIENT_ID="your-client-id"export GREENLAKE_CLIENT_SECRET="your-client-secret"export GREENLAKE_WORKSPACE_ID="your-workspace-id"

Running a Server

bash
# Navigate to a server directorycd src/audit-logs
# Install dependenciesuv sync
# Run the serveruv run python -m greenlake_audit_logs_mcp

MCP Client Configuration

Claude Desktop

Add servers to your claude_desktop_config.json:

json
{  "mcpServers": {    "greenlake-audit-logs": {      "command": "uv",      "args": ["run", "python", "-m", "greenlake_audit_logs_mcp"],      "cwd": "/path/to/gl-mcp/src/audit-logs",      "env": {        "GREENLAKE_API_BASE_URL": "https://global.api.greenlake.hpe.com",        "GREENLAKE_CLIENT_ID": "your-client-id",        "GREENLAKE_CLIENT_SECRET": "your-client-secret",        "GREENLAKE_WORKSPACE_ID": "your-workspace-id"      }    },    "greenlake-devices": {      "command": "uv",      "args": ["run", "python", "-m", "greenlake_devices_mcp"],      "cwd": "/path/to/gl-mcp/src/devices",      "env": {        "GREENLAKE_API_BASE_URL": "https://global.api.greenlake.hpe.com",        "GREENLAKE_CLIENT_ID": "your-client-id",        "GREENLAKE_CLIENT_SECRET": "your-client-secret",        "GREENLAKE_WORKSPACE_ID": "your-workspace-id"      }    }  }}

Other MCP Clients

These servers use the standard stdio transport and work with any MCP-compatible client. See individual server READMEs for specific configuration examples.

Tool Modes

All servers support two operation modes that can be switched at runtime using the MCP_TOOL_MODE environment variable:

Static Mode (Default)

  • Individual tools: Each API endpoint becomes a dedicated MCP tool
  • Type-safe: Explicit tool definitions with compile-time validation
  • Discoverable: Tools appear individually in MCP client interfaces
  • Best for: Smaller APIs and focused workflows
bash
export MCP_TOOL_MODE=static

Dynamic Mode

  • Meta-tools: 3 generic tools that can handle any API endpoint
    • list_endpoints - Discover available API endpoints
    • get_endpoint_schema - Get detailed schema information
    • invoke_dynamic_tool - Execute API calls with runtime validation
  • Memory efficient: Lower overhead for large APIs
  • Best for: Large APIs with many endpoints
bash
export MCP_TOOL_MODE=dynamic

Compatibility Matrix

Python VersionStatusNotes
3.12✅ SupportedRecommended
3.11✅ SupportedRecommended
3.10✅ SupportedMinimum version

Architecture Overview

High-Level Architecture

mermaid
flowchart TB    subgraph clients["<b> MCP Clients </b>"]        direction TB        claude["Claude Desktop"]        vscode["VS Code"]        other["..."]    end
    subgraph servers["<b> MCP Servers </b>"]        direction TB        audit["Audit Logs"]        devices["Devices"]        users["Users"]        workspaces["Workspaces"]        subscriptions["Subscriptions"]        reporting["Reporting"]        serviceX["..."]                subgraph shared["<i> Shared Components </i>"]            direction LR            oauth["OAuth2 Token Manager<br/>(with caching)"]        end    end
    subgraph platform["<b>&nbsp; HPE GreenLake Platform &nbsp;</b>"]        direction TB        api["APIs"]    end
    clients ==>|JSON-RPC/stdio| servers    servers ==>|HTTPS/REST + OAuth2| platform
    classDef clientStyle fill:#2196F3,stroke:none,color:#fff,rx:10,ry:10    classDef serverStyle fill:#4CAF50,stroke:none,color:#fff,rx:10,ry:10    classDef authStyle fill:#FF9800,stroke:none,color:#fff,rx:10,ry:10    classDef platformStyle fill:#01a982,stroke:none,color:#fff,rx:10,ry:10    classDef clientContainerStyle fill:none,stroke:#2196F3,stroke-width:3px,rx:15,ry:15    classDef serverContainerStyle fill:none,stroke:#4CAF50,stroke-width:3px,rx:15,ry:15    classDef authContainerStyle fill:none,stroke:#FF9800,stroke-width:2px,stroke-dasharray:5 5,rx:10,ry:10    classDef platformContainerStyle fill:none,stroke:#01a982,stroke-width:3px,rx:15,ry:15        class claude,vscode,other clientStyle    class audit,devices,users,workspaces,subscriptions,reporting,serviceX serverStyle    class oauth authStyle    class api platformStyle    class clients clientContainerStyle    class servers serverContainerStyle    class shared authContainerStyle    class platform platformContainerStyle

Request Flow

  1. Client Request: MCP client sends tool invocation via JSON-RPC over stdio
  2. Authentication: Server authenticates with HPE GreenLake using OAuth2 (tokens cached and auto-refreshed)
  3. API Call: Server makes authenticated HTTPS request to GreenLake API
  4. Response: Server processes response and returns data to client via MCP protocol

Shared Components

All servers share a common architecture:

text
src/<service>/├── greenlake_<service>_mcp/   # Main package (e.g. greenlake_audit_logs_mcp)│   ├── __main__.py            # Entry point (python -m greenlake_<service>_mcp)│   ├── auth/                  # OAuth2 authentication│   ├── config/                # Settings and logging│   ├── models/                # Pydantic data models│   ├── server/                # MCP server core│   ├── tools/                 # Tool implementations│   │   ├── base.py           # Base tool class│   │   ├── registry.py       # Tool registration│   │   └── implementations/  # Tool implementations│   └── utils/                 # HTTP client and utilities├── tests/                     # Unit and integration tests└── pyproject.toml             # Package definition and entry points

Authentication

All servers use OAuth2 client credentials flow with automatic token management:

  • Tokens are cached and automatically refreshed
  • Thread-safe token management
  • Configurable retry logic with exponential backoff

Logging

Servers use structured logging with MCP protocol compliance:

  • stderr: Diagnostic logs (controlled by GREENLAKE_LOG_LEVEL)
  • File logging: Optional detailed logging to ~/.hpe/mcp-logs/
  • stdout: Reserved for JSON-RPC messages only

Security Considerations

  • Read-Only Access: All servers provide read-only API access by design
  • Credential Management: Never commit credentials to version control
  • Token Security: OAuth2 tokens are cached in memory only
  • Workspace Isolation: Operations are scoped to the configured workspace
  • HTTPS Only: All API communications use TLS encryption

Troubleshooting

Common Issues

Server won't start:

  • Verify all required environment variables are set
  • Check that uv is installed and dependencies are synced
  • Review stderr output for configuration errors

Authentication failures:

  • Verify client credentials are valid for your workspace
  • Ensure GREENLAKE_WORKSPACE_ID matches your credential scope
  • Check network connectivity to GreenLake APIs

MCP client connection issues:

  • Verify the cwd path in client configuration is correct
  • Check that the server starts successfully when run manually
  • Review client logs for specific error messages

Debug Logging

Enable detailed logging for troubleshooting:

bash
export GREENLAKE_LOG_LEVEL=DEBUGexport GREENLAKE_FILE_LOGGING=true

Log files are written to: ~/.hpe/mcp-logs/{service-name}/

Getting Help

GitHub Issues

The primary support channel for this project is GitHub Issues. When reporting an issue, please include:

  • Environment details: OS, Python version, uv version
  • Server name: Which MCP server you're using (audit-logs, devices, etc.)
  • Error messages: Complete error output with stack traces
  • Configuration: Relevant environment variable settings (DO NOT include credentials)
  • Steps to reproduce: Detailed description of how to reproduce the issue

Before Opening an Issue

  1. Check existing issues: Search open and closed issues
  2. Review troubleshooting: Check the Troubleshooting section above
  3. Enable debug logging: Run with GREENLAKE_LOG_LEVEL=DEBUG and GREENLAKE_FILE_LOGGING=true to gather detailed logs
  4. Test authentication: Verify your credentials work with the GreenLake APIs directly

Issue Types

  • Bug Report: For unexpected behavior, errors, or crashes
  • Feature Request: For suggesting new capabilities or improvements
  • Question: For clarification on usage, configuration, or architecture
  • Documentation: For reporting documentation issues or suggesting improvements

Resources

License

This project is licensed under the Apache 2.0 - see the LICENSE file for details.

来源:README.md,提交 83dc9ca

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v1.1.2最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

其他 Audit 集成