Skip to main content
Glama

MCP Ambari API

Manage and inspect Apache Ambari clusters from Claude Desktop, OpenWebUI, or any MCP client.

License: MIT PyPI Docker Pulls

MCP Ambari API turns common Hadoop operations into MCP tools. It can inspect cluster health, services, hosts, alerts, configurations, requests, and Ambari Metrics data, and can perform service operations with safety guidance for high-impact actions.

Example requests:

  • “Show the current status of every service.”

  • “List critical Ambari alerts and their affected hosts.”

  • “Generate an HDFS capacity report.”

  • “Find NameNode heap metrics available in AMS.”

  • “Restart HDFS after showing me the affected components.”

More requests to try: see Example queries by area for cluster and services, service operations, requests and tasks, hosts, configurations, users, alerts, and metrics.

Quick start

Choose one installation method. MCPB is the shortest path for Claude Desktop; Docker Compose provides the full OpenWebUI, MCP server, and optional MCPO stack.

Claude Desktop with MCPB

Prerequisites:

  • Claude Desktop for macOS or Windows with MCPB extension support

  • Network access from the desktop to the Ambari server and, when used, the Ambari Metrics collector

  1. Download mcp-ambari-api-<version>.mcpb from the latest GitHub Release.

  2. In Claude Desktop, open Settings → Extensions → Advanced settings → Install Extension….

  3. Select the downloaded bundle.

  4. Enter the Ambari host, port, username, password, cluster name, and Metrics collector settings. The password is declared as a sensitive field.

  5. Ask a read-only verification question such as “Show the Ambari cluster status.”

The bundle uses stdio transport, uv, and Python 3.12; it does not expose a listening port. MCPB settings are stored by the desktop host and are not written into this repository.

OpenWebUI with Docker Compose

Prerequisites:

  • Docker Engine with Docker Compose

  • A reachable Ambari cluster

  • An OpenWebUI model provider and a model that supports tool calling

git clone https://github.com/call518/MCP-Ambari-API.git
cd MCP-Ambari-API
cp .env.example .env
cp mcp-config.json.http mcp-config.json.http.local
chmod 600 .env mcp-config.json.http.local

Edit .env with the Ambari connection values. If remote MCP authentication is enabled, replace <REMOTE_SECRET_KEY> in both .env and mcp-config.json.http.local with the same strong secret.

docker compose up -d
docker compose ps

Default host endpoints:

Service

URL

Purpose

OpenWebUI

http://localhost:3001

Chat interface

MCP server

http://localhost:18001/mcp

Direct Streamable HTTP MCP

MCPO

http://localhost:8001/mcp-ambari-api/docs

Optional OpenAPI compatibility layer

The published ports bind to 127.0.0.1 by default. Set DOCKER_BIND_ADDRESS only when remote access is required, and enable authentication plus TLS at the network boundary before exposing the services.

Configure OpenWebUI

Open http://localhost:3001, create the administrator account, and configure a model provider under Settings → Admin → Connections. For OpenAI, add a connection with these values:

Field

Value

URL

https://api.openai.com/v1

Auth

Bearer

API key

Your OpenAI API key

API Type

Chat Completions

Chat Completions must be used with the Quick Start's default DEFAULT_MODEL_PARAMS={"reasoning_effort":"none"} setting. To use an OpenAI reasoning model with reasoning enabled instead, set DEFAULT_MODEL_PARAMS={} before the first start, select Responses, and leave Reasoning Effort at Default in the global, per-model, and chat settings. Mixing Responses with reasoning_effort=none, or Chat Completions with another reasoning effort, can cause tool calls to fail.

Confirm that the model appears in a new chat, then add one of the following external tool-server connections under Settings → Admin → Tools → Integrations.

Option A: Direct MCP (recommended)

Add a connection of type MCP (Streamable HTTP) using the URL visible from the OpenWebUI container:

http://mcp-server:8000/mcp

