consul-mcp-server

MCP.Pizza Chef: kocierik

The consul-mcp-server is an MCP server that provides standardized access to Consul's service discovery, health checks, and key-value store functionalities. It enables models to interact with Consul's service catalog, register and deregister services and health checks, and query service health and metadata through a unified MCP interface. This facilitates integration of Consul's infrastructure management capabilities into AI workflows and automation systems.

Use This MCP server To

List running services in a Consul cluster Register and deregister services programmatically Query detailed service information via MCP Manage health checks for services Access and manipulate Consul key-value store data Integrate Consul service data into AI-driven workflows Automate service catalog updates and monitoring Retrieve health status of services for incident response

README

Consul MCP Server 🚀

smithery badge

A Model Context Protocol (MCP) server that provides access to Consul's functionality through a standardized interface.

Consul Server MCP server

2025-04-20.10-14-03.online-video-cutter.com.1.mp4

Features

The server provides access to the following Consul functionality:

Service Management

  • List running services
  • Register and deregister services
  • Get service information
  • List catalog services
  • Get catalog service information

Health Checks

  • Register health checks
  • Deregister health checks
  • Get health checks for services

Key-Value Store

  • Get values from KV store
  • List keys in KV store
  • Put values in KV store
  • Delete keys from KV store

Sessions

  • List sessions
  • Destroy sessions

Events

  • Fire events
  • List events

Prepared Queries

  • Create prepared queries
  • Execute prepared queries

Status

  • Get current leader
  • Get current peers

Agent

  • Get agent members
  • Get agent self information

System

  • Get system health service information

Configuration

The server can be configured using environment variables:

  • CONSUL_HOST: Consul server host (default: localhost)
  • CONSUL_PORT: Consul server port (default: 8500)

Usage

  1. Start the server:
node build/index.js
  1. The server will connect to Consul and make all functionality available through the MCP interface.

Development

  1. Install dependencies:
npm install
  1. Build the project:
npm run build
  1. Run inspector:
 npm run build && npx @modelcontextprotocol/inspector node build/index.js

Claude config

{
    "mcpServers": {
        "consul-mcp": {
            "command": "node",
            "args": [
                "/ABSOLUTE/PATH/TO/PARENT/FOLDER/consul-mcp-server/build/index.js"
            ]
        }
    }
}

Installing via Smithery

To install Consul Server for Claude Desktop automatically via Smithery:

npx -y @smithery/cli install @kocierik/consul-mcp-server --client claude

License

MIT

consul-mcp-server FAQ

How do I connect the consul-mcp-server to my Consul cluster?
Configure the server with your Consul agent's address and authentication details to enable communication.
Can the consul-mcp-server register and deregister services dynamically?
Yes, it supports full lifecycle management of services including registration and deregistration.
Does the server support health check management?
Yes, it allows registering, deregistering, and querying health checks for services.
How does the consul-mcp-server expose Consul's key-value store?
It provides MCP endpoints to read, write, and manage key-value pairs within Consul.
Is the consul-mcp-server compatible with multiple LLM providers?
Yes, it works with OpenAI, Anthropic Claude, and Google Gemini models via the MCP protocol.
What security measures are in place for accessing Consul through this server?
The server uses scoped authentication and secure communication channels to protect Consul data access.
Can I use the consul-mcp-server to automate service discovery in my infrastructure?
Absolutely, it enables AI models to query and update service discovery data in real time.
How do I deploy the consul-mcp-server in a production environment?
It can be deployed as a lightweight adapter alongside your Consul agents, with configuration for network and security settings.