buallen/kibana-mcp-claude-setup
If you are the rightful owner of kibana-mcp-claude-setup and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
The Kibana MCP Server for Claude Code provides a seamless integration between Kibana and Claude Code, enabling comprehensive access to Kibana's API and functionalities through the Model Context Protocol (MCP).
Kibana MCP Server for Claude Code
This repository provides a complete setup guide for integrating Kibana with Claude Code using the @tocharian/mcp-server-kibana MCP server.
Features
🔍 Comprehensive Kibana Integration
- Full Kibana API access through Claude Code
- Multi-space support for enterprise environments
- Saved objects management (dashboards, visualizations, etc.)
- Real-time search and analytics
🛠️ 12 Powerful Tools Available
get_status- Check Kibana server healthexecute_kb_api- Execute custom Kibana API requestssearch_kibana_api_paths- Discover available endpointsvl_search_saved_objects- Search dashboards/visualizationsvl_get_saved_object- Get specific objects by IDvl_create_saved_object- Create new objectsvl_update_saved_object- Update existing objectsvl_bulk_update_saved_objects- Bulk updatesvl_bulk_delete_saved_objects- Bulk deletionsget_available_spaces- List Kibana spaces
Quick Start
1. Prerequisites
- Claude Code CLI installed
- Access to a Kibana instance
- Valid authentication credentials
2. Configuration
Add this to your Claude Code MCP configuration:
{
"mcpServers": {
"kibana": {
"command": "npx",
"args": ["-y", "@tocharian/mcp-server-kibana"],
"env": {
"KIBANA_URL": "YOUR_KIBANA_URL",
"KIBANA_COOKIE": "YOUR_AUTH_COOKIE"
}
}
}
}
3. Environment Setup
Create a .env file:
KIBANA_URL=https://your-kibana-instance.com
KIBANA_COOKIE=security_authentication=your_auth_cookie_here
4. Test the Connection
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | \
KIBANA_URL="$KIBANA_URL" KIBANA_COOKIE="$KIBANA_COOKIE" \
npx -y @tocharian/mcp-server-kibana
Configuration Examples
Basic Configuration
{
"mcpServers": {
"kibana": {
"command": "npx",
"args": ["-y", "@tocharian/mcp-server-kibana"],
"env": {
"KIBANA_URL": "https://localhost:5601",
"KIBANA_COOKIE": "security_authentication=your_cookie"
}
}
}
}
Multi-Space Configuration
{
"mcpServers": {
"kibana-prod": {
"command": "npx",
"args": ["-y", "@tocharian/mcp-server-kibana"],
"env": {
"KIBANA_URL": "https://prod-kibana.company.com",
"KIBANA_COOKIE": "security_authentication=prod_cookie",
"KIBANA_SPACE": "production"
}
},
"kibana-dev": {
"command": "npx",
"args": ["-y", "@tocharian/mcp-server-kibana"],
"env": {
"KIBANA_URL": "https://dev-kibana.company.com",
"KIBANA_COOKIE": "security_authentication=dev_cookie",
"KIBANA_SPACE": "development"
}
}
}
}
Authentication Methods
1. Cookie Authentication (Recommended)
# Extract from browser developer tools
KIBANA_COOKIE="security_authentication=Fe26.2**your_cookie_value_here"
2. API Key Authentication
# If your Kibana supports API keys
KIBANA_API_KEY="your_api_key_here"
3. Basic Authentication
# For basic auth setups
KIBANA_USERNAME="your_username"
KIBANA_PASSWORD="your_password"
Usage Examples
Search Dashboards
# Find all dashboards with "nginx" in the name
vl_search_saved_objects(
search="nginx",
types=["dashboard"],
fields=["title", "description"],
perPage=10
)
Get Specific Dashboard
# Get dashboard by ID
vl_get_saved_object(
type="dashboard",
id="your-dashboard-id"
)
Execute Custom API
# Get cluster health
execute_kb_api(
method="GET",
path="/api/status"
)
Search Across All Spaces
# Search in specific space
vl_search_saved_objects(
search="logs",
types=["dashboard", "visualization"],
space="production"
)
Troubleshooting
Common Issues
1. Authentication Errors
# Check your cookie is still valid
curl -H "Cookie: $KIBANA_COOKIE" "$KIBANA_URL/api/status"
2. Connection Timeout
# Verify Kibana URL is accessible
curl -I "$KIBANA_URL"
3. MCP Server Not Found
# Test the MCP server installation
npx -y @tocharian/mcp-server-kibana --help
Debugging Commands
# Test MCP server directly
echo '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | \
KIBANA_URL="$KIBANA_URL" KIBANA_COOKIE="$KIBANA_COOKIE" \
npx -y @tocharian/mcp-server-kibana
# Check available tools
claude mcp
# Test specific tool
# Use Claude Code to test: get_status()
Security Best Practices
1. Environment Variables
- Never commit actual credentials to git
- Use
.envfiles locally - Use secure credential management in production
2. Authentication Tokens
- Rotate authentication cookies regularly
- Use dedicated service accounts where possible
- Implement proper access controls
3. Network Security
- Use HTTPS for all Kibana connections
- Consider VPN or private networks for sensitive data
- Implement proper firewall rules
Advanced Configuration
Custom Wrapper Script
Create kibana-mcp-wrapper.sh:
#!/bin/bash
# Load environment from secure location
source /secure/path/to/kibana.env
# Set additional security headers
export KIBANA_EXTRA_HEADERS='{"X-Custom-Auth": "value"}'
# Run the MCP server
npx -y @tocharian/mcp-server-kibana "$@"
Use in configuration:
{
"mcpServers": {
"kibana": {
"command": "/path/to/kibana-mcp-wrapper.sh"
}
}
}
Docker Configuration
FROM node:18-alpine
# Install the MCP server
RUN npm install -g @tocharian/mcp-server-kibana
# Set up environment
ENV KIBANA_URL=""
ENV KIBANA_COOKIE=""
# Run the server
CMD ["npx", "@tocharian/mcp-server-kibana"]
Contributing
- Fork this 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 file for details.
Acknowledgments
- @tocharian/mcp-server-kibana - The underlying MCP server
- Model Context Protocol - The protocol specification
- Claude Code - The CLI tool