Use http://localhost:18001/mcp only from a client running on the Docker host. Use authentication None unless REMOTE_AUTH_ENABLE=true; when authentication is enabled, use Bearer with the configured REMOTE_SECRET_KEY.

Option B: MCPO (OpenAPI)

Add a connection of type OpenAPI with this URL:

http://mcpo-proxy:8000/mcp-ambari-api

MCPO is not required for OpenWebUI; it remains in the standard stack for OpenAPI-compatible clients. Use the Compose service URLs above rather than localhost because OpenWebUI resolves them from inside its container.

To start without MCPO:

docker compose up -d mcp-server open-webui

Other installation methods

PyPI with uvx

{
  "mcpServers": {
    "mcp-ambari-api": {
      "command": "uvx",
      "args": ["--python", "3.12", "mcp-ambari-api"],
      "env": {
        "AMBARI_HOST": "ambari.example.com",
        "AMBARI_PORT": "8080",
        "AMBARI_USER": "<AMBARI_USER>",
        "AMBARI_PASS": "<AMBARI_PASSWORD>",
        "AMBARI_CLUSTER_NAME": "<AMBARI_CLUSTER_NAME>",
        "MCP_LOG_LEVEL": "INFO"
      }
    }
  }
}

Remote Streamable HTTP

{
  "mcpServers": {
    "mcp-ambari-api": {
      "type": "streamable-http",
      "url": "https://mcp.example.com/mcp",
      "headers": {
        "Authorization": "Bearer <REMOTE_SECRET_KEY>"
      }
    }
  }
}

Related MCP server: Ambari MCP Server

Capabilities

  • Cluster, service, component, host, request, user, alert, and configuration inspection

  • Service, all-services, and host component start, stop, and restart

  • HDFS dfsadmin-style capacity and DataNode reports

  • Live Ambari Metrics metadata discovery and exact-name time-series queries

  • stdio and Streamable HTTP transports

  • Optional bearer authentication for Streamable HTTP

Cross-tool safety and reporting rules are sent to clients as MCP server instructions from server_instructions.md. Tool availability can evolve, so MCP clients should use tools/list rather than relying on a copied static tool list.

Read and write tools

Kind

Name prefix

MCP annotations

Tag

Behavior

Read

get_*

readOnlyHint: true

read

Sends only GET requests to Ambari and AMS

Write

set_*

readOnlyHint: false, destructiveHint: true

write

Changes cluster state

Write tools take action = start, stop, or restart: set_service_state, set_all_services_state, and set_host_component_state. Read-only mode is on by default: write tools are not listed and calls to them are rejected. To enable write tools, set MCP_READ_ONLY=false or pass --read-write; in Claude Desktop (MCPB), turn off Read-only mode.

Configuration

CLI arguments take precedence over environment variables, which take precedence over defaults.

Server settings

Variable

Default

Description

FASTMCP_TYPE

stdio

stdio or streamable-http

FASTMCP_HOST

127.0.0.1

HTTP bind address

FASTMCP_PORT

8000

HTTP listen port

MCP_LOG_LEVEL

INFO

Log level

REMOTE_AUTH_ENABLE

false

Enable HTTP bearer authentication

REMOTE_SECRET_KEY

empty

Required when authentication is enabled

MCP_READ_ONLY

true

Expose only read tools (get_*); hide write tools (set_*). Only false/0/no/off enables write tools; empty or unrecognized values keep read-only mode

CLI equivalents are --type, --host, --port, --auth-enable / --auth-disable, --secret-key, and --read-only / --read-write.

Ambari settings

Variable

Default

Description

AMBARI_HOST

localhost

Ambari server host

AMBARI_PORT

8080

Ambari server port

AMBARI_USER

admin

Ambari username

AMBARI_PASS

admin

Ambari password

AMBARI_CLUSTER_NAME

c1

Default target cluster

AMBARI_METRICS_HOST

Ambari host

Metrics collector host

AMBARI_METRICS_PORT

6188

Metrics collector port

AMBARI_METRICS_PROTOCOL

http

Metrics collector protocol

