Splunk Developer Day: Watch all Sessions!Access the Playlist here

Add MCP tools to your Splunk app

Splunk apps can expose their REST endpoints and saved searches as MCP (Model Context Protocol) tools. Once registered, these tools are discoverable and callable by MCP-compatible AI clients such as Cursor, Claude Desktop, and VS Code.

To do this, ship two files in your app:

  • default/tools.conf: declares which endpoints and searches to expose as tools
  • static/tool_input_payload_signatures.json: (optional) defines input parameters for each tool

App Manager handles registration with the Splunk MCP Server automatically when your app is installed, updated, or uninstalled. No additional code is required.

Info

For information about installing and administering the Splunk MCP Server, see the Splunk MCP Server documentation on help.splunk.com.

Prerequisites

  • The Splunk MCP Server App is installed on the target Splunk instance.
  • Your app contains REST endpoints defined in restmap.conf and/or saved searches defined in savedsearches.conf.

Step 1: Create tools.conf

Create default/tools.conf in your app directory. Declare each tool as a stanza.

For a REST endpoint tool:

conf
[restmap:<tool_name>]
description = Clear, concise description of what this tool does
endpoint_name = <stanza_id_from_restmap_conf>
method = get
tags = category1, category2

Where endpoint_name matches a [script:<id>] or [admin:<id>] stanza in your restmap.conf.

For a saved search tool:

conf
[savedsearches:<tool_name>]
description = Clear, concise description of what this search does
search = <stanza_name_from_savedsearches_conf>
tags = search, analytics

Where search matches a stanza name in your savedsearches.conf.

For the full parameter reference, see Configuration Reference.

Step 2: Define input parameters (optional)

If your tools accept parameters, create static/tool_input_payload_signatures.json. Each top-level key matches a tool name from tools.conf.

json
{
"my_tool_name": {
"title": "My Tool Input",
"type": "object",
"properties": {
"param1": {
"title": "Parameter 1",
"type": "string",

For post or put tools that need a specific request body structure, add a body_template. Use $param_name$ placeholders where argument values should be substituted at execution time:

json
{
"my_post_tool": {
"properties": {
"message": {
"title": "Message",
"type": "string",
"required": "true"
}

For the full schema reference, see Configuration Reference.

Step 3: Package and ship

Include both files in your app package:

my_app/
├── default/
│ ├── app.conf
│ ├── restmap.conf # Must contain referenced endpoints
│ ├── savedsearches.conf # Must contain referenced searches
│ └── tools.conf # Tool declarations
├── static/
│ └── tool_input_payload_signatures.json # Input schemas (optional)

That's it. App Manager reads tools.conf on install and registers all declared tools with the MCP server automatically.

Naming conventions

Item
Convention
Example
Tool names
snake_case, start with a letter, letters/digits/underscores only
get_index_info, search_internal_logs
Descriptions
Complete sentence, starts with a verb
Retrieves system information including hostname and OS
Tags
Lowercase, comma-separated
system, diagnostics, info
endpoint_name
Must match the restmap.conf stanza identifier exactly
mcp_test_system_info
search
Must match the savedsearches.conf stanza name exactly
MCP Test - Search Internal Logs
Info

Important: Tool names are enforced as ^[A-Za-z][A-Za-z0-9_]*$. Names with hyphens are rejected by the MCP server.

What happens automatically

After shipping your app:

  1. On install: App Manager reads tools.conf and tool_input_payload_signatures.json, converts them to MCP format, and registers all tools with the MCP server.
  2. On update: App Manager validates the new tools.conf before making any changes. If valid, all registered tools are atomically replaced. If the new tools.conf is invalid, existing tools are preserved.
  3. On uninstall: App Manager removes all tools associated with your app from the MCP server.
  4. On SHC sync: Tools are registered on each search head cluster member as configurations propagate.
Info

Registration never blocks app install, update, or delete operations. If registration fails, admins can retry it from the app management UI using the Register MCP Tools action.

Example: Adding MCP tools to an existing custom endpoint app

The hello-world custom endpoint example(Opens new window) in the Splunk App Examples repository is a simple app with two REST endpoints already defined in restmap.conf:

conf
[script:hello-world]
match = /say-hello
...
 
[admin:hello-templates]
match = /hello-templates
...

To expose these as MCP tools, add default/tools.conf to the app:

conf
[restmap:say_hello]
description = Returns a hello world greeting from the custom REST handler
endpoint_name = hello-world
method = get
tags = example, hello
 
[restmap:say_hello_templates]
description = Returns a hello world greeting using the template-based REST handler

That's the only addition needed. App Manager handles registration when the app is installed.

For the full app source, see custom_endpoints/hello-world(Opens new window) in the Splunk App Examples repository.

Troubleshooting

Symptom
Cause
Resolution
Tools not registered after install
tools.conf validation failed
Check splunkd.log for mcp messages; verify endpoint_name and search references exist in restmap.conf and savedsearches.conf
Admin sees a failure notification
Registration call to the MCP server failed
Click Register MCP Tools in the app management UI to retry; verify the MCP Server App is installed
Tools registered but not callable
Tool is registered but not enabled
Enable the tool in the MCP server app's management interface
422 error on manual retry
tools.conf has validation errors
Fix the error (e.g., correct method, add missing endpoint_name), then retry
Tools not synced to SHC members
SHC configuration bundle sync has not completed
Wait for sync to complete; tools are registered after sync

Limitations

  • MCP Server dependency: The Splunk MCP Server App must be installed on the same Splunk instance.
  • Tool name uniqueness: Tool names must be unique within an app. When multiple apps register tools with the same name, the MCP server's enablement system resolves conflicts.
  • Feature flag: MCP tool registration can be controlled via the MCP_TOOL_REGISTRATION_ENABLED environment variable.