Beta preview: OAuth for MCP Server
Version 1.1 and higher of Splunk MCP Server offers a feature preview of OAuth for MCP Server. This feature can help make Splunk data easier to securely access from AI tools such as Glean, without the need to manage static credentials.
You can use OAuth to let an MCP-compatible client such as Claude Code, Codex, Cursor, or the MCP Inspector, sign in to your Splunk MCP Server through a browser-based OAuth flow rather than a long-lived token.
With OAuth configured, end users authenticate interactively against Splunk, and the client exchanges the resulting authorization code for an access token that it uses to call the MCP endpoint. No static credentials are stored in the MCP client configuration.
Providing feedback
This feature is a closed preview. To report an issue or request enhancements, contact Splunk Support or your account team.
Preview disclaimer
Beta features described in this document are provided by Splunk to you "as is" without any warranties, maintenance and support, or service-level commitments. Splunk makes this Beta feature available at its sole discretion and may discontinue it at any time. Use of Beta features is subject to the Splunk Pre-Release Agreement for Hosted Services.
OAuth prerequisites
- Splunkbase install of the MCP Server for Splunk platform app on your Search Head or Search Head Cluster. See https://splunkbase.splunk.com/app/7931
-
REST API access enabled for the deployment.
-
Token-based authentication enabled. This is required for the underlying MCP Server, independent of the OAuth flow.
-
Role assignment of the
mcp_tool_executecapability, andmcp_tool_admincapability for administrators, to the Splunk roles that need MCP access. -
(Optional) Splunk AI Assistant for generation, explanation, and optimization tools. See https://splunkbase.splunk.com/app/7245
Participating in the beta preview
OAuth for Splunk MCP Server is enabled by Splunk on a per-stack basis. Confirm your stack has been enabled before starting.
When OAuth is enabled, you will see Splunk OAuth Clients (preview) under Settings, and then under Authentication methods in Splunk Web.
Required versions
| Component | Minimum version |
|---|---|
| Splunk Cloud Platform | 10.3.2512.11 |
| Splunk MCP Server app | 1.1.1 or higher |
| MCP client | Version with OAuth 2.1 authorization code + PKCE support. For Claude Code, use 2.1.114 or newer. |
Access and environment
| User | Requirements |
|---|---|
| Admin | Splunk admin credentials with permission to create and manage OAuth clients. |
| End-user | A web browser on the same device where the MCP client runs.
The MCP endpoint URL for your Splunk stack, provided by your administrator. Note: The Splunk MCP endpoint and OAuth authorization endpoints use HTTPS on the default port 443. No additional outbound port configuration is required on the client side. A free, local TCP port, for example, 8787, available for the OAuth callback at http://localhost:<callback-port>/callback. Note: This local callback port is only required for MCP clients that run on your workstation (for example, Claude Code, Cursor, MCP Inspector). Web-based MCP clients use a hosted HTTPS callback URL instead see Step 2 in Part 1. The MCP endpoint URL for your Splunk stack, provided by your administrator. |
Create an OAuth client in Splunk
As an administrator, you can perform these steps once per MCP client application you want to authorize.
Step 1: Open the OAuth client configuration
Complete the following steps:
-
Sign in to Splunk Web as an administrator.
-
Go to Settings and then choose Authentication methods.
-
Open Splunk OAuth Clients (preview).
Step 2: Create a new OAuth client
Complete the following steps:
-
Select New OAuth Client and provide the following:
-
Client Name. A descriptive label, for example claude-code, cursor, or mcp-inspector.
-
Redirect URIs. The callback URL the MCP client will listen on after the user signs in. Choose the pattern that matches your MCP client type:
-
For local MCP clients (running on the user's workstation, for example Claude Code, Cursor, MCP Inspector):
-
Replace <callback-port> with the port the MCP client will listen on (for example, 8787). The port value must match exactly between the Splunk Redirect URI and the MCP client configuration.
-
For Web based / Hosted MCP clients (running as a hosted service, not on the user's workstation):
-
Use the exact callback URI documented by your MCP client. The path varies by product. Confirm with the client's documentation before saving.
-
-
-
Select Save.
Step 3: Capture the client credentials
After the client is created, Splunk displays the following information:
-
Client ID
-
Client secret
-
This is shown once. Copy and store it in a secure location or using a password manager or secrets vault.
-
-
Authorization URL
-
Token URL
-
Grant type
-
Authorization Code with PKCE .
-
Share the following with the end user through a secure channel:
-
Client ID
-
Client secret
-
Redirect URI, including the chosen port
-
The MCP server endpoint for your stack
Connect your MCP client
As an end-user you can perform these steps to connect your MCP client.
Values needed
offline_access to avoid scope negotiation errors.
| Value | Example |
|---|---|
| MCP endpoint | https://<your-stack>.splunkcloud.com/.../mcp |
| Client ID | abc123... |
| Client secret | s3cr3t... |
| Redirect URI | |
| Callback port | 8787: Must match the redirect URI |
| Scopes | openid offline_access |
Connection steps
Every MCP client differs in configuration syntax, but you can follow this general workflow:
-
Register the Splunk MCP Server in your client, using HTTP transport and the MCP endpoint URL.
-
Configure the OAuth section with your Client ID, callback port, and scopes (openid offline_access). Enter the client secret when prompted.
-
Trigger the authentication flow from the client. Your browser opens the Splunk sign-in page.
-
Sign in and approve access for the application.
-
The browser redirects to http://localhost:<callback-port>/callback and the client completes authentication.
-
List available tools in the client to confirm the connection.
Claude Code connection example
The following example uses Claude code and the command line interface (CLI) to make the connection.
For more information on scope restriction in Claude Code, see the Claude Code MCP documentation at https://code.claude.com/docs/en/mcp.
-
Register the Splunk MCP Server.
-
Run the following command on your workstation. Replace the placeholders with the values from your administrator:
CODEclaude mcp add --transport http \ --callback-port <callback-port> \ --client-id <client-id> \ --client-secret \ splunk-mcp <mcp-endpoint> -
When prompted, paste the Client secret:
-
The
<callback-port>must exactly match the port in the Redirect URI your administrator configured in Splunk. -
The
<client-id>is the Client ID from the Splunk OAuth client. -
The
<mcp-endpoint>is the HTTP endpoint of the Splunk MCP Server.
-
-
-
Restrict OAuth scopes. Open Claude Code's configuration file (~/.claude.json) and locate the splunk-mcp entry. Add a scopes field inside the oauth block, set to openid offline_access:
JSON"splunk-mcp": { "type": "http", "url": "<mcp-endpoint>", "oauth": { "clientId": "<client-id>", "callbackPort": <callback-port>, "scopes": "openid offline_access" } } -
Authenticate:
-
Start Claude Code:
claude -
From inside Claude Code, run: /mcp
-
Your browser opens to the Splunk sign-in page.
-
Sign in with your Splunk credentials and approve access for the Claude Code application.
-
The browser redirects to http://localhost:<callback-port>/callback and Claude Code completes authentication.
-
-
Verify tools:
-
Run /mcp again to confirm splunk-mcp is connected.
-
Review the list of tools exposed by the Splunk MCP Server.
-
Invoke any tool to validate end-to-end connectivity. For example, a read-only search tool.
-
Troubleshooting OAuth preview
See the following issues you might encounter when using the OAuth preview and how to address those issues.
"Splunk OAuth Clients (preview)" is not visible
OAuth is not enabled on your stack, or your Splunk role does not grant access to authentication settings. Contact Splunk Support to confirm enablement, and check your role assignments.
Browser opens, but the callback fails or the page shows a redirect error:
The port in the Splunk Redirect URI does not match the callback port configured in your MCP client. Both must be identical, including any protocol or path differences. Correct the mismatch on one side and retry.
Authentication appears to succeed but the client reports a scope error:
Make sure your client is explicitly limited to openid offline_access. Splunk currently advertises additional scopes that many MCP clients do not support.
Self-signed certificate in certificate chain or similar TLS error:
Your operating system does not trust the TLS certificate presented by your Splunk stack. Export the certificate from the Splunk server, add it to your OS trusted certificate store, and mark it as trusted. Restart the MCP client and retry.
Older MCP client version:
If you hit unexpected OAuth or MCP errors, upgrade to a recent release. For Claude Code, confirm version 2.1.114 or newer.
Known limitations
-
Closed preview. The feature is limited to Splunk Cloud Platform customers who have been enabled by Splunk. Support commitments follow the Splunk Pre-Release Agreement.
-
Manual scope restriction required. Splunk's OAuth server advertises more scopes than most MCP clients handle today. Restrict the client to openid offline_access explicitly.
-
One OAuth client per application is recommended. Splunk does not provide shared-consent management across multiple MCP clients.
-
Create a separate OAuth client per tool to keep revocation granular.
-