AMBARI_METRICS_TIMEOUT

10

Metrics request timeout in seconds

Metrics workflow

Ambari metric names are exact identifiers rather than natural-language labels. Use this sequence:

  1. Call get_ambari_metric_apps to discover valid app IDs.

  2. Call get_common_metrics_catalog or get_ambari_metrics_metadata to find an exact metric name.

  3. Call get_ambari_metrics with an explicit app_id and exact metric name.

Example:

get_ambari_metrics(
  metric_names="jvm.JvmMetrics.MemHeapUsedM",
  app_id="namenode",
  duration="1h",
  group_by_host=true
)

Safety and security

  • Keep .env and mcp-config.json.http.local outside Git. The tracked files contain placeholders only.

  • Use a unique, strong REMOTE_SECRET_KEY; never reuse an Ambari password as the MCP bearer token.

  • Plain HTTP does not protect credentials in transit. Use a TLS reverse proxy for remote access.

  • Keep unauthenticated development services bound to localhost.

  • Write tools are disabled by default. Enable them (MCP_READ_ONLY=false) only where service operations are needed, and review set_* tool calls (start, stop, restart) before approving them in the MCP client.

Compatibility

  • Python 3.12.x

  • MCP stdio and Streamable HTTP transports

  • Claude Desktop MCPB through the UV runtime

  • Docker Compose stack with OpenWebUI 0.13.3

  • Apache Ambari environments that expose the Ambari REST API; exact behavior can vary by Ambari and Hadoop component version

Troubleshooting

OpenAI reasoning model rejects tool calls

The connection's API Type and Reasoning Effort must match:

Setup

API Type

Reasoning Effort

Quick Start default

Chat Completions

none

Reasoning with tools

Responses

Default in every scope

The Compose example seeds the Quick Start default into OpenWebUI with:

DEFAULT_MODEL_PARAMS={"reasoning_effort":"none"}

OpenWebUI stores this value in its database on first startup. For an existing open-webui-data volume, set Reasoning Effort to none in the Admin UI or per-model settings instead. Per-chat settings can override both. Do not delete the data volume as a troubleshooting shortcut. If using Responses, remove the parameter from the global, per-model, and chat settings and leave Reasoning Effort at Default. Remove the global parameter if the selected provider does not support it.

MCPO returns 401 Unauthorized

Check, without printing the secret itself:

  1. REMOTE_AUTH_ENABLE in .env.

  2. Whether REMOTE_SECRET_KEY is set.

  3. Whether mcp-config.json.http.local still contains the placeholder.

  4. Whether its bearer token matches the server secret.

  5. Whether the MCPO container was recreated after the change.

An error emitted while cleaning up the connection can follow the initial 401; diagnose the first HTTP error first.

Direct MCP works but MCPO fails

These are separate client paths. Verify the direct endpoint http://mcp-server:8000/mcp and the MCPO-mounted local config independently.

Ambari connection fails

Verify host reachability from the process or container, Ambari credentials, cluster name spelling, and the server port. localhost inside a container is the container itself; use host.docker.internal for a service on the Docker host.

Development

Install and run with the existing uv project:

uv sync --dev
uv run ruff check src tests scripts
uv run pytest

Run MCP Inspector against local source:

./run-mcp-inspector-local.sh

Build a local MCPB using a canonical semantic version:

scripts/build-mcpb.sh 0.0.0 /tmp/mcp-ambari-api-mcpb
unzip -l /tmp/mcp-ambari-api-mcpb/mcp-ambari-api-0.0.0.mcpb

Tagged releases build the wheel, source distribution, and MCPB. Publication to TestPyPI and PyPI completes before the GitHub Release is created with the MCPB attached.

Contributing

Keep changes focused, add tests for behavior changes, and verify documentation commands against the current configuration. Open an issue before making a breaking public API or configuration change.

License

MIT

Available Tools

20 tools
get_active_requestsA
Read-only

Retrieves currently active (in progress) requests/operations in an Ambari cluster. Shows running operations, in-progress tasks, pending requests.

