Consul MCP Server
Provides tools for working with a HashiCorp Consul cluster: registering, deregistering and listing services, querying service health and check details, reading and writing keys in Consul's KV store, and creating, listing, fetching and deleting Connect service mesh intentions. It also exposes MCP resources for services, per-service health, KV values and intentions, plus guided prompts for service registration, health troubleshooting, intention configuration and KV structure.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Consul MCP Server
A Model Context Protocol (MCP) server that provides AI assistants with tools to interact with HashiCorp Consul. Built with FastMCP.
Features
This MCP server exposes Consul's core functionality through three types of integrations:
Tools
Service Management: Register, deregister, and list services
Health Checks: Query service health status and check details
Key-Value Store: Get and put values in Consul's KV store
Service Mesh Intentions: Create, list, get, and delete Connect intentions
Resources
consul://services- List all registered servicesconsul://service/{name}/health- Get health status for a specific serviceconsul://kv/{key}- Retrieve values from KV storeconsul://intentions- List all Connect intentionsconsul://intention/{id}- Get specific intention details
Prompts
setup_consul_service- Guided service registrationdebug_service_health- Service health troubleshootingconfigure_intentions- Service mesh intention configurationoptimize_kv_structure- KV store organization recommendations
Related MCP server: GCP MCP Server
Installation
Prerequisites
Python 3.10 or higher
uv (recommended)
Docker (for running Consul locally)
Quick Install
# Clone the repository
git clone https://github.com/tywe00/consul-mcp-server.git
cd consul-mcp-server
# Install dependencies
make syncConfiguration
Environment Variables
Copy .env.example to .env and configure:
CONSUL_URL=http://localhost:8500
LOG_LEVEL=INFORunning Consul Locally
If you don't have Consul running, start it with Docker:
make consul-runAccess Consul UI at: http://localhost:8500/ui
To stop Consul:
make consul-stopUsage
Running the Server
Stdio Transport (default)
make runHTTP Transport
make run-httpWith MCP Inspector (for testing)
make inspectorUsing with Claude Desktop
Add to your Claude Desktop configuration (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):
{
"mcpServers": {
"consul": {
"command": "uv",
"args": [
"--directory",
"/path/to/consul-mcp-server",
"run",
"consul-mcp-server"
]
}
}
}Using with Other MCP Clients
This server implements the standard MCP protocol and works with any MCP-compatible client. Configure your client to connect via stdio or HTTP transport.
Development
Setup Development Environment
# Install with dev dependencies
make syncAvailable Commands
Run make help to see all available commands:
make help # Show all available commands
make sync # Install/update all dependencies
make install # Install production dependencies only
make test # Run tests
make test-cov # Run tests with coverage report
make lint # Check code quality
make format # Auto-format code
make type-check # Run type checker
make run # Run the server (stdio transport)
make run-http # Run the server (HTTP transport)
make inspector # Run with MCP Inspector for testing
make consul-run # Start Consul Docker container
make consul-stop # Stop Consul Docker container
make clean # Clean build artifacts and cache
make build # Build distribution packagesRunning Tests
# Run all tests
make test
# Run with coverage
make test-covCode Quality
# Format code
make format
# Lint code
make lint
# Type checking
make type-checkProject Structure
consul-mcp-server/
├── src/
│ ├── __init__.py
│ ├── server.py # Main server entry point
│ ├── mcp_instance.py # FastMCP singleton instance
│ ├── tools/
│ │ └── tools.py # Consul tool implementations
│ ├── resources/
│ │ └── resources.py # Consul resource providers
│ └── prompts/
│ └── prompts.py # AI assistant prompts
├── tests/
│ └── test_tools.py # Tool tests
├── pyproject.toml # Project configuration
├── fastmcp.json # FastMCP configuration
└── README.mdAvailable Tools
Service Management
list_services
# List all registered services
list_services(consul_url="http://localhost:8500")register_service
# Register a new service
register_service(
id="web-1",
name="web",
address="10.0.0.1",
port=8080,
consul_url="http://localhost:8500"
)deregister_service
# Remove a service
deregister_service(id="web-1", consul_url="http://localhost:8500")get_service_health
# Check service health
get_service_health(service_name="web", consul_url="http://localhost:8500")Key-Value Store
kv_put
# Store a value
kv_put(key="config/app/setting", value="production", consul_url="http://localhost:8500")kv_get
# Retrieve a value
kv_get(key="config/app/setting", consul_url="http://localhost:8500")Service Mesh Intentions
list_intentions
# List all intentions
list_intentions(consul_url="http://localhost:8500")create_intention
# Create an intention
create_intention(
source="web",
destination="api",
action="allow",
consul_url="http://localhost:8500"
)get_intention
# Get specific intention
get_intention(intention_id="abc-123", consul_url="http://localhost:8500")delete_intention
# Delete an intention
delete_intention(intention_id="abc-123", consul_url="http://localhost:8500")Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Fork the repository
Create your feature branch (
git checkout -b feature/amazing-feature)Commit your changes (
git commit -m 'Add amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
Built with FastMCP
Integrates with HashiCorp Consul
Implements the Model Context Protocol
Support
Report issues: GitHub Issues
Consul Documentation: https://www.consul.io/docs
MCP Documentation: https://modelcontextprotocol.io
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Your org's AI agents, tasks, runs, search, and brain files as MCP tools and resources.
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
An MCP gateway for teams deploying AI tools at scale to employee-facing and headless agents.
Persistent memory, knowledge graph, task management and more for AI agents via MCP.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables management of Mistral AI agents through MCP tools including creating, listing, searching, viewing details, and deleting agents. Integrates with Mistral API to provide agent management capabilities through natural language interactions.1-
- AlicenseBqualityNot gradedmaintenanceEnables AI assistants to interact with and manage Google Cloud Platform resources including Artifact Registry, BigQuery, Cloud Build, Compute Engine, Cloud Run, Cloud Storage, and monitoring services through a standardized MCP interface.1MIT
- AlicenseAqualityNot gradedmaintenanceExposes the full Kong Gateway Admin API as MCP tools, enabling AI assistants to manage services, routes, consumers, plugins, upstreams, and more.13MIT
- AlicenseAqualityDmaintenanceExposes Azure AI Foundry agents, workflows, and AI Search vector-database capabilities as MCP tools, enabling natural language interaction with agents, semantic search, and index management.102MIT