Skip to main content
Glama
Ambari MCP Server

Ambari MCP Server

by nikita15p

Ambari MCP Server

A Model Context Protocol (MCP) server for Apache Ambari, built with the TypeScript SDK. This server provides tools to interact with Ambari clusters through the MCP protocol.

Overview

This MCP server allows AI assistants and other MCP clients to interact with Apache Ambari clusters by exposing common Ambari REST API operations as MCP tools.

Related MCP server: mcp-tap

Features

  • Cluster Management: Get cluster information, create clusters

  • Service Management: List and get details of cluster services

  • Host Management: List and get details of cluster hosts

  • Alert Management: Manage alert targets

  • Secure Authentication: Basic authentication with Ambari server

  • Configurable: Environment-based configuration

  • Type-Safe: Built with TypeScript for better reliability

Available Tools

Cluster Operations

  • ambari_clusters_getclusters - Returns all clusters

  • ambari_clusters_getcluster - Returns information about a specific cluster

  • ambari_clusters_createcluster - Creates a new cluster

Service Operations

  • ambari_services_getservices - Get all services for a cluster

  • ambari_services_getservice - Get details of a specific service

  • ambari_services_getservicestate - Get detailed state information for a specific service

  • ambari_services_startservice - Start a specific service on the cluster

  • ambari_services_stopservice - Stop a specific service on the cluster

Service Restart & Configuration Management

  • ambari_services_getserviceswithstaleconfigs - Get services and components that have stale configurations requiring restart

  • ambari_services_gethostcomponentswithstaleconfigs - Get host components that need restart due to stale configurations

  • ambari_services_restartservice - Restart a specific service on the cluster (supports rolling restart)

  • ambari_services_restartcomponents - Restart specific components that have stale configurations

  • ambari_services_getrollingrestartstatus - Get the status of rolling restart operations for services

Service Maintenance Mode Management

  • ambari_services_enablemaintenancemode - Enable maintenance mode for a service or component

  • ambari_services_disablemaintenancemode - Disable maintenance mode for a service or component

Service Check Operations

  • ambari_services_runservicecheck - Run service check for a specific service to verify it is working correctly

  • ambari_services_isservicechecksupported - Check if service check is supported for a specific service in the stack

  • ambari_services_getservicecheckstatus - Get the status of recent service check operations for a service

Host Operations

  • ambari_hosts_gethosts - Returns a collection of all hosts

  • ambari_hosts_gethost - Returns information about a single host

Alert Operations

  • ambari_alerts_gettargets - Returns all alert targets

  • ambari_alerts_getalerts - Get all alerts for a cluster with filtering options

  • ambari_alerts_getalertsummary - Get alert summary in grouped format for a cluster

  • ambari_alerts_getalertdetails - Get details for a specific alert definition

  • ambari_alerts_getalertdefinitions - Get all alert definitions for a cluster

  • ambari_alerts_updatealertdefinition - Update an alert definition (enable/disable or modify properties)

Alert Group Management

  • ambari_alerts_getalertgroups - Get all alert groups for a cluster

  • ambari_alerts_createalertgroup - Create a new alert group

  • ambari_alerts_updatealertgroup - Update an existing alert group

  • ambari_alerts_deletealertgroup - Delete an alert group

  • ambari_alerts_duplicatealertgroup - Duplicate an existing alert group with a new name

  • ambari_alerts_adddefinitiontogroup - Add an alert definition to an alert group

  • ambari_alerts_removedefinitionfromgroup - Remove an alert definition from an alert group

Alert Notification Management

  • ambari_alerts_getnotifications - Get all alert notification targets

  • ambari_alerts_createnotification - Create a new alert notification target

  • ambari_alerts_updatenotification - Update an existing alert notification target

  • ambari_alerts_deletenotification - Delete an alert notification target

  • ambari_alerts_addnotificationtogroup - Add a notification target to an alert group

  • ambari_alerts_removenotificationfromgroup - Remove a notification target from an alert group

Alert Settings

  • ambari_alerts_savealertsettings - Save cluster-level alert settings (like repeat tolerance)

Installation

  1. Clone or copy this server to your local machine

  2. Install dependencies:

    npm install
  3. Install dev dependencies (if not already installed):

    npm install typescript @types/node --save-dev

Configuration

  1. Copy the example environment file:

    cp .env.example .env
  2. Edit the .env file with your Ambari server details:

    AMBARI_BASE_URL=http://your-ambari-server:8080/api/v1
    AMBARI_USERNAME=admin
    AMBARI_PASSWORD=admin
    TIMEOUT_MS=30000

Building