[Tool Role]: Dedicated tool for monitoring currently running Ambari operations

[Core Functions]:

  • Retrieve active/running Ambari operations (IN_PROGRESS, PENDING status)

  • Show real-time progress of ongoing operations

  • Monitor current cluster activity

[Required Usage Scenarios]:

  • When users ask for "active requests", "running operations", "current requests"

  • When users ask for "request list", "operation list", "task list"

  • When users want to see "current tasks", "running tasks", "in progress operations"

  • When users mention "running", "in progress", "current activity"

  • When users ask about Ambari requests, operations, or tasks

  • When checking if any operations are currently running

Returns: Active requests information (success: active request list, failure: error message)

Inputs: no named parameters. Returns: result

get_alerts_historyA
Read-only

Retrieve current alerts or alert history from Ambari cluster.

[Tool Role]: Unified tool for retrieving both current/active alert status and historical alert events from Ambari cluster

[Core Functions]:

  • Current mode: Retrieve current alerts for entire cluster, specific service, or specific host

  • History mode: Retrieve alert history for entire cluster, specific service, or specific host

  • Support filtering by alert state (CRITICAL, WARNING, OK, UNKNOWN)

  • Support filtering by definition name

  • Current mode: Support filtering by maintenance state (ON, OFF)

  • History mode: Support filtering by time range with from_timestamp/to_timestamp

  • Support different output formats (detailed, summary, compact, groupedSummary for current)

  • History mode: Provide pagination support for large datasets

  • Provide current time context for LLM natural language time calculations

[Required Usage Scenarios]:

  • Current mode: When users request current alerts, active alerts, or alert status

  • Current mode: When monitoring immediate cluster health

  • Current mode: When investigating current issues or troubleshooting active problems

  • History mode: When users request alert history, past alerts, or historical alert data

  • History mode: When monitoring alert trends or analyzing alert patterns

  • History mode: When investigating past alert incidents or troubleshooting

  • When users mention alert status, current problems, cluster health, alert events, alert timeline, or alert logs

Inputs: mode, limit, format, host_name, +10 more. Returns: result

get_ambari_metric_appsGet Ambari Metric AppsB
Read-only

Return discovered AMS appIds, optionally with metric counts.

Inputs: limit, refresh, include_counts. Returns: result

get_ambari_metricsGet Ambari MetricsC
Read-only

Fetch time-series metrics (exact metric names only) from Ambari Metrics.

Inputs: metric_names (required), app_id, duration, end_time, +8 more. Returns: result

get_ambari_metrics_metadataGet Ambari Metrics MetadataC
Read-only

Retrieve metric metadata from Ambari Metrics service with optional filters.

Inputs: limit, app_id, search, host_filter, +2 more. Returns: result

get_cluster_infoA
Read-only

Retrieves basic information for an Ambari cluster.

[Tool Role]: Dedicated tool for real-time retrieval of overall status and basic information for an Ambari cluster.

[Core Functions]:

  • Retrieve cluster name, version, provisioning state, and security type

  • Provide formatted output for LLM automation and cluster monitoring

[Required Usage Scenarios]:

  • When users request cluster info, status, or summary

  • When monitoring cluster health or auditing cluster properties

  • When users mention cluster overview, Ambari cluster, or cluster details

Returns: Cluster basic information (success: formatted info, failure: English error message)

Inputs: no named parameters. Returns: result

get_cluster_servicesA
Read-only

Retrieves the list of services with status in an Ambari cluster.

[Tool Role]: Dedicated tool for real-time retrieval of all running services and basic status information in an Ambari cluster

[Core Functions]:

  • Retrieve cluster service list with status via Ambari REST API

  • Provide service names, current state, and cluster information

  • Include detailed link information for each service

  • Display visual indicators for service status

[Required Usage Scenarios]:

  • When users mention "service list", "cluster services", "Ambari services"

  • When cluster status check is needed

  • When service management requires current status overview

  • When real-time cluster information is absolutely necessary

