I Set Up the Official Splunk MCP Server and Investigated Logs from Claude Without Writing SPL

I Set Up the Official Splunk MCP Server and Investigated Logs from Claude Without Writing SPL

I set up the Splunk MCP Server and investigated CloudTrail from Claude in natural language. No SPL needed: the AI turns vague requests into search conditions and rechecks noisy data. Covers setup, permissions and real use.
2026.11.27

This page has been translated by machine translation. View original

Introduction

This is Sakai from Classmethod.

When investigating logs in Splunk, beginners often struggle with "how to write SPL." On the other hand, even people who are used to Splunk can have trouble with the "starting point" of an investigation: how to begin. Even when you know what you want to look into, you have to start by remembering which index holds the data, what the arguments of a certain command were, and so on.

Splunk provides an official MCP Server on Splunkbase. Once you install it, you can query Splunk data directly from a generative AI such as Claude.

This time I installed the Splunk MCP Server on Splunk Cloud Platform and investigated CloudTrail from Claude using only natural language. I also verified how the permissions given to the AI should be designed, and whether Machine Data Lake data is supported.

To give the conclusion first: the investigation worked without writing a single line of SPL. Moreover, the AI takes over the construction of the investigation itself.

What can the Splunk MCP Server do?

It is an official app distributed on Splunkbase. When you install it on the search head, MCP-compatible AI clients can connect to Splunk.

There are four key points about what changes once it is installed.

No need to set up a separate server

There have long been ways to access Splunk from AI, and community-made MCP servers are also available. In that case, however, you have to keep a separate process running on your own machine or server. The official app runs on the search head, so no additional server is required.

What you give the client is an MCP-only credential

To connect, you write a token into the client's configuration. What you hand over here is not a general-purpose Splunk credential but an encrypted token whose use is limited to MCP.

Splunk authentication tokens include a value called Audience that indicates their purpose. For MCP encrypted tokens, this is fixed to mcp, and they cannot be used to call the Splunk REST API directly.

Even if a token were leaked, the only thing it allows is access through MCP tools. The accessible range follows the role of the associated Splunk user, and the tools that can be used can also be restricted on the server side.

It can explore data, not just run searches

The tools provided are not limited to splunk_run_query (which runs SPL/SPL2). Tools for investigating the environment, such as splunk_get_indexes, splunk_get_metadata, and splunk_get_knowledge_objects, are also available. This means you can start an investigation even when you do not know what logs are where.

Tools are namespaced by prefix: splunk_ is for the core platform, and saia_ is for the Splunk AI Assistant tools.

The full list of tools and descriptions of each are summarized in the official documentation.

You can control on the Splunk side how much the AI is allowed to touch

In the app's Tools tab you can enable or disable each tool, and in the Guardrails tab you can set which SPL commands are allowed to run, as well as timeouts and limits on the number of results. No matter what the client specifies, tools disabled on the server are not loaded.

Test environment

Item Details
Splunk Splunk Cloud Platform (Victoria Experience)
App Splunk MCP Server v1.3.0
Client Claude Desktop
Target logs CloudTrail (index=aws)

The setup is simple: Claude connects over HTTPS to the MCP endpoint under Splunk Web, and the MCP Server app on the search head runs the searches.

Setup steps

1. Enable token authentication

Settings → Tokens → Token Settings

Turn token authentication on. The default expiration is +30d, and you can specify either a relative time (+10m, +20h, +30d) or never.

2. Install the Splunk MCP Server app

Search for "Splunk MCP Server" from Apps → Find More Apps.

The one whose author is Splunk LLC is the official app. On Victoria Experience, I was able to install it through self-service installation. No request to support is required.

3. Create a role and user for MCP

This is the most important step. I will explain the details later, but let me state the conclusion first.

Create the role mcp_test.

In the Indexes tab, check only the indexes you allow to be searched. This time I chose two: aws, which contains CloudTrail, and test_machine_data_lake_promoted_cloudtail_tsindex, which was promoted from Machine Data Lake.

In the Capabilities tab, grant mcp_tool_execute and search. The former is the permission to run MCP tools, and the latter is required to run searches.

Create a user and assign only this role to it.

It makes later account reviews easier if you give the user a name that makes clear it is for MCP, such as mcp-sakai.takeshi.

4. Check the endpoint

