
How to add Inspektor Gadget MCP Server to Cursor
Debug Kubernetes & container workloads with eBPF kernel telemetry through an AI interface. Paste the config into ~/.cursor/mcp.json and restart Cursor.
Last updated June 14, 2026 · 26★ · stdio · no auth
Cursor config for Inspektor Gadget MCP Server
docker run -i --mount type=bind,src=${HOME}/.kube/config,dst=/kubeconfig ghcr.io/inspektor-gadget/ig-mcp-server:latest -gadget-discoverer=artifacthub{
"mcpServers": {
"inspektor-gadget-mcp-server": {
"command": "docker",
"args": [
"run",
"-i",
"--mount",
"type=bind,src=${env:HOME}/.kube/config,dst=/kubeconfig",
"ghcr.io/inspektor-gadget/ig-mcp-server:latest",
"-gadget-discoverer=artifacthub"
]
}
}
}Requires Docker to be installed and running.
Setup steps
- 1Open Cursor → Settings → MCP → Add new MCP server (or edit ~/.cursor/mcp.json directly).
- 2Paste the Inspektor Gadget MCP Server config below into the "mcpServers" object.
- 3Fill in placeholder secrets, then save.
- 4Cursor reloads MCP servers automatically — check Settings → MCP for a green status dot.
- 5Ask Cursor to use one of Inspektor Gadget MCP Server's tools to confirm it's connected.
Before you start
- A valid kubeconfig file with access to your Kubernetes cluster
- Docker (for the Docker-based installation) or a compatible binary for your platform
- An MCP-compatible client (VS Code, GitHub Copilot CLI, Claude Code, etc.)
- Either -gadget-discoverer or -gadget-images must be specified or the server will not start
What Inspektor Gadget MCP Server can do in Cursor
ig_deployDeploy, upgrade, undeploy, or check the status of Inspektor Gadget on your cluster.
ig_gadgetsList running gadgets, retrieve results from background runs, or stop gadgets.
gadget_trace_dnsDynamically registered tracing gadget tool that captures real-time DNS queries and responses.
gadget_trace_tcpDynamically registered tracing gadget tool that captures real-time TCP connection events.
gadget_trace_execDynamically registered tracing gadget tool that captures real-time process executions.
gadget_trace_openDynamically registered tracing gadget tool that captures real-time file open events.
gadget_snapshot_processDynamically registered snapshot gadget tool that returns a point-in-time snapshot of running processes.
gadget_snapshot_socketDynamically registered snapshot gadget tool that returns a point-in-time snapshot of open sockets.
Security
Requires read-only access to your kubeconfig file and network access for Artifact Hub discovery. The server does not implement built-in authentication; for HTTP/in-cluster deployments, place it behind a reverse proxy with auth + TLS and restrict access with network policies. Use -read-only mode to limit the server to non-destructive operations. Every registered gadget tool consumes LLM context window, so prefer -gadget-images to load only the gadgets you need on smaller-context models.
Inspektor Gadget MCP Server + Cursor FAQ
Where is the Cursor config file?
Cursor reads MCP servers from ~/.cursor/mcp.json. Paste the Inspektor Gadget MCP Server config there under the "mcpServers" key and restart the client.
Is Inspektor Gadget MCP Server safe to use with Cursor?
Requires read-only access to your kubeconfig file and network access for Artifact Hub discovery. The server does not implement built-in authentication; for HTTP/in-cluster deployments, place it behind a reverse proxy with auth + TLS and restrict access with network policies. Use -read-only mode to limit the server to non-destructive operations. Every registered gadget tool consumes LLM context window, so prefer -gadget-images to load only the gadgets you need on smaller-context models.
Does the server require Kubernetes?
Yes. The environment currently supported is 'kubernetes', and you need a valid kubeconfig with cluster access. Inspektor Gadget itself must be deployable on the cluster (the ig_deploy tool can deploy/upgrade/undeploy it).
How are gadget tools chosen and registered?
Each gadget becomes its own MCP tool prefixed with gadget_. You either discover gadgets automatically from Artifact Hub (-gadget-discoverer=artifacthub) or specify exact images (-gadget-images=trace_dns:latest,trace_tcp:latest). You must supply one of the two or the server won't start.
Why might I limit which gadgets are loaded?
Every registered MCP tool consumes part of the LLM's context window (its schema and field descriptions). On smaller-context models, use -gadget-images to register only the gadgets you need (e.g. two tools instead of 30+) to leave more room for gadget output and analysis.