Splunk MCP WebUI
Integrates with Splunk Web UI to run SPL queries, paginate and retrieve search job results by SID, check search job status, list indexes, get index details and metadata, using browser-style username/password login without needing the splunkd management port or tokens.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Splunk MCP WebUIsearch index=main for failed logins in the last 24 hours"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Splunk MCP WebUI
MCP (Model Context Protocol) server cho Splunk — dựa trên các tool của Splunk MCP Server chính hãng, nhưng:
MCP chính hãng | Splunk MCP WebUI | |
Kết nối | splunkd REST API (port 8089) + token/app cài trong Splunk | Splunk Web UI (port 8000) — login bằng form như trình duyệt |
Cấu hình | token, cert, app, roles... | Chỉ 3 field: |
Số tool | ~20 | 6 tool cốt lõi |
Chỉ cần Splunk Web mở được là dùng được — không cần port quản trị 8089, không cần token, không cần cài app lên Splunk.
Các tool
Tool | Mô tả |
| Chạy SPL query, trả về kết quả JSON (mặc định 100 dòng, có |
| Lấy tiếp kết quả của 1 job đã chạy xong theo sid — phân trang khối lượng lớn mà không phải chạy lại search |
| Xem trạng thái 1 job (done/running/failed) và tổng số kết quả |
| Danh sách index dạng compact (tên, kích thước, số event, splunk_server...); |
| Thông tin chi tiết 1 index |
| Metadata |
Related MCP server: Splunk MCP Server
Cài đặt
git clone https://github.com/MysticCoss/splunk-mcp-webui
cd splunk-mcp-webui
pip install -r requirements.txtHoặc cài như package: pip install git+https://github.com/MysticCoss/splunk-mcp-webui — sau đó chạy bằng lệnh splunk-mcp-webui.
Cấu hình
Copy config.example.json thành config.json rồi sửa. Client tìm config theo thứ tự:
Đường dẫn trong biến môi trường
SPLUNK_MCP_CONFIG(nếu đặt)config.jsoncạnh thư mụcsplunk_mcp_webui/(khi clone repo)~/.splunk-mcp/config.json(tiện khi cài bằngpip install git+...— không có thư mục project)
{
"splunk_url": "https://splunk-cua-ban",
"username": "admin",
"password": "mat-khau"
}
config.jsonchứa credential thật nên đã bị.gitignoreloại khỏi repo — chỉ commitconfig.example.json.
Các key tùy chọn (đều có giá trị mặc định, không cần khai báo):
Key | Mặc định | Mô tả |
|
| Locale path của Splunk Web ( |
|
| Xác thực chứng chỉ SSL — mặc định chấp nhận self-signed; đặt |
|
| Chặn các SPL command sửa dữ liệu: |
|
| Giới hạn ký tự của field |
|
| Timeout cho mỗi HTTP request (giây) |
|
| Timeout tối đa cho 1 search job (giây) |
|
| Chu kỳ poll trạng thái job (giây) |
|
| Số dòng trả về mặc định của |
|
| Số dòng tối đa mỗi lần fetch — kết quả nhiều hơn thì dùng |
SSL self-signed
Mặc định client chấp nhận mọi chứng chỉ SSL — kể cả self-signed, cert nội bộ hay cert tự ký của Splunk:
{
"verify_ssl": false
}Đây là giá trị mặc định, không cần khai báo trong config.json. Chỉ khi muốn xác thực chứng chỉ nghiêm ngặt thì mới đặt true, hoặc trỏ tới CA bundle nội bộ (hỗ trợ cert CA riêng của công ty):
{
"verify_ssl": "C:\\certs\\corp-ca.pem"
}Đó là tất cả. Mọi thứ khác tự xử lý: tự detect http/https, locale (en-US...), session cookie, CSRF form-key, tự re-login khi session hết hạn, SSL self-signed được tự động chấp nhận.
splunk_urlchấp nhận mọi dạng:splunk.corp.local,10.0.0.5:8000,http://10.0.0.5:8000,https://splunk.corp.local:8000/en-US. Mật khẩu có thể đặt qua biến môi trườngSPLUNK_URL/SPLUNK_USERNAME/SPLUNK_PASSWORD(ghi đè file) để không lưu plain-text. Đường dẫn config khác:SPLUNK_MCP_CONFIG. ⚠️ Khisplunk_urlghi rõhttps://, client không bao giờ tự hạ cấp xuống HTTP — handshake TLS hỏng sẽ báo lỗi thay vì gửi mật khẩu plaintext.
Bảo mật — dùng tài khoản quyền tối thiểu
read_only: true (mặc định) chặn các lệnh sửa dữ liệu (delete, outputlookup, mcollect, dump, script, map, savedsearch, macro...) — nhưng đây là lớp bảo vệ best-effort, không thay thế phân quyền của Splunk. Hãy tạo account MCP riêng với quyền tối thiểu:
Không có capability
can_deleteKhông có quyền
list_storage_passwords(tránh lộ mật khẩu đã lưu qua lệnhrest)Giới hạn
srchIndexesAllowedđúng các index cần đọcGiới hạn
srchJobsQuotavàsrchTimeWin(cửa sổ thời gian tìm kiếm)
Ngoài ra lưu ý: nội dung log (có thể chứa PII/dữ liệu nhạy cảm) sẽ được gửi tới nhà cung cấp LLM qua MCP client — cân nhắc khi dùng với dữ liệu SOC nội bộ.
SSO/SAML: login đi qua form local-credential (
loginType=splunk) nên hoạt động trên instance bật SSO (kể cả Azure AD). Tuy nhiên account phải dùng xác thực local (username/password) — SAML-only/MFA-only không dùng được.
Kiểm tra kết nối trước khi dùng
python tests\test_real.pyĐăng ký vào MCP client
Claude Code
claude mcp add splunk-webui -s user -- python C:\duong\dan\splunk-mcp-webui\run.py-s user: cài cấp user, dùng được cho mọi project trên máy. Bỏ tham số này thì chỉ áp dụng cho project hiện tại.Kiểm tra: mở Claude Code, gõ
/mcp— phải thấysplunk-webuikèm 6 tool.
Claude Desktop / opencode
Thêm vào file cấu hình MCP của client:
{
"mcpServers": {
"splunk-webui": {
"command": "python",
"args": ["C:\\duong\\dan\\splunk-mcp-webui\\run.py"]
}
}
}Chạy trực tiếp (stdio): python run.py hoặc python -m splunk_mcp_webui.
Cách hoạt động
MCP client ──stdio──> run.py ──HTTP──> Splunk Web (port 8000)
│ 1. GET /en-US/account/login → cookie + CSRF
│ 2. POST /en-US/account/login → session cookie
│ 3. POST /en-US/splunkd/__raw/services/search/jobs → tạo job
│ 4. GET /en-US/splunkd/__raw/services/search/jobs/{sid} → poll
│ 5. GET .../{sid}/results → kết quả JSONKhông dùng port 8089 — mọi REST call đi qua proxy splunkd/__raw/ của chính Splunk Web (giống hệt khi bạn mở Search & Reporting trên trình duyệt).
Test offline (không cần Splunk thật)
python tests\test_offline.py # 46 test: login cũ/mới, CSRF, guard, timeout, SSL fallback, concurrency...
python tests\test_config.py # 12 test: validation config, env override, fail-loud
python tests\test_mcp_server.py # test 6 tool qua giao thức MCPLicense: MIT (xem LICENSE).
Thư mục
ref\(bản giải nén app MCP chính hãng làm tham chiếu schema) không được commit vào repo — tham khảosplunk-mcp-server_200.tgztừ SplunkBase nếu cần.
This server cannot be deployed
Maintenance
Related MCP Connectors
One MCP for the Web. Easily search, crawl, navigate, and extract websites without getting blocked.…
Extract web pages, crawl and map sites, search the web. Extract needs no key; other tools need one.
Programmatic headless browser sessions: create, interact, browse, and extract - rendered in a real
Read, crawl and act on websites, signed in as the user, and turn any site into an API.
Related MCP Servers
- AlicenseBqualityDmaintenanceA FastMCP-based tool for interacting with Splunk Enterprise/Cloud through natural language. This tool provides a set of capabilities for searching Splunk data, managing KV stores, and accessing Splunk resources12106Apache 2.0
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with Splunk Enterprise and Splunk Cloud instances through standardized MCP interface. Supports executing SPL queries, managing indexes and saved searches, listing applications, and retrieving server information with flexible authentication options.-
- FlicenseNot gradedqualityNot gradedmaintenanceEnables users to interact with Splunk instances to execute SPL queries, manage saved searches, and monitor system health. It provides a clean interface for listing dashboards, indexes, and logs through the Model Context Protocol.266 npm-
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to search, manage, and analyze data in Splunk instances through the Model Context Protocol. Supports SPL queries, index management, alerts, dashboards, and more.1,239 PyPI1Apache 2.0