Get the FREE Ultimate OpenClaw Setup Guide →

mcp

Local MCP (Model Context Protocol) server for integrating LLMs with Mackerel.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio mackerelio-labs-mcp-server npx -y @mackerel/mcp-server \
  --env MACKEREL_APIKEY="${MACKEREL_APIKEY}"

How to use

This MCP server provides a Model Context Protocol interface to interact with Mackerel. It exposes a range of read and write operations for Mackerel data, including fetching alerts, dashboards, hosts, services, monitors, and traces, as well as retrieving metrics for hosts and services. The server can be run either via Docker or via npx, giving flexibility in deployment. To start using it, configure the MACKEREL_APIKEY environment variable with a valid API key and run the server through your preferred option. Once running, you can invoke the available tools through the MCP protocol to query and manipulate Mackerel data. The server acts as an adapter between generic MCP clients and the Mackerel API, translating MCP operations into Mackerel API calls.

How to install

Prerequisites:

  • Node.js installed if you plan to use npx (node and npm are handled automatically by npx).
  • Docker installed if you plan to run via Docker.
  • A valid Mackerel API key.

Option 1: Run via Docker

  1. Ensure your MACKEREL_APIKEY is available in your environment.
  2. Start the container using the provided command:
docker run --rm -i -e MACKEREL_APIKEY -e MACKEREL_APIKEY ghcr.io/mackerelio-labs/mcp-server:latest
  1. The MCP server will start and listen for MCP requests.

Option 2: Run via npx

  1. Ensure your MACKEREL_APIKEY is available in your environment.
  2. Run the MCP server with npx:
npx -y @mackerel/mcp-server
  1. The MCP server will start and listen for MCP requests.

Environment variable notes:

  • MACKEREL_APIKEY: Your Mackerel API key. This is required for both Docker and npx execution.

Additional notes

Tips and common issues:

  • Always provide MACKEREL_APIKEY when starting the server; without it, API calls to Mackerel will fail.
  • When running in Docker, ensure the host can reach the Mackerel API endpoint (network access and any required proxies).
  • If you rotate your API key, restart the MCP server to pick up the new key.
  • The available MCP operations cover alerts, dashboards, hosts, services, monitors, traces, and server stats for HTTP/database queries; use the tools list to determine the exact operations you can perform.
  • If you encounter authentication errors, verify that the API key has the necessary permissions for the requested operations in Mackerel.
  • The npm package name for the Node.js option is @mackerel/mcp-server.

Related MCP Servers

Sponsor this space

Reach thousands of developers