home / mcp / mcp ambari api server

MCP Ambari API Server

๐Ÿ”Model Context Protocol (MCP) server for Apache Ambari API integration. This project provides tools for managing Hadoop clusters, including service operations, configuration management, status monitoring, and request tracking.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "call518-mcp-ambari-api": {
      "url": "http://localhost:18001/mcp",
      "headers": {
        "PYTHONPATH": "/app/src",
        "FASTMCP_HOST": "127.0.0.1",
        "FASTMCP_PORT": "8000",
        "FASTMCP_TYPE": "stdio",
        "MCP_LOG_LEVEL": "INFO",
        "REMOTE_SECRET_KEY": "YOUR_SECRET_KEY",
        "REMOTE_AUTH_ENABLE": "true"
      }
    }
  }
}

You can manage an Apache Ambari cluster through natural-language driven MCP tools that translate your commands into Ambari REST calls. This MCP server provides interactive cluster operations, real-time visibility, and automation-friendly interfaces for common administration tasks across Hadoop ecosystems, helping you operate more efficiently with consistent, auditable workflows.

How to use

You will interact with the MCP server through an MCP client or OpenWebUI-compatible tooling. Use plain language to query cluster status, start or stop services, inspect configurations, review alerts, and fetch metrics. The tools expose actions for cluster information, service control, configuration handling, host and user management, and alert viewing. For operational safety, long-running or bulk actions are typically guarded by confirmation prompts and structured prompts that explain risk before proceeding.

Typical usage patterns include: asking for current cluster health, listing active requests, inspecting a serviceโ€™s components and hosts, starting or stopping a service across the cluster, exporting configurations, and querying Ambari Metrics for time-series data. You can also retrieve consolidated reports that resemble dfsadmin-style outputs and view real-time metric trends.

How to install

Prerequisites: ensure you have Docker and Docker Compose installed if you plan to run the MCP server in containers. You will also need a reachable Ambari cluster (Ambari 2.7+ is recommended) and access credentials for Ambari. If you plan to use the streamable-http transport, prepare a host for remote access and consider enabling Bearer token authentication for production environments.

Step 1: Prepare the Ambari cluster and environment configuration. Create a configuration file and populate Ambari connection details and optional authentication settings.

Step 2: Run the MCP server in stdio (local) mode or in streamable-http (remote) mode depending on your deployment. The local mode uses a command to launch the MCP server process, while the remote mode exposes an HTTP API endpoint you can connect to from your MCP client.

Additional content

Configuration details include Ambari host, port, user, password, and the cluster name you want to target by default. Optional Ambari Metrics (AMS) collector details can be configured for metric discovery and queries. Security considerations emphasize enabling remote authentication for production deployments and using strong secret keys. The server supports two transport modes: stdio for local setups and streamable-http for remote access, with a priority order for configuration values: CLI arguments take precedence over environment variables, which take precedence over defaults.

Example configurations for running the MCP server are shown below. Ensure you copy the exact command and environment variable names when integrating into your tooling.

Tools and endpoints overview

This MCP server exposes a collection of tools tailored for Ambari cluster management. They cover cluster information retrieval, service operations, configuration management, host and user administration, and alert handling. You can combine these tools to implement automation workflows that start or stop services in bulk, validate configurations, export summaries, and produce operational reports.

Available tools

get_cluster_info

Retrieve basic cluster information and status

get_active_requests

List currently active or running operations

get_request_status

Check status and progress of specific requests

get_cluster_services

List all services with their status

get_service_status

Get detailed status of a specific service

get_service_components

List components and host assignments for a service

get_service_details

Get comprehensive service information

start_service

Start a specific service

stop_service

Stop a specific service

restart_service

Restart a specific service

start_all_services

Start all services in the cluster

stop_all_services

Stop all services in the cluster

restart_all_services

Restart all services in the cluster

dump_configurations

Unified configuration tool for exporting or inspecting configurations

list_hosts

List all hosts in the cluster

get_host_details

Get detailed information for specific or all hosts

list_users

List all users in the Ambari system with their usernames and API links

get_user

Get detailed information about a specific user including profile and authentication details

get_alerts_history

Unified alert tool for current and historical alerts with filtering and formats