etcd MCP Server
April 15, 2025 ยท View on GitHub
A Model Context Protocol (MCP) server for interacting with etcd key-value store. This server provides a consistent interface for AI assistants like Claude to access and manipulate data in your etcd server.
Features
- Connect to etcd server with v2 or v3 API
- Key-value operations (get, put, delete)
- Directory/prefix operations
- Tree visualization of etcd keys
- Authentication support
- TLS support
Installation
- Create a Python virtual environment:
cd mcp-etcd
uv venv venv
source venv/bin/activate # or source venv/bin/activate.fish for fish shell
- Install required packages:
# Inside the virtual environment
uv pip install python-etcd mcp
Usage
Starting the server
# Inside the virtual environment
python etcd_mcp_server_v2.py --host <etcd-host> --port <etcd-port>
Available options:
--host: etcd server host (default: localhost)--port: etcd server port (default: 2379)--protocol: http or https (default: http)--user: Username for authentication--password: Password for authentication--transport: MCP transport method (stdio, tcp, ws)--tcp-port: TCP port for MCP server--ws-port: WebSocket port for MCP server
Integration with AI Assistants
Integration with Claude
Currently, the server can only be connected to Claude AI assistant. Integration with Cursor is not working reliably yet.
To configure Claude to use the etcd MCP server, add the following to your Claude desktop configuration file (~/.claude_desktop_config.json):
{
"mcpServers": {
"mcp-etcd": {
"command": "bash",
"args": [
"-c",
"cd /path/to/mcp-etcd && source venv/bin/activate && python etcd_mcp_server_v2.py --host <etcd-host>"
]
}
}
}
Replace /path/to/mcp-etcd with the actual path to your mcp-etcd directory and <etcd-host> with your etcd server address.
After configuring, restart Claude and use the MCP server with:
/mcp mcp-etcd get_tree
/mcp mcp-etcd get "/your/key"
/mcp mcp-etcd put "/your/key" "value"
Available Commands
get(key): Get value of a specific keyput(key, value, ttl=None): Store a value under a keydelete(key, recursive=False, dir=False): Delete a key or directoryget_directory(directory, recursive=False): Get all key-value pairs in a directoryget_all(): Get all key-value pairs from rootget_tree(separator="/"): Get hierarchical tree view of keysmkdir(directory, ttl=None): Create a directoryget_leader(): Get information about etcd cluster leaderget_self_stats(): Get statistics about current etcd instanceget_store_stats(): Get statistics about etcd store
Troubleshooting
If you encounter connection issues:
- Verify etcd server is running and accessible
- Check the correct protocol version (v2 or v3) is being used
- Ensure authentication credentials are correct
- Check for any network restrictions or firewall rules
License
This project is released under the MIT License.