Skip to main content

MCP server for Splunk

Project description

Deslicer

MCP Server for Splunk

FastMCP Python Docker MCP Tests Passing Community License

Enable AI agents to interact seamlessly with Splunk environments through the Model Context Protocol (MCP)

Transform your Splunk instance into an AI-native platform. Our community-driven MCP server bridges Large Language Models and Splunk Enterprise/Cloud with 20+ tools, 16 resources (including CIM data models), and production-ready securityโ€”all through a single, standardized protocol.

๐ŸŒŸ Why This Matters

  • ๐Ÿ”Œ Universal AI Connection: One protocol connects any AI to Splunk data
  • โšก Zero Custom Integration: No more months of custom API development
  • ๐Ÿ›ก๏ธ Production-Ready Security: Client-scoped access with no credential exposure
  • ๐Ÿค– AI-Powered Workflows: Intelligent troubleshooting agents that work like experts
  • ๐Ÿค Community-Driven: Extensible framework with contribution examples

๐Ÿš€ NEW: AI-Powered Troubleshooting Workflows - Transform reactive firefighting into intelligent, systematic problem-solving with specialist AI workflows.

๐Ÿ“‹ Table of Contents

๐Ÿš€ Quick Start

Prerequisites

  • Python 3.10+ and UV package manager
  • Nodejs (optional used for mcp inspector)
  • Docker (optional but recommended for full stack)
  • Splunk instance with API access (or use included Docker Splunk)

๐Ÿ“– Complete Setup Guide: Installation Guide

Configuration

Before running the setup, configure your Splunk connection:

# Copy the example configuration
cp env.example .env

# Edit .env with your Splunk credentials
# - Use your existing Splunk instance (local, cloud, or Splunk Cloud)
# - OR use the included Docker Splunk (requires Docker)

# Optional HTTP transport defaults (local runs)
# - Stateless HTTP avoids sticky-session requirements
# - JSON responses improve compatibility with some clients
# These are already the defaults for local runs via `mcp-server --local`
echo "MCP_STATELESS_HTTP=true" >> .env
echo "MCP_JSON_RESPONSE=true" >> .env

One-Command Setup

Windows:

git clone https://github.com/deslicer/mcp-for-splunk.git
cd mcp-for-splunk