Build the TypeScript code:

npm run build

Usage

As a Standalone Server

Run the server directly:

npm start

With MCP Clients

Claude Desktop

Add to your Claude Desktop configuration:

{
  "mcpServers": {
    "ambari": {
      "command": "node",
      "args": ["/path/to/ambari-mcp-server/dist/index.js"]
    }
  }
}

Other MCP Clients

The server communicates via stdio and follows the MCP protocol specification.

Development

Project Structure

ambari-mcp-server/
├── src/
│   └── index.ts          # Main server implementation
├── dist/                 # Compiled JavaScript (after build)
├── .env.example         # Environment configuration template
├── package.json         # Node.js dependencies and scripts
├── tsconfig.json        # TypeScript configuration
└── README.md           # This file

Development Commands

  • npm run build - Compile TypeScript to JavaScript

  • npm run dev - Build and run the server

  • npm start - Run the compiled server

Adding New Tools

  1. Add the tool definition to the AMBARI_TOOLS array

  2. Implement the tool executor in the toolExecutors object

  3. Update this README with the new tool documentation

Example:

// Add to AMBARI_TOOLS
{
  name: 'ambari_new_operation',
  description: 'Description of the new operation',
  inputSchema: {
    type: 'object',
    properties: {
      // Define input parameters
    },
    required: ['requiredParam']
  }
}

// Add to toolExecutors
ambari_new_operation: async (args) => {
  return executeAmbariRequest('GET', '/new-endpoint', args);
}

Error Handling

The server includes comprehensive error handling:

  • Network timeouts and connection errors

  • HTTP error responses from Ambari

  • Invalid tool parameters

  • Authentication failures

Errors are returned as MCP error responses with appropriate error codes and messages.

Security Considerations

  • Store sensitive credentials in environment variables

  • Use HTTPS for Ambari server connections in production

  • Implement proper authentication and authorization

  • Consider network security between MCP client and server

Troubleshooting

Common Issues

  1. Connection Refused: Check if Ambari server is running and accessible

  2. Authentication Failed: Verify username and password in .env

  3. Timeout Errors: Increase TIMEOUT_MS value

  4. Build Errors: Ensure TypeScript and dependencies are installed

Debug Mode

Set environment variable DEBUG=1 for verbose logging:

DEBUG=1 npm start

Contributing

  1. Fork the repository

  2. Create a feature branch

  3. Make your changes

  4. Add tests if applicable

  5. Submit a pull request

License

ISC License - see package.json for details

Available Tools

40 tools
ambari_alerts_adddefinitiontogroupB

Add an alert definition to an alert group

Inputs: clusterName (required), groupId (required), definitionId (required).

ambari_alerts_addnotificationtogroupB

Add a notification target to an alert group

Inputs: clusterName (required), groupId (required), targetId (required).

ambari_alerts_createalertgroupC

Create a new alert group

Inputs: clusterName (required), groupName (required), definitions.

ambari_alerts_createnotificationB

Create a new alert notification target

Inputs: clusterName (required), notificationData (required).

ambari_alerts_deletealertgroupB

Delete an alert group

Inputs: clusterName (required), groupId (required).

ambari_alerts_deletenotificationB

Delete an alert notification target

Inputs: clusterName (required), targetId (required).

ambari_alerts_duplicatealertgroupB

Duplicate an existing alert group with a new name

Inputs: clusterName (required), sourceGroupId (required), newGroupName (required).

ambari_alerts_getalertdefinitionsB

Get all alert definitions for a cluster

Inputs: clusterName (required), fields.

ambari_alerts_getalertdetailsB

Get details for a specific alert definition

Inputs: clusterName (required), alertId (required).

ambari_alerts_getalertgroupsB

Get all alert groups for a cluster

Inputs: clusterName (required).

ambari_alerts_getalertsB

Get all alerts for a cluster with filtering options

Inputs: clusterName (required), fields, hostName, componentName, +2 more.

ambari_alerts_getalertsummaryB

Get alert summary in grouped format for a cluster

Inputs: clusterName (required), maintenanceFilter.

ambari_alerts_getnotificationsC

Get all alert notification targets

Inputs: clusterName (required).

ambari_alerts_gettargetsC

Returns all alert targets

Inputs: fields, sortBy, page_size.

ambari_alerts_removedefinitionfromgroupB

Remove an alert definition from an alert group

Inputs: clusterName (required), groupId (required), definitionId (required).

ambari_alerts_removenotificationfromgroupB

Remove a notification target from an alert group

Inputs: clusterName (required), groupId (required), targetId (required).

ambari_alerts_savealertsettingsB