[Absolutely Prohibited Scenarios]:

  • General Hadoop knowledge questions

  • Service installation or configuration changes

  • Log viewing or performance monitoring

  • Requests belonging to other cluster management tools

Returns: Cluster service list with status information (success: service list with status, failure: error message)

Inputs: no named parameters. Returns: result

get_common_metrics_catalogGet Common Metrics CatalogC
Read-only

List supported metrics per appId (exact names only).

Inputs: limit, app_id, search, min_score, +1 more. Returns: result

get_configurationsGet ConfigurationsC
Read-only

Unified configuration introspection tool (supersedes list_configurations & dump_all_configurations).

Inputs: limit, filter, max_chars, summarize, +3 more. Returns: result

get_current_alertsA
Read-only

Retrieve current alerts from Ambari cluster.

DEPRECATED: This function is deprecated in favor of get_alerts_history with mode="current". This wrapper is maintained for backward compatibility.

Inputs: format, host_name, cluster_name, service_name, +3 more. Returns: result

get_hdfs_dfsadmin_reportGet HDFS DFSAdmin ReportB
Read-only

Produce a DFSAdmin-style capacity and DataNode report using Ambari metrics.

Inputs: cluster_name, lookback_minutes. Returns: result

get_host_detailsA
Read-only

Retrieves detailed information for a specific host or all hosts in the Ambari cluster.

[Tool Role]: Dedicated tool for retrieving comprehensive host details including metrics, hardware info, and components.

[Core Functions]:

  • If host_name provided: Query specific host information

  • If host_name not provided: Query all hosts and their detailed information

  • Return host hardware specs, state, metrics, and assigned components

  • Provide formatted output for LLM automation and cluster management

[Required Usage Scenarios]:

  • When users request specific host details or host status

  • When users request all hosts details or cluster-wide host information

  • When auditing or monitoring individual or all cluster nodes

  • When troubleshooting host-specific issues

Inputs: host_name. Returns: result

get_hostsB
Read-only

Retrieves the list of hosts in the Ambari cluster.

[Tool Role]: Dedicated tool for listing all hosts registered in the Ambari cluster.

[Core Functions]:

  • Query Ambari REST API for host list

  • Return host names and API links

  • Provide formatted output for LLM automation and cluster management

[Required Usage Scenarios]:

  • When users request cluster host list or host details

  • When auditing or monitoring cluster nodes

Returns: List of hosts (success: formatted list, failure: error message)

Inputs: no named parameters. Returns: result

get_request_statusA
Read-only

Retrieves the status and progress of a specific Ambari request operation.

[Tool Role]: Dedicated tool for real-time tracking and reporting of Ambari request status.

[Core Functions]:

  • Query the status, progress, and context of a request by its ID

  • Provide detailed status (PENDING, IN_PROGRESS, COMPLETED, FAILED, etc.)

  • Show progress percentage and timing information

  • Return actionable status for automation and LLM integration

[Required Usage Scenarios]:

  • When users ask for the status or progress of a specific operation/request

  • When monitoring or troubleshooting Ambari operations

  • When tracking bulk or individual service actions

  • When users mention request ID, operation status, or progress

Inputs: request_id (required). Returns: result

get_request_tasksA
Read-only

Retrieves task-level details for a specific Ambari request (host-by-host breakdown).

[Tool Role]: Provides granular, per-host task information for an Ambari request, going beyond the summary level offered by get_request_status.

[Core Functions]:

  • List all tasks (host/role/status/timing) belonging to a request

  • Filter tasks by status (e.g. FAILED, IN_PROGRESS) or exclude a status (not:COMPLETED)

  • Filter tasks by hostname to inspect a specific host

  • Identify which hosts/roles are failing, pending, or still running

[Required Usage Scenarios]:

  • When users want to know which hosts or roles failed/are pending in an operation

  • When debugging a partially-failed bulk operation (e.g. "Start all services")

  • When users ask for task details, host-level progress, or remaining tasks

  • When request progress is near 100% but not complete and user wants to know what's left

