Consul MCP Server: Service Management, Health, KV Store
Manage services, run health checks, and store configuration with Consul MCP server for reliable service discovery and KV storage.
npx -y @kocierik/consul-mcp-serverOverview
Consul MCP Server is a lightweight service that provides core service discovery and configuration primitives: service registration, health checking, and a key-value (KV) store. It is designed for development, testing, and small deployments where you need a simple, reliable way to coordinate services and share configuration without running a full Consul cluster.
The server exposes a familiar HTTP-style API surface for managing services and KV entries and runs as a single binary (or container). Developers can register services, attach health checks, and read/write configuration flags or secrets to the KV store. This makes it useful for local development, CI pipelines, or minimal staging environments that require service discovery and dynamic configuration.
Features
- Service registration and discovery (register, deregister, list services)
- Health check management and periodic check execution
- Simple KV store for configuration and feature flags
- HTTP API compatible with common Consul patterns (register/check/kv)
- Single-binary or container deployment for easy use in CI and dev machines
- Pluggable configuration via CLI flags or a small configuration file
Installation / Configuration
Clone and build from source (requires Go installed):
Run the server with default options:
Run the server with explicit options (address, data directory, log level):
Example YAML configuration (alternative to flags):
bind: "0.0.0.0:8500"
data_dir: "/var/lib/consul-mcp"
log_level: "info"
check_interval: "10s"
Start with a configuration file:
Networking and storage considerations:
- Bind to an address reachable by your services (default 127.0.0.1 for local development).
- Choose a persistent data directory for KV and service metadata if you want state across restarts; otherwise use a temporary directory for ephemeral runs.
API quick reference
Below are the commonly used operations and their typical endpoint patterns. The server follows familiar Consul-style paths so existing tooling and scripts can often be adapted with minimal change.
| Operation | HTTP method | Example path | |||
|---|---|---|---|---|---|
| Register service | PUT | /v1/agent/service/register | |||
| Deregister service | PUT | /v1/agent/service/deregister/:service_id | |||
| List services | GET | /v1/agent/services | |||
| Register health check | PUT | /v1/agent/check/register | |||
| Update check status | PUT | /v1/agent/check/pass/:check_id | |||
| KV put | PUT | /v1/kv/| KV get | GET | /v1/kv/ | Example: register a service with curl Example: put and get a KV value Available Resources
Use Cases
If you are evaluating the server, try the quick start flow: start the binary, register a service, create a KV entry, and query the registered state via the HTTP endpoints. This will demonstrate service discovery, health checks, and configuration storage in a few simple steps. |