A Model Context Protocol server for Splunk - search, manage, and analyze Splunk data via LLMs
Project description
Splunk MCP Server
A Model Context Protocol server for Splunk. Enables AI assistants like Claude to search, manage, and analyze data in Splunk instances.
Installation
Claude Desktop
Add to your Claude Desktop config:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"splunk": {
"command": "uvx",
"args": ["mcp-server-splunk"],
"env": {
"SPLUNK_HOST": "your-splunk-host",
"SPLUNK_TOKEN": "your-token"
}
}
}
}
Claude Code (CLI)
claude mcp add splunk -- uvx mcp-server-splunk \
-e SPLUNK_HOST=your-splunk-host \
-e SPLUNK_TOKEN=your-token
OpenAI Codex
Add to ~/.codex/config.toml:
[mcp_servers.splunk]
command = "uvx"
args = ["mcp-server-splunk"]
[mcp_servers.splunk.env]
SPLUNK_HOST = "your-splunk-host"
SPLUNK_TOKEN = "your-token"
OpenCode
Add to your OpenCode config:
mcp:
splunk:
type: local
command: uvx mcp-server-splunk
env:
SPLUNK_HOST: your-splunk-host
SPLUNK_TOKEN: your-token
Configuration
| Variable | Required | Default | Description |
|---|---|---|---|
SPLUNK_HOST |
Yes | localhost | Splunk server hostname |
SPLUNK_PORT |
No | 8089 | Splunk management port |
SPLUNK_SCHEME |
No | https | Connection scheme (http/https) |
SPLUNK_TOKEN |
* | - | Authentication token (recommended) |
SPLUNK_USERNAME |
* | - | Username (if not using token) |
SPLUNK_PASSWORD |
* | - | Password (if not using token) |
*Provide either SPLUNK_TOKEN or both SPLUNK_USERNAME and SPLUNK_PASSWORD.
Getting a Splunk Token
- Log into Splunk Web
- Go to Settings > Tokens
- Click New Token
- Copy the token value
Tools
Search & Query
search_splunk- Execute SPL queriessearch_async- Non-blocking searchessearch_realtime- Real-time streamingexport_search_results- Export to filerun_saved_search- Execute saved searches
Index Management
list_indexes/get_index_infocreate_index/update_index/delete_indexsend_event- Ingest events
Alerts
list_alerts/create_alert/update_alert/delete_alertget_alert_history
Saved Searches
list_saved_searches/get_saved_search/run_saved_searchcreate_saved_search/update_saved_search/delete_saved_search
Dashboards
list_dashboards/get_dashboard/create_dashboard/delete_dashboard
Knowledge Objects
list_lookups/get_lookup_data/update_lookup_datalist_macros/get_macro/create_macro/update_macro/delete_macrolist_field_extractions/get_field_summary
KV Store
list_kvstore_collections/create_kvstore_collection/delete_kvstore_collectionquery_kvstore_collection/insert_kvstore_data/update_kvstore_data/delete_kvstore_data
Data Inputs
list_inputs/get_input_infocreate_monitor_input/delete_input
Users & Roles
list_users/get_user_info/create_user/update_user/delete_userlist_roles/get_role_info/create_role/update_role/delete_role
Apps
list_apps/create_app/update_app/delete_app
Server
get_server_info/get_server_settingscheck_restart_required/restart_splunk/refresh_splunklist_jobs/get_job_status/get_job_results/cancel_job
Example Prompts
- "Search for errors in the last hour"
- "List all indexes and their sizes"
- "Create an alert for failed logins"
- "Show dashboards in the security app"
Development
# Clone and install
git clone https://github.com/pahar0/mcp-server-splunk.git
cd mcp-server-splunk
uv sync
# Run locally
export SPLUNK_HOST=localhost SPLUNK_TOKEN=your-token
uv run mcp-server-splunk
# Debug with MCP Inspector
npx @modelcontextprotocol/inspector uv run mcp-server-splunk
License
Apache 2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_server_splunk-0.2.0.tar.gz.
File metadata
- Download URL: mcp_server_splunk-0.2.0.tar.gz
- Upload date:
- Size: 27.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f1237ab66b3fc48e45cdc5d9735d91a4f8a3ccffba26efe19b9490184ac4a510
|
|
| MD5 |
bd18ac2b5216505bfe50e92213c0a901
|
|
| BLAKE2b-256 |
077b23cb3958e9433fb2607d30cdab526586345ea5fbc8a7e5ea1dc5f6dc7f86
|
File details
Details for the file mcp_server_splunk-0.2.0-py3-none-any.whl.
File metadata
- Download URL: mcp_server_splunk-0.2.0-py3-none-any.whl
- Upload date:
- Size: 35.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b0cf9e3595d108c32e73b8db8878daf62ca197efbb6b33d1979620fd44886ef0
|
|
| MD5 |
99330d27d363358a355df620329d304c
|
|
| BLAKE2b-256 |
12803a1a0e0bca950c99acbf282e6ff2c16cf659c00250facc6a96bdca80baf8
|