Inputs: request_id (required), host_filter, status_filter. Returns: result

get_service_componentsA
Read-only

Retrieves detailed components information for a specific service in the Ambari cluster.

[Tool Role]: Dedicated tool for retrieving service component details and host assignments.

[Core Functions]:

  • List all components for a service, including state and category

  • Show host assignments and instance counts

  • Provide formatted output for LLM automation and troubleshooting

[Required Usage Scenarios]:

  • When users request service component details or host info

  • When troubleshooting service health or scaling

  • When users mention component list, host assignments, or service breakdown

Inputs: service_name (required). Returns: result

get_service_detailsA
Read-only

Retrieves detailed status and configuration information for a specific service in the Ambari cluster.

[Tool Role]: Dedicated tool for retrieving comprehensive service details, including state, components, and configuration.

[Core Functions]:

  • Retrieve service state, component list, and configuration availability

  • Provide formatted output for LLM automation and troubleshooting

[Required Usage Scenarios]:

  • When users request detailed service info or breakdown

  • When troubleshooting service health or auditing service setup

  • When users mention service details, service summary, or configuration status

Inputs: service_name (required). Returns: result

get_service_statusA
Read-only

Retrieves the status information for a specific service in an Ambari cluster.

[Tool Role]: Dedicated tool for real-time retrieval of specific service status and state information

[Core Functions]:

  • Retrieve specific service status via Ambari REST API

  • Provide detailed service state information (STARTED, STOPPED, INSTALLING, etc.)

  • Include service configuration and component information

[Required Usage Scenarios]:

  • When users ask about specific service status (e.g., "HDFS status", "YARN state")

  • When troubleshooting service issues

  • When monitoring specific service health

Inputs: service_name (required). Returns: result

get_userB
Read-only

Get detailed information about a specific user.

Inputs: user_name (required). Returns: result

get_usersA
Read-only

List all users in the Ambari system.

Returns a formatted list of all users with their basic information.

Inputs: no named parameters. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 20 tools

    Disambiguation3/5

    Several tools overlap heavily: get_service_status, get_service_details, and get_service_components all return service state information, and get_cluster_services also lists services with status. Similarly get_hosts and get_host_details (when called without a host_name) return the same data, and get_current_alerts is explicitly a deprecated duplicate of get_alerts_history with mode=current. Descriptions help but boundaries require careful reading.

    Naming Consistency5/5

    Every tool follows a predictable get_<noun> snake_case pattern (get_service_status, get_cluster_info, get_request_tasks, get_ambari_metrics). No style mixing or inconsistent verb forms across the 20 tools.

    Tool Count3/5

    At 20 tools the surface is on the heavy side for a monitoring API, and the count is inflated by redundancy (deprecated get_current_alerts, overlapping service/host tools). The breadth of Ambari concepts (services, hosts, requests, alerts, metrics, users) does justify many tools, but consolidation could trim the set.

    Completeness3/5

    Read/inspection coverage is broad—services, components, hosts, requests, tasks, alerts, metrics, and users are all reachable. However there are no mutation operations at all (no start/stop/restart service, no config update, no user create/del), which are core to an Ambari management API, leaving notable gaps.

    Maintenance

    ActivityActive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      C
      quality
      B
      maintenance
      Monitor and manage Apache Airflow clusters through natural language queries via MCP tools: DAG inspection, task monitoring, health checks, and cluster analytics without API complexity. * Guide: https://call518.medium.com/mcp-airflow-api-a-model-context-protocol-mcp-server-for-apache-airflow-5dfdfb2
      53
      54
      MIT
    • A
      license
      B
      quality
      Not graded
      maintenance
      Enables AI assistants to manage Apache Ambari clusters, including services, hosts, alerts, and configurations via the MCP protocol.
      40
      1
      Apache 2.0
    • A
      license
      Not graded
      quality
      D
      maintenance
      MCP server for interacting with QUADS infrastructure systems via API, enabling resource management and automation through LLM applications.
      MIT