Splunk MCP Server 2.1: Enhanced Token Management and OAuth Integration for AI Agent
Artificial Intelligence JD RadadiyaKey takeaways
- Splunk MCP Server 2.1 allows users to create and manage their own MCP encrypted tokens, reducing the administrative burden of issuing credentials for each user
- Splunk OAuth is the recommended connection method, allowing users to sign in through a browser so no long-lived credential is stored in the agent's configuration.
- Organizations can choose from Splunk OAuth, MCP encrypted tokens, or an external OAuth server, and every agent can only access what its assigned Splunk roles permit.
Splunk MCP Server lets AI agents, assistants, and coding tools work with your Splunk data. Every agent has to sign in to Splunk before it can run a search, and until now that step has created work for Splunk admins. This post covers what changed in Splunk MCP Server 2.1 and walks through the three ways to connect an agent, in the order we recommend them.
What Changed in 2.1
Admins no longer have to create and manage a token for each user. Before 2.1, only admins could create MCP encrypted tokens, the tokens agents use to connect to Splunk MCP Server. A user who wanted to connect an agent asked an admin, the admin created one and sent it over, and then made a new one when it expired.
In 2.1, an admin grants a capability to a role, and users in that role create and manage their own MCP encrypted tokens in the app. Admins still see every MCP encrypted token in the deployment and can deactivate or delete any of them. A supported REST API also lets teams create and manage them from their own scripts and pipelines.
Splunk OAuth is also now available on Splunk Cloud Platform 10.5 and later, in all regions on AWS, Microsoft Azure, and Google Cloud, and in FedRAMP regions. With OAuth, users sign in through their browser, so they don't need an MCP encrypted token and no token is stored in the agent's configuration.
Our Recommendation
Use Splunk OAuth if it's available to you. If it isn't, upgrade to Splunk MCP Server 2.1 so your users can create their own MCP encrypted tokens and you can manage them through the REST API.
Which Method Fits
How your users sign in to Splunk doesn't change this choice. Splunk OAuth works the same with SAML single sign-on. MCP encrypted tokens need one extra setup step for SAML users, covered in method 2.
All three methods follow the same rule: an agent can only see and do what its Splunk roles allow. To run MCP tools, the role needs the mcp_tool_execute capability.
1. Splunk OAuth (Recommended)
Each person signs in to Splunk in their browser, and the agent works with that person's Splunk permissions. Nobody needs an MCP encrypted token, and there's no long-lived credential in the agent's configuration file.
Splunk OAuth is available on Splunk Cloud Platform. It works with MCP clients that support OAuth 2.1 sign-in with PKCE, such as Claude Code and Cursor. The documentation lists which clients have been tested.
Admin Setup, Once per AI Tool
- In Splunk Web, go to Settings > Authentication methods > Splunk OAuth Clients and select Create Client. Splunk OAuth is available on all Splunk Cloud Platform 10.5 and later stacks. If you're on an earlier version, upgrade to Splunk Cloud Platform 10.5 to get Splunk OAuth. If you're on 10.5 or later and don't see Splunk OAuth Clients, contact Splunk Support.
- Enter a name your users will recognize, such as cursor. They see this name when they approve access.
- Enter the redirect URI the AI tool uses. Tools that run on a laptop often use http://localhost:<port>/callback, and the port must match the tool's configuration exactly. Other tools, such as Cursor and web-based assistants, publish their own fixed callback URL in their documentation.
- After Splunk Cloud Platform 10.7 you have the option of changing the token endpoint auth method from either client_secret_basic or client_secret_post. Basic sends credentials via the header while post will send in the request body.
- Save. Splunk shows the client ID, client secret, authorization URL, and token URL. Copy all four now, because the secret is shown only once.
- Share the client ID, client secret, authorization URL, token URL, and MCP endpoint with your users through a password manager or secrets vault. You can copy the endpoint in the Splunk MCP Server app under Setting > Server, where it's labeled MCP server URL. If the tool uses a localhost redirect URI, also tell users which port it uses.
- Check that token authentication and REST API access are turned on, and that your users' roles have mcp_tool_execute. If any of these is missing, sign-in can succeed while tool calls fail.
The client ID and secret identify the AI tool, not the person. Each person still signs in as themselves, so sharing them doesn't share anyone's Splunk access.
Create a separate OAuth client for each AI tool or team. Then you can remove access for one tool without affecting the others.
Connecting an Agent
- Add the Splunk MCP endpoint to your MCP client with the client ID and client secret, and set the scopes to openid offline_access. Depending on the client, you also enter the authorization URL and token URL, or the callback port. For exact steps, see Connect Claude to Splunk MCP Server or Connect Cursor to Splunk MCP Server.
- Start the connection. Your browser opens the Splunk sign-in page.
- Sign in and approve access.
- The browser hands control back to the client, and the agent is connected.
2. MCP Encrypted Tokens (Splunk MCP Server 2.1)
Use MCP encrypted tokens when Splunk OAuth isn't available, for example on Splunk Enterprise or with an MCP client that doesn't support Splunk OAuth sign-in. You create an MCP encrypted token in the Splunk MCP Server app. It works only with Splunk MCP Server, and it carries the permissions of the user who created it. A regular Splunk authentication token from Settings > Tokens doesn't work with Splunk MCP Server.
Admin Setup, Once
Upgrade the Splunk MCP Server app to 2.1 from Splunkbase.
- Turn on token authentication in Settings > Tokens, if it isn't on already. MCP encrypted tokens need it.
- In the Splunk MCP Server app, go to Setting > Encrypted Tokens > Encryption key and generate a key if one doesn't exist yet. Nobody can create MCP encrypted tokens without it.
- Give the roles that should use MCP these capabilities:
- mcp_tool_execute, to connect and run tools
- mcp_edit_tokens_own, to manage their own MCP encrypted tokens in the app
- edit_tokens_own, a Splunk platform capability that users also need to create MCP encrypted tokens for themselves
After that, admins don't handle MCP encrypted tokens for those users. From the Encrypted Tokens tab, an admin can see every MCP encrypted token with its owner, status, and expiry date, deactivate or delete any of them, and create one for a user when needed.
Connecting an Agent
- In the Splunk MCP Server app, go to Setting > Encrypted Tokens and select Create token.
- Choose when the token expires, then select Create.
- Copy the MCP encrypted token and keep it somewhere safe, such as a password manager. It's shown only once.
- Expand How to set up your MCP client, copy the configuration, and add it to your MCP client. Your endpoint and token are already filled in.
Users can have up to three MCP encrypted tokens of their own. To replace one before it expires, create a new one, update your client, and then delete the old one.
Scripts and pipelines can create and manage MCP encrypted tokens through the REST API, with the same permissions and limits as the app.
If Your Users Sign in With SAML Single Sign-on
An agent uses its MCP encrypted token without a browser sign-in, so Splunk has to ask your identity provider directly who the user is and which groups they belong to. MCP encrypted tokens follow the same rules as Splunk authentication tokens here. If your SAML users already use Splunk authentication tokens, there's nothing more to set up.
SAML users sign in to Splunk with single sign-on, then create an MCP encrypted token and connect their client as above.
Splunk caches the user information it gets from your identity provider for at least an hour, depending on your settings. A group change in your identity provider can take that long to reach the user's MCP encrypted tokens.
3. External OAuth server
Use this method for an agent your team runs as a service, with no person signing in. Your own identity provider, such as Okta or Microsoft Entra ID, issues and controls the agent's credentials, so you manage them the same way as your other applications.
The agent acts as itself, not as a person, and it doesn't use an MCP encrypted token. Its access comes from the Splunk roles you map to its group in your identity provider.
Admin Setup
- In your identity provider, register a client application for the agent. Note its client ID and secret, the issuer URL, and the JSON Web Key Set (JWKS) URI.
- Configure the agent’s access tokens to include:
- An audience (aud) value for Splunk.
- A client ID claim that identifies the agent. Common names are azp, cid and appid.
- A group claim whose value identifies the agent’s group. These steps for this differ by provider; see your provider’s documentation for client credentials tokens.
- In Splunk Web, go to Settings > Authentication Methods, select External OAuth Clients under OAuth Configurations, and create a new configuration. Enter the issuer URL, JWKS URI, audience, client ID claim, and group claim.
- Under Role Mapping, map the group your identity provider sends for the agent to a Splunk role. Give that role mcp_user role and access to only the data the agent needs. Ensure the capability mcp_tool_execute is included.
Register one client application per agent. Then you can turn off one agent without affecting the others, and each agent shows up separately in Splunk's audit logs.
How the Agent Connects
The agent requests an access token from your identity provider using its client ID and secret.
- It exchanges that token for a Splunk access token at the Splunk token endpoint, oauth2/v1/token.
- It calls Splunk MCP Server with the Splunk access token.
Step 2 needs code, so this method suits agents your team builds rather than off-the-shelf assistants.
Get Started
Related Articles

Splunk Enterprise Security 8.0: Customer Feedback

