home / mcp / consul mcp server
A consul MCP Server (modelcontextprotocol)
Configuration
View docs{
"mcpServers": {
"kocierik-consul-mcp-server": {
"command": "node",
"args": [
"/ABSOLUTE/PATH/TO/PARENT/FOLDER/consul-mcp-server/build/index.js"
],
"env": {
"CONSUL_HOST": "localhost",
"CONSUL_PORT": "8500"
}
}
}
}You can access Consul functionality through a dedicated MCP server that exposes Consul features via a standardized interface. This lets you manage services, health checks, KV storage, sessions, events, queries, and more from any MCP-compatible client without talking directly to the Consul API.
You will run the MCP server locally and connect your MCP client to it. The server exposes core Consul capabilities such as service management, health checks, key-value storage, and agent/system information. Use your MCP client to call the available endpoints to list, create, update, or delete resources, all through the consistent MCP interface.
Prerequisites you need before installing: Node.js and npm installed on your system.
Install dependencies, build, and run the server with these steps.
npm install
npm run build
node build/index.jsConfigure the MCP server to connect to your Consul instance using environment variables. The following variables are supported.
CONSUL_HOST=localhost
CONSUL_PORT=8500If you use Claude with MCP, you can provide a runtime config that runs the MCP server as a stdio process. The typical command is node with the path to the built entry point. You may also run the inspector to validate the MCP interface during development.
List running services registered in Consul via MCP
Register a new service with Consul through MCP
Deregister an existing service via MCP
Get detailed information about a specific service
List catalog services from Consul
Get catalog information for a service
Register a health check that runs for a service
Remove a registered health check
Retrieve health checks for a service
Get a value from the key-value store
List keys in the key-value store
Put a value into the key-value store
Delete a key from the key-value store
List active sessions
Destroy a session
Fire an event in Consul
List events
Create a prepared query for repeated use
Execute a prepared query
Get the current leader of the Consul cluster
Get current peers in the cluster
Get member information for the Consul agent
Get information about the agent itself
Get system health information