When you open the app, the information needed for the connection is displayed.

  • Server Status is Server is active
  • The Endpoint URL (https://<stack name>.splunkcloud.com/en-US/splunkd/__raw/services/mcp)

It is cut off at the bottom here, but the lower part of the screen also shows a sample configuration under MCP Configuration that you paste into the client.

5. Create an encrypted token

Click Create MCP Encrypted Token.

Field Details
User The Splunk user to associate the token with. Here, mcp-sakai.takeshi
Audience Fixed to mcp. Cannot be edited
Expiration Specified as a relative time. Maximum +180d
Not Before The time at which the token becomes valid. If left blank, it is valid immediately

Normal Splunk authentication tokens can last up to +18y, but MCP encrypted tokens last at most 180 days. Since this is for testing, I kept it short.

The token is displayed only once, right after creation. Be sure to copy it before closing the screen.

Note that this encrypted token is MCP-only and cannot be used for normal Splunk API calls. Conversely, you cannot reuse an existing Splunk authentication token for MCP.

6. Register it in the client and connect

Set the MCP Configuration shown in the app in the MCP client you use.

First, have it look at the environment

Once connected, I asked what exists in this environment.

Splunkにどんなindexとsourcetypeがあるか教えて

After retrieving the index list with splunk_get_indexes, it built a tstats search on its own and even aggregated the event counts for the last 30 days. A table was returned showing which sourcetypes are in each index and how many events.

Here it reported two things I had not asked about.

The tool output does not match reality

splunk_get_indexes shows 8 indexes. (omitted) The counts are displayed as 0, but main and others actually contain data. The counts and status in this list appear to be out of sync with reality.

It also happened that an index not appearing in the list was visible with tstats. In other words, it did not trust the tool output as is; it verified with a search and then reported the discrepancy itself.

It found a problem with ingestion settings

lastchanceindex is where events are placed when the index they were routed to does not exist. Data from helix:* is not going into its intended index and is accumulating here.

I had not asked it to investigate, yet it noticed a defect in the environment and pointed it out.

And looking at these results, I noticed something. From this connecting user, almost the entire environment was visible. Although I had created a dedicated user and limited its permissions to only the aws and test_machine_data_lake_promoted_cloudtail_tsindex indexes, the user role that is assigned by default had remained.

Having the AI investigate logs has worked up to this point, so let me think a bit more about the permissions given to the AI.

How to design the permissions given to the AI

Permission design is a major consideration to avoid granting the AI broader permissions than necessary.

Premise: the encrypted token is tied to a Splunk user

As you specify a User when creating the token, an MCP encrypted token is tied to an existing Splunk user. And the range the AI can search is exactly that user's permissions. Searches run as that user, and that username also remains in the job history.

Consider whether to just use a user meant for console operations

I think it is a common requirement to want access via AI to be narrower than what a human can normally touch.
So I decided to create a user and role for the AI and define them on my own.

Permissions needed for the dedicated role

This time I created a role called mcp_test and assigned it to the dedicated user.

  • Indexes: allow only aws and the MDL-promoted index
  • Federated datasets: allow the MDL datasets
  • Capabilities: mcp_tool_execute and search

You need to be careful with capabilities. mcp_tool_execute allows running MCP tools, but does not include the permission to run searches. If you connect with a role that only has this, every tool fails with this error.

insufficient permission to access this resource

Adding search resolved it. This permission normally comes implicitly via the user role, so it is easy to miss when creating a dedicated role from scratch.

Always verify that access is actually restricted

After configuring, verify by actually requesting an index you did not allow.

index=main sourcetype=linux_audit の直近24時間のイベントを5件、生ログのまま見せて

Target Result
index=aws (allowed) Searchable
index=main (not allowed) 0 results
index=summary (not allowed) 0 results

The thing to know here is that an index you do not have permission for returns 0 results, not an error.

If the search capability itself is missing, you get an explicit permission error, but if you have search and lack only the index permission, 0 results are returned silently. In fact, when I had the AI investigate in this state, it speculated that "it is unlikely that the data has disappeared; permissions have probably changed," but without certainty it urged me to check with the administrator.

In other words, it is hard to notice both when you have restricted too much and when you have not restricted enough. After configuring, you should confirm both that data can be retrieved from the allowed indexes and that it cannot be retrieved from the indexes you did not allow.

Also, since access control finer than the index level cannot be applied, the index design itself needs to be done properly.

Investigating logs without writing SPL

With the permission design settled, on to the main subject: the investigation. Using CloudTrail as the subject, I will ask three questions.

First, grasp the overall picture

2026年11月10日から11月12日のCloudTrailで、eventNameごとの件数を多い順に出して

The total was 11,649 events, with 508 distinct eventNames. The top results were as follows.

Rank eventName Count
1 AssumeRole 4,049
2 GetBucketAcl 1,585
3 GetResources 544
4 ListResources 523
5 PutEvaluations 287

It does not just output an aggregation table; it also reads the trends.

  • AssumeRole accounts for about 35% of the total
  • Most of the top entries are read-type events such as Get* / List* / Describe*, which appear to be the result of AWS Config and Security Hub periodically collecting configuration information
  • The roughly 490 types from rank 21 onward are mostly 1–4 events each
  • Configuration-change events are few (PutEvaluations 287, CreateLogStream 22, etc.)

In SPL this would be equivalent to stats count by eventName | sort -count, but it also returns the follow-up of "so, what does this mean?"

Have it translate vague instructions into conditions

Next, I deliberately ask in a vague way.

この期間で、AWSサービスの自動操作ではなく人が操作したイベントだけに絞れる?

I did not specify at all how to define "operated by a human." The way it handled this was impressive.

First, it aggregates userIdentity.type.

type Count
AssumedRole 6,056
AWSService 5,584
AWSAccount 4
Unknown 3
(none) 2

IAMUser and Root, which are recorded when a human logs in directly, were 0. However, since there are 6,000 AssumedRole events, it does not stop there. It examined the contents, confirmed that most are service-linked roles of the form AWSServiceRoleFor..., and then designed the exclusion conditions on its own.

  1. Events of type AWSService
  2. Events by AWSServiceRole* roles
  3. Events whose source is *.amazonaws.com

The remaining 67 events were also examined, and turned out to be automated processing by three roles: SplunkDMReadOnly (Splunk Data Manager), SplunkDMCloudWatchLogProcessorLambdaRole, and aws-controltower-ForwardSnsNotificationRole.

The conclusion was "there were no events operated by humans in this period." It also added the following supplementary information.

  • When logging in via IAM Identity Center (SSO), AWSReservedSSO_... and a session name should be recorded, but there were no such events this time
  • Things it had not checked: a total of 9 events, namely 4 AWSAccount / 3 Unknown / 2 with no type
  • This data covers only 11/10 to 11/12

I liked that it states clearly what it checked and what it did not.

Have it triage the errors

Finally, a question that is more like a real investigation.

エラーになっているAPIコールはある?あれば内容を教えて

There were about 283 error events in 37 patterns. Here too, it returned them not as a simple list but sorted into categories.

Before that, there was this preface.

In the first aggregation, some events had the value success in errorCode. These are not actual errors, so I excluded them and re-aggregated.

It noticed the noise in the data on its own and double-checked the numbers. I had not instructed it to.

The triage resulted in four categories.

(1) Needs checking: permission errors

eventName Count Details
DescribeStacks 28 The SplunkDMReadOnly role tried to retrieve CloudFormation stacks in sa-east-1 and was denied by an explicit Deny in an SCP
ListOrganizationAdminAccounts 3 Insufficient permissions
ListResources 3 Error with unknown details

(2) Expected: the configuration does not exist (about 190 events, about 2/3 of the total)

GetBucketLifecycle / NoSuchLifecycleConfiguration 38 events, GetRegistryPolicy / RegistryPolicyNotFoundException 38 events, GetBucketCors 23 events, and so on. It added, "The S3 bucket simply does not have that configuration, so it is not a problem."

(3) Unsubscribed services / discontinued features

QuickSight and Shield without subscriptions, IoT Device Defender no longer being offered to new customers, and so on.

(4) Throttling

ListFirewallRuleGroups 8 events and others. "This is the kind that resolves on retry. No action seems necessary."

And then the conclusion.

What you actually need to pay attention to is that Splunk DM's DescribeStacks is being denied by an SCP.

From 283 errors, it extracted the one point worth looking at. And it added this as well.

However, from this log alone it is not possible to determine whether this denial is related to the ingestion stopping.

It distinguishes what can and cannot be said from the logs. I felt this is behavior you can trust in an investigation partner.

What I felt through the investigation

It is true that I did not have to write SPL, but I felt the value is not only there.

Translating the vague instruction "events operated by humans" into multi-stage conditions — aggregating userIdentity.type → excluding service-linked roles → excluding source domains — is the design of the investigation itself. The same goes for the error triage: it ran the standard triage pattern that an analyst would follow.

For people who can write SPL, it means "skipping the first draft"; for people unfamiliar with SPL, it means "being able to start writing in the first place." I think it works for both groups.

Can Machine Data Lake data be searched?

I was curious whether it could also reach long-term retained data, so I asked about Machine Data Lake (MDL) as well.

Machine Data Lakeのデータセットを検索できる?

The conclusion was "you cannot directly search MDL datasets (Raw Table / Analytics Table) via MCP."

It explained the reasons as follows.

  • No dedicated SPL command for searching MDL tables by name has been published
  • MDL data is meant to be searched from Catalog → Datasets in Splunk Cloud
  • What this MCP uses is the REST API for normal SPL searches, and the Catalog screen and Analytics Table searches via SPL2 are not available through this API

There are three ways to search MDL, each with different limitations.

Type Use Limitations
Raw search Checking whether data is present Filtering only by source / sourcetype / host / time
Analytics search Threat hunting, reports Targets Analytics Tables. Limited to the promoted period and schema
Splunk search Normal index= searches Targets data promoted to a Splunk index

Therefore, it seems the only route from MCP to MDL data is via a promoted index.

Supplement: 2.2 adds tools for MDL

This verification was done with v1.3.0, but in the later 2.2 an mdl_ namespace was added, providing four tools (all as of November 2026).

Tool Description
mdl_prepare_promotion Before creating a promotion, previews sample data and checks the estimated data volume
mdl_create_promotion_job Starts a promotion for the selected source, period, and filters
mdl_get_or_list_promotion_jobs Finds existing promotion jobs and checks their status
mdl_manage_promotion Cancels the target job. Pauses and resumes streaming promotions

What is worth noting is that these are not tools for searching MDL data; all of them appear to be for preparing, starting, checking, and operating jobs that "promote raw MDL data to a searchable destination."

In other words, the conclusion that "the only route to MDL data is via a promoted index" does not change in 2.2. What has changed is that you can now ask the AI to do the promotion itself. A flow where you ask "promote this data" and then search with index= after completion seems likely to be completed entirely within MCP.

Limitations and caveats found through use

Guardrails on the tool side

According to the official documentation, searches have the following limits.

  • They fail if execution time exceeds 1 minute
  • They fail if the response exceeds 1,000 events
  • Commands judged to be destructive or unsafe are blocked

It is not suited to long-running aggregations or extracting large amounts of data. It is realistic to use it as the entry point of an investigation and combine it with conventional searches for full-scale analysis.

From the app's Guardrails tab, you can adjust the timeout and the limit on the number of results, and you can also manage which SPL commands are allowed to run.

Token operations

  • Encrypted tokens are MCP-only. They cannot be used for normal Splunk APIs
  • They are displayed only once at creation
  • The expiration is at most 180 days
  • Invalidate Keys on the app's settings screen is an operation that invalidates the key pair shared by all tokens. Pressing it makes all existing tokens unusable

The last point requires particular care. If you only want to stop an individual token, you can invalidate just that one from the token management screen. Invalidate Keys is best thought of as a switch for shutting off all AI-based access at once in an emergency, and it is good that such a feature exists in case of a security breach.

Summary

I installed the Splunk MCP Server and investigated CloudTrail from Claude using only natural language.

Of course I was able to investigate without writing SPL, but even more impressive was that it translated vague questions into investigation conditions, noticed noise and double-checked the numbers, and sorted the results to narrow them down to "the one point worth looking at." People unfamiliar with SPL can start investigating, and people who are used to it can save the effort of drafting.

On the other hand, permission design is the key when adopting it. Since roles are additive, narrowing what you give the AI requires a dedicated user, and you have to decide for yourself which permissions to stack on that role. Furthermore, since Splunk roles can only be restricted at the index level, it feeds back into an even more upstream design question: whether the indexes are separated in the units you want to show the AI.

Having the AI investigate logs no longer requires any special preparation. Rather, this verification left me feeling that what we should think about is "what to show it."

I hope this is helpful for those who want to make Splunk investigations more efficient.

Splunk MCP Server

Splunk platform

Machine Data Lake

Share this article