Skip to main content
Back to the Splunk MCP server

MCP Gateway · OpenCode

Splunk icon

Connect Splunk to OpenCode

When you're on call with OpenCode open, you can query Splunk without switching to the search UI. OpenCode connects to the Splunk server as a remote MCP entry in its config, and each search it runs passes through the Speakeasy gateway, which checks your role first.

Category
Infrastructure
Tools
9
Authentication
API key
OpenCode
Terminal

Behind the MCP Gateway

Run Splunk MCP behind the MCP Gateway

One URL for every agent, sign-in through your IdP, RBAC down to the tool, and every Splunk call inspected and logged.

Deploy on MCP Gateway

Set up

Add Splunk to OpenCode in 4 steps

  1. 01

    Add Splunk from the catalog

    An admin finds Splunk in the MCP Catalog (MCP Gateway > MCP > Catalog) and clicks Add. Speakeasy registers the vendor's server as a remote MCP server and proxies sessions to it. Nothing is copied or re-hosted.

    Splunk authenticates with an API key. Enter it under Upstream headers in the install dialog, or later on the server's Settings tab. The key is stored on the server, sent with every upstream request, and never reaches anyone's client configuration.

    Where MCP-scoped policies are enabled, the install offers a recommended risk policy for the new server that detects secrets and PII and inspects tool requests and responses.

  2. 02

    Choose who can use Splunk

    Give teams the mcp:connect scope on the Splunk server through team access or a role. OpenCode connects to the Splunk server's own URL, and the server's authorization decides who can connect and which tools they can call.

  3. 03

    Connect OpenCode

    Add the server to OpenCode's own mcp config block as a remote server.

    Copy the server's URL from its hosted install page in Speakeasy.

    Add it to the mcp block of your OpenCode config with type set to remote.

    Restart OpenCode and sign in when prompted.

    {
      "mcp": {
        "<server slug>": {
          "type": "remote",
          "url": "<URL from the hosted install page>"
        }
      }
    }
  4. 04

    Sign in and use Splunk from OpenCode

    The first time OpenCode connects, it opens a browser so the person can sign in to Speakeasy through your identity provider.

    From then on, Splunk's tools appear in OpenCode, limited to what the person's access allows, and every call lands in the gateway's tool logs.

OpenCode doesn't receive MCP servers from plugins. The observability package is installed separately, from a ZIP or with speakeasy-hooks install --provider=opencode, and the device agent can maintain it.

Use cases

What OpenCode users do with Splunk

Triage an alert from the terminal

When an alert fires, OpenCode runs the SPL search behind it over the last few minutes and summarizes which hosts, sources and errors are involved.

splunk_run_querysplunk_get_metadata

Check your own Splunk permissions

If a search returns nothing, OpenCode reads the roles and permissions of the current Splunk user to see whether that index is readable at all.

splunk_get_user_info

Find a Splunk admin to ask

List Splunk users with their roles and account status, so OpenCode can tell you who has an admin role when an index or permission needs changing.

splunk_get_user_list

Tools

9 tools

Each Splunk tool can be allowed or denied per team and role at the MCP Gateway before OpenCode sees it.

splunk_get_info

Get comprehensive information about the Splunk instance. Retrieves system information including version, hardware specs, and operational status.

splunk_get_indexes

Get a list of indexes from Splunk. Indexes are data repositories where machine data is stored and organized.

splunk_get_index_info

Get detailed information about a specific Splunk index. Returns comprehensive configuration and status information for the specified index.

splunk_get_user_list

Get a list of users from Splunk. Retrieves information about all users including authentication details, roles, and account status.

splunk_get_user_info

Retrieves detailed information about the currently authenticated user including roles and permissions. Returns comprehensive user profile data for the current session.

splunk_run_query

Execute a Splunk search query and return the results. This is the primary tool for running Splunk searches using SPL (Search Processing Language). Use this to retrieve log data, perform aggregations, analyze events, and extract insights from your Splunk environment.

See all 9 tools

Control

What Speakeasy can see and stop in OpenCode

The gateway covers every client the same way. The rest depends on what OpenCode exposes to Speakeasy.

Tool logs

Gateway

Every Splunk call is logged with the person and the client that made it.

Access by role

Gateway

People reach only the Splunk tools their team or role allows.

Request and response blocking

Gateway

A risk policy scoped to Splunk can reject a tool request before it reaches the server, or withhold a result from OpenCode. MCP-scoped policies are enabled per organization.

Prompt and tool-call blocking

OpenCode

The OpenCode plugin sends each prompt and tool call to Speakeasy, which allows or denies it before it runs.

Usage telemetry

OpenCode

Token and cost totals flow through the plugin, reported per turn.

Device agent

OpenCode

The device agent installs and maintains the observability package.

  • OpenCode has no OpenTelemetry exporter, so session data comes through the plugin.
  • Tool output is blocked at the gateway rather than in OpenCode's hooks.

Questions

Frequently asked questions

Do I need to install anything else for Speakeasy to observe OpenCode?
Yes. The observability package is installed separately, from a ZIP or with speakeasy-hooks install --provider=opencode, and the device agent can maintain it.
Where does OpenCode's usage data for Splunk sessions come from?
OpenCode has no OpenTelemetry exporter, so session data comes through the plugin. Token and cost totals are reported per turn.
How do OpenCode users get Splunk?
An admin adds Splunk from the Speakeasy MCP Catalog and grants access by team or role. Add the server to OpenCode's own mcp config block as a remote server. Each person then sees only the Splunk tools their access allows.
Are Splunk calls from OpenCode logged?
Yes. Splunk calls go through the MCP Gateway, which logs each tool call and attributes it to the person and the client that made it.

Connect more

Splunk in other clients

AI everywhere.

Control here.