Save cluster-level alert settings (like repeat tolerance)

Inputs: clusterName (required), alertRepeatTolerance (required).

ambari_alerts_updatealertdefinitionB

Update an alert definition (enable/disable or modify properties)

Inputs: clusterName (required), definitionId (required), enabled, data.

ambari_alerts_updatealertgroupB

Update an existing alert group

Inputs: clusterName (required), groupId (required), groupName (required), definitions.

ambari_alerts_updatenotificationB

Update an existing alert notification target

Inputs: clusterName (required), targetId (required), notificationData (required).

ambari_clusters_createclusterC

Creates a cluster

Inputs: clusterName (required), body (required).

ambari_clusters_getclusterB

Returns information about a specific cluster

Inputs: clusterName (required), fields.

ambari_clusters_getclustersC

Returns all clusters

Inputs: fields, sortBy, page_size, from, +1 more.

ambari_hosts_gethostB

Returns information about a single host

Inputs: hostName (required), fields.

ambari_hosts_gethostsC

Returns a collection of all hosts

Inputs: fields, sortBy, page_size.

ambari_services_disablemaintenancemodeB

Disable maintenance mode for a service or component

Inputs: clusterName (required), serviceName (required), componentName, hostName.

ambari_services_enablemaintenancemodeB

Enable maintenance mode for a service or component

Inputs: clusterName (required), serviceName (required), componentName, hostName.

ambari_services_gethostcomponentswithstaleconfigsA

Get host components that need restart due to stale configurations

Inputs: clusterName (required), hostName, serviceName, componentName.

ambari_services_getrollingrestartstatusC

Get the status of rolling restart operations for services

Inputs: clusterName (required), serviceName, requestId.

ambari_services_getserviceC

Get the details of a service

Inputs: clusterName (required), serviceName (required), fields.

ambari_services_getservicecheckstatusA

Get the status of recent service check operations for a service

Inputs: clusterName (required), serviceName, requestId.

ambari_services_getservicesC

Get all services for a cluster

Inputs: clusterName (required), fields, sortBy, page_size.

ambari_services_getservicestateC

Get detailed state information for a specific service

Inputs: clusterName (required), serviceName (required), fields.

ambari_services_getserviceswithstaleconfigsA

Get services and components that have stale configurations requiring restart

Inputs: clusterName (required), serviceName, onlyStaleConfigs.

ambari_services_isservicechecksupportedC

Check if service check is supported for a specific service in the stack

Inputs: clusterName (required), serviceName (required), stackName (required), stackVersion (required).

ambari_services_restartcomponentsB

Restart specific components that have stale configurations

Inputs: clusterName (required), serviceName (required), componentName (required), hostNames, +1 more.

ambari_services_restartserviceC

Restart a specific service on the cluster

Inputs: clusterName (required), serviceName (required), context, restartType.

ambari_services_runservicecheckB

Run service check for a specific service to verify it is working correctly

Inputs: clusterName (required), serviceName (required), context.

ambari_services_startserviceB

Start a specific service on the cluster

Inputs: clusterName (required), serviceName (required), context.

ambari_services_stopserviceB

Stop a specific service on the cluster

Inputs: clusterName (required), serviceName (required), context.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.1/5.0

    Scored across 40 tools

    Disambiguation4/5

    Tools are organized by category (alerts, clusters, hosts, services) and most have distinct purposes. However, some alert-related tools like getalertdefinitions, getalertdetails, getalerts, and getalertsummary could cause confusion due to similar names and overlapping functionality.

    Naming Consistency5/5

    All tools follow a consistent pattern of ambari_{category}_{action} in snake_case, making it predictable and easy to understand the hierarchy and action.

    Tool Count2/5

    With 40 tools, the server exceeds the recommended range. While the domain may require many operations, the count feels heavy and could be streamlined by merging some duplicate-like functions.

    Completeness3/5

    Covers many operations but has notable gaps: missing cluster update/delete, host add/remove/update, service add/remove, and alert definition delete. CRUD is incomplete for clusters and hosts.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      B
      maintenance
      Manage and monitor Hadoop clusters via Apache Ambari API, enabling service operations, configuration changes, status checks, and request tracking through a unified MCP interface for simplified administration. * Guide: https://call518.medium.com/llm-based-ambari-control-via-mcp-8668a2b5ffb9
      29
      1
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      Enables AI assistants to discover, install, configure, and manage MCP servers through natural language conversation, automating tedious manual setup across multiple clients.
      11
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to manage LXD containers and virtual machines through a standardized MCP interface for lifecycle management, image operations, and server monitoring.
      6 npm
      MIT