
Splunk
STDIO安全交互Splunk数据的MCP服务器,带内置安全保障
安全交互Splunk数据的MCP服务器,带内置安全保障
A Model Context Protocol (MCP) server that enables AI assistants to securely search, analyze, and validate Splunk queries with built-in safety guardrails.
The Splunk MCP Server provides a standardized interface for AI assistants (like Claude, GitHub Copilot, etc.) to interact with Splunk Enterprise or Splunk Cloud. It implements the Model Context Protocol, allowing seamless integration between AI tools and your Splunk data.
The Model Context Protocol (MCP) is an open standard that enables seamless integration between AI assistants and external data sources. It provides:
This project provides two feature-complete implementations:
Choose your preferred implementation:
cd python cp .env.example .env # Edit .env with your Splunk credentials pip install -e . python server.py
cd typescript cp .env.example .env # Edit .env with your Splunk credentials npm install npm start
validate_spl
- Validate SPL queries for risks before executionsearch_oneshot
- Execute blocking searches with immediate resultssearch_export
- Stream large result sets efficientlyget_indexes
- List available Splunk indexes with metadataget_saved_searches
- Access saved search configurationsrun_saved_search
- Execute pre-configured saved searchesget_config
- Retrieve server configurationThe server includes intelligent guardrails to protect your Splunk environment:
Both implementations follow the same architecture:
┌─────────────┐ MCP Protocol ┌─────────────┐ REST API ┌──────────┐
│ AI Assistant│ ◄─────────────────► │ MCP Server │ ◄─────────────► │ Splunk │
│ (Client) │ stdio/SSE/WS │ (This Repo) │ Port 8089 │ Instance │
└─────────────┘ └─────────────┘ └──────────┘
.env
files (never commit to version control)splunk-mcp-server/
├── README.md # This file
├── LICENSE # MIT License
├── python/ # Python implementation
│ ├── README.md # Detailed Python documentation
│ ├── server.py # Main server implementation
│ ├── guardrails.py # Query validation logic
│ └── tests/ # Test suite and tools
└── typescript/ # TypeScript implementation
├── README.md # Detailed TypeScript documentation
├── server.ts # Main server implementation
├── guardrails.ts # Query validation logic
└── tests/ # Test scripts
We welcome contributions! Please see the implementation-specific README files for development setup and guidelines.
This project is licensed under the MIT License - see the LICENSE file for details.
Choose your preferred implementation above to get started with detailed setup instructions, configuration options, and usage examples.