The Splunk MCP tool provides a natural language interface for interacting with Splunk Enterprise/Cloud. It allows you to search data, manage KV stores, and access Splunk resources through an intuitive interface based on the Model Context Protocol.
git clone <repository-url>
cd splunk-mcp
poetry install
cp .env.example .env
.env
file with your Splunk credentials:SPLUNK_HOST=your_splunk_host
SPLUNK_PORT=8089
SPLUNK_USERNAME=your_username
SPLUNK_PASSWORD=your_password
SPLUNK_SCHEME=https
VERIFY_SSL=true
FASTMCP_LOG_LEVEL=INFO
docker pull livehybrid/splunk-mcp:latest
Create your .env
file as above or use environment variables directly.
Run using Docker Compose:
docker compose up -d
Or using Docker directly:
docker run -i \
--env-file .env \
livehybrid/splunk-mcp
The tool supports three different operating modes:
/sse
endpoint# Start in SSE mode (default)
poetry run python splunk_mcp.py
# or explicitly:
poetry run python splunk_mcp.py sse
# Using uvicorn directly:
SERVER_MODE=api poetry run uvicorn splunk_mcp:app --host 0.0.0.0 --port 8000 --reload
/api/v1
endpoint prefixpoetry run python splunk_mcp.py api
poetry run python splunk_mcp.py stdio
Using Docker Compose:
# SSE Mode (Default)
docker compose up -d mcp
# API Mode
docker compose run --rm mcp python splunk_mcp.py api
# STDIO Mode
docker compose run -i --rm mcp python splunk_mcp.py stdio
The Splunk MCP provides several tools for interacting with Splunk:
Configure the following environment variables:
SPLUNK_HOST
: Your Splunk host addressSPLUNK_PORT
: Splunk management port (default: 8089)SPLUNK_USERNAME
: Your Splunk usernameSPLUNK_PASSWORD
: Your Splunk passwordSPLUNK_SCHEME
: Connection scheme (default: https)VERIFY_SSL
: Enable/disable SSL verification (default: true)FASTMCP_LOG_LEVEL
: Logging level (default: INFO)SERVER_MODE
: Server mode (sse, api, stdio) when using uvicornThe tool provides flexible SSL verification options:
VERIFY_SSL=true
VERIFY_SSL=false
You can integrate Splunk MCP with Claude Desktop by adding the following configuration to your claude_desktop_config.json
:
{
"mcpServers": {
"splunk": {
"command": "poetry",
"env": {
"SPLUNK_HOST": "your_splunk_host",
"SPLUNK_PORT": "8089",
"SPLUNK_USERNAME": "your_username",
"SPLUNK_PASSWORD": "your_password",
"SPLUNK_SCHEME": "https",
"VERIFY_SSL": "false"
},
"args": [
"--directory",
"/path/to/splunk-mcp",
"run",
"python",
"splunk_mcp.py",
"stdio"
]
}
}
}
{
"mcpServers": {
"splunk": {
"command": "poetry",
"env": {
"SPLUNK_HOST": "your_splunk_host",
"SPLUNK_PORT": "8089",
"SPLUNK_USERNAME": "your_username",
"SPLUNK_PASSWORD": "your_password",
"SPLUNK_SCHEME": "https",
"VERIFY_SSL": "false",
"FASTMCP_PORT": "8001",
"DEBUG": "true"
},
"args": [
"--directory",
"/path/to/splunk-mcp",
"run",
"python",
"splunk_mcp.py",
"sse"
]
}
}
}
Once configured, you can use natural language to interact with Splunk through Claude. Examples:
What Splunk indexes are available?
Search Splunk for failed login attempts in the last 24 hours
Check the health of the Splunk system
List all KV store collections
Basic Connectivity:
SSL Issues:
VERIFY_SSL=false
Authentication Issues:
Debugging:
FASTMCP_LOG_LEVEL=DEBUG
for detailed logsThere are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.