```python
# Start the MCP Server (project script)
uv run mcp-server --local --detached

# Verify the server
uv run mcp-server --test
# Optional: show detailed tools/resources and health output
uv run mcp-server --test --detailed

macOS/Linux:

git clone https://github.com/deslicer/mcp-for-splunk.git
cd mcp-for-splunk

# (Recommended) Preview what would be installed
./scripts/smart-install.sh --dry-run

# Install missing prerequisites (base: Python, uv, Git, Node)
./scripts/smart-install.sh

# Start the MCP Server (project script)
# Local runs default to HTTP stateless mode + JSON response
uv run mcp-server --local --detached

# Verify the server
uv run mcp-server --test
# Optional: show detailed tools/resources and health output
uv run mcp-server --test --detailed

๐Ÿ’ก Deployment Options: The mcp-server command will prompt you to choose:

  • Docker (Option 1): Full stack with Splunk, Traefik, MCP Inspector - recommended if Docker is installed
  • Local (Option 2): Lightweight FastMCP server only - for users without Docker

Stopping services:

  • uv run mcp-server --stop stops only this project's compose services (dev/prod/splunk). It does not stop the Docker engine.

Note on Splunk licensing: When using the so1 Splunk container, you must supply your own Splunk Enterprise license if required. The compose files include a commented example mount: # - ./lic/splunk.lic:/tmp/license/splunk.lic:ro. Create a lic/ directory and mount your license file, or add the license via the Splunk Web UI after startup.

๐ŸŽฏ What You Can Do

๐Ÿค– AI-Powered Troubleshooting (NEW!)

Transform your Splunk troubleshooting from manual procedures to intelligent, automated workflows using the MCP server endpoints:

# Discover and execute intelligent troubleshooting workflows
result = await list_workflows.execute(ctx, format_type="summary")
# Returns: missing_data_troubleshooting, performance_analysis, custom_workflows...

# Run AI-powered troubleshooting with a single command
result = await workflow_runner.execute(
    ctx=ctx,
    workflow_id="missing_data_troubleshooting",
    earliest_time="-24h",
    latest_time="now",
    focus_index="main"
)
# โ†’ Parallel execution, expert analysis, actionable recommendations

๐Ÿš€ Key Benefits:

  • ๐Ÿง  Natural Language Interface: "Troubleshoot missing data" โ†’ automated workflow execution
  • โšก Parallel Processing: Multiple diagnostic tasks run simultaneously for faster resolution
  • ๐Ÿ”ง Custom Workflows: Build organization-specific troubleshooting procedures
  • ๐Ÿ“Š Intelligent Analysis: AI agents follow proven Splunk best practices

๐Ÿ“– Read the Complete AI Workflows Guide โ†’ for detailed examples, workflow creation, and advanced troubleshooting techniques.

๐Ÿ“š Documentation Hub

Document Purpose Audience Time
๐Ÿค– AI-Powered Troubleshooting Intelligent workflows powered by the workflow tools All users 5 min
Getting Started Complete setup guide with prerequisites New users 15 min
Integration Guide Connect AI clients Developers 30 min
Deployment Guide Production deployment DevOps 45 min
Workflows Guide Create and run workflows (OpenAI env vars) Developers 10 min
API Reference Tool documentation Integrators Reference
Resources Reference Access CIM data models and Splunk docs All users Reference
Contributing Add your own tools Contributors 60 min
๐Ÿ“– Contrib Guide Complete contribution framework Contributors 15 min
Architecture Technical deep-dive Architects Reference
Tests Quick Start First success test steps Developers 2 min
Plugins Extend with entry-point plugins (separate package) Integrators 5 min

๐Ÿ”ง Available Tools & Capabilities

๐Ÿค– AI Workflows & Specialists (NEW!)

  • list_workflows: Discover available troubleshooting workflows (core + contrib)
  • workflow_runner: Execute any workflow with full parameter control and progress tracking
  • workflow_builder: Create custom troubleshooting procedures for your organization
  • Built-in Workflows: Missing data troubleshooting, performance analysis, and more
  • ๐Ÿ“– Complete Workflow Guide โ†’

๐Ÿ” Search & Analytics

  • Smart Search: Natural language to SPL conversion
  • Real-time Search: Background job management with progress tracking
  • Saved Searches: Create, execute, and manage search automation

๐Ÿ“Š Data Discovery

  • Metadata Exploration: Discover indexes, sources, and sourcetypes
  • Schema Analysis: Understand your data structure
  • Usage Patterns: Identify data volume and access patterns

๐Ÿ‘ฅ Administration

  • App Management: List, enable, disable Splunk applications
  • User Management: Comprehensive user and role administration
  • Configuration Access: Read and analyze Splunk configurations

๐Ÿฅ Health Monitoring

  • System Health: Monitor Splunk infrastructure status
  • Degraded Feature Detection: Proactive issue identification
  • Alert Management: Track and analyze triggered alerts

๐ŸŒ Client Integration Examples

๐Ÿ’ช Multi-Client Configuration Strength: One of the key advantages of this MCP Server for Splunk is its ability to support multiple client configurations simultaneously. You can run a single server instance and connect multiple clients with different Splunk environments, credentials, and configurations - all without restarting the server or managing separate processes.

๐Ÿ”„ Multi-Client Benefits

Session-Based Isolation: Each client connection maintains its own Splunk session with independent authentication, preventing credential conflicts between different users or environments.

Dynamic Configuration: Switch between Splunk instances (on-premises, cloud, development, production) by simply changing headers - no server restart required.

Scalable Architecture: A single server can handle multiple concurrent clients, each with their own Splunk context, making it ideal for team environments, CI/CD pipelines, and multi-tenant deployments.

Resource Efficiency: Eliminates the need to run separate MCP server instances for each Splunk environment, reducing resource consumption and management overhead.

Cursor IDE

Single Tenant

{
  "mcpServers": {
    "splunk": {
      "command": "fastmcp",
      "args": ["run", "/path/to/src/server.py"],
      "env": {
        "MCP_SPLUNK_HOST": "your-splunk.com",
        "MCP_SPLUNK_USERNAME": "your-user"
      }
    }
  }
}

Client Specified Tenant

{
    "mcpServers": {
      "splunk-in-docker": {
        "url": "http://localhost:8002/mcp/",
        "headers": {
          "X-Splunk-Host": "so1",
          "X-Splunk-Port": "8089",
          "X-Splunk-Username": "admin",
          "X-Splunk-Password": "Chang3d!",
          "X-Splunk-Scheme": "http",
          "X-Splunk-Verify-SSL": "false",
          "X-Session-ID": "splunk-in-docker-session"
        }
    },
        "splunk-cloud-instance": {
        "url": "http://localhost:8002/mcp/",
        "headers": {
          "X-Splunk-Host": "myorg.splunkcloud.com",
          "X-Splunk-Port": "8089",
          "X-Splunk-Username": "admin@myorg.com",
          "X-Splunk-Password": "Chang3d!Cloud",
          "X-Splunk-Scheme": "https",
          "X-Splunk-Verify-SSL": "true",
          "X-Session-ID": "splunk-cloud-session"
        }
    }
  }
}

Google Agent Development Kit

from google.adk.tools.mcp_tool.mcp_toolset import MCPToolset

splunk_agent = LlmAgent(
    model='gemini-2.0-flash',
    tools=[MCPToolset(connection_params=StdioServerParameters(
        command='fastmcp',
        args=['run', '/path/to/src/server.py']
    ))]
)

๐Ÿค Community & Contribution

Quick links: Contributing ยท Code of Conduct ยท Security Policy ยท Governance ยท License

๐Ÿ› ๏ธ Create Your Own Tools & Extensions

๐Ÿš€ Quick Start for Contributors:

# Interactive tool generator (project script)
uv run generate-tool

# Browse existing tools for inspiration
./contrib/scripts/list_tools.py

# Validate your tool implementation (project script)
uv run validate-tools

# Test your contribution
./contrib/scripts/test_contrib.py

๐Ÿ“– Complete Contributing Guide โ†’ - Everything you need to know about creating tools, resources, and workflows for the MCP Server for Splunk.

Contribution Categories

  • ๐Ÿ›ก๏ธ Security Tools: Threat hunting, incident response, security analysis
  • โš™๏ธ DevOps Tools: Monitoring, alerting, operations, SRE workflows
  • ๐Ÿ“ˆ Analytics Tools: Business intelligence, reporting, data analysis
  • ๐Ÿ’ก Example Tools: Learning templates and patterns for new contributors
  • ๐Ÿ”ง Custom Workflows: AI-powered troubleshooting procedures for your organization

๐Ÿš€ Deployment Options

Development (Local)

  • Startup Time: ~10 seconds
  • Resource Usage: Minimal (single Python process)
  • Best For: Development, testing, stdio-based AI clients
  • HTTP Defaults: Local runs enable MCP_STATELESS_HTTP=true and MCP_JSON_RESPONSE=true by default for compatibility with Official MCP clients (no sticky sessions; JSON over SSE).
    • Endpoint: http://localhost:8003/mcp/
    • Required client headers:
      • Accept: application/json, text/event-stream
      • MCP-Session-ID: <uuid> (preferred; X-Session-ID optional)
      • X-Splunk-* headers (host, port, username, password, scheme, verify-ssl) or set via .env

Production (Docker)

  • Features: Load balancing, health checks, monitoring
  • Includes: Traefik, MCP Inspector, optional Splunk
  • Best For: Multi-client access, web-based AI agents
  • Session Routing: Traefik is configured with sticky sessions for streamable HTTP; alternatively, enable stateless HTTP for development scenarios.

Enterprise (Kubernetes)

  • Scalability: Horizontal scaling, high availability
  • Security: Pod-level isolation, secret management
  • Monitoring: Comprehensive observability stack

๐Ÿ†˜ Support & Community

  • ๐Ÿ› Issues: GitHub Issues
  • ๐Ÿ’ฌ Discussions: GitHub Discussions
  • ๐Ÿ“– Documentation: Complete guides and references
  • ๐Ÿ”ง Interactive Testing: MCP Inspector for real-time testing

Windows Support

Windows users get first-class support with PowerShell scripts and comprehensive troubleshooting guides. See our Windows Setup Guide.

๐Ÿ“ˆ Project Stats

  • โœ… 20+ Production Tools - Comprehensive Splunk operations
  • โœ… 16 Rich Resources - System info, documentation, and CIM data models
  • โœ… Comprehensive Test Suite - 170+ tests passing locally
  • โœ… Multi-Platform - Windows, macOS, Linux support
  • โœ… Community-Ready - Structured contribution framework
  • โœ… Enterprise-Proven - Production deployment patterns

๐ŸŽฏ Ready to Get Started?

Choose your adventure:

Learn More: Model Context Protocol | FastMCP Framework

Project details


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

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file iflow_mcp_deslicer_mcp_server_for_splunk-0.5.1.tar.gz.

File metadata

  • Download URL: iflow_mcp_deslicer_mcp_server_for_splunk-0.5.1.tar.gz
  • Upload date:
  • Size: 349.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_deslicer_mcp_server_for_splunk-0.5.1.tar.gz
Algorithm Hash digest
SHA256 d48735da738be7df15e2553c03f63da179ec0d071a78f016fe66b2ab1bdd39cc
MD5 529ef7fdb2a7e51716f1f290f0349022
BLAKE2b-256 d4fc616f0361ed8db18d9136976e18bc6f3b7dd2a929ae7a341f38933cdafe0c

See more details on using hashes here.

File details

Details for the file iflow_mcp_deslicer_mcp_server_for_splunk-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: iflow_mcp_deslicer_mcp_server_for_splunk-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 340.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_deslicer_mcp_server_for_splunk-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 470f44199be4d66ad38b8cdd8396a9308a74a0fbb46f2c0c898ba78d6735e978
MD5 94792e19128f52d2a5ddd3d446c29721
BLAKE2b-256 29b6bbd8142906bfb3c3206af18acdb5da34e6a8c38f11e24fb110b5f8d9db44

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page