Skip to content
MCP server

Shield Kya

Audit trail and policy gate for coding agents: allow, review or deny each tool call

Runs locally

Shield Kya is an open-source MCP server for security. It runs locally on your machine and is started by your AI client.

Pricing
Open source
Platforms
CLI, Self-hosted, macOS
Runs
Locally
Access
Needs a secret key or token
Version
0.35.8
Listing updated

Similar MCP servers

Install

Add with the CLI

Run in a terminal

claude mcp add shield-kya --env KYA_BASE_URL='<KYA_BASE_URL>' --env KYA_API_KEY='<KYA_API_KEY>' -- npx -y @shield-agent/kya

Add --scope user to use it in every project, or --scope project to share it in .mcp.json.

Or share it with your project

Add to .mcp.json

{
  "mcpServers": {
    "shield-kya": {
      "command": "npx",
      "args": [
        "-y",
        "@shield-agent/kya"
      ],
      "env": {
        "KYA_BASE_URL": "<KYA_BASE_URL>",
        "KYA_API_KEY": "<KYA_API_KEY>"
      }
    }
  }
}

Claude Code setup guide

Add to claude_desktop_config.json

{
  "mcpServers": {
    "shield-kya": {
      "command": "npx",
      "args": [
        "-y",
        "@shield-agent/kya"
      ],
      "env": {
        "KYA_BASE_URL": "<KYA_BASE_URL>",
        "KYA_API_KEY": "<KYA_API_KEY>"
      }
    }
  }
}

Settings → Developer → Edit Config, then quit and reopen Claude Desktop.

Claude Desktop setup guide

Add to ~/.cursor/mcp.json

{
  "mcpServers": {
    "shield-kya": {
      "command": "npx",
      "args": [
        "-y",
        "@shield-agent/kya"
      ],
      "env": {
        "KYA_BASE_URL": "<KYA_BASE_URL>",
        "KYA_API_KEY": "<KYA_API_KEY>"
      }
    }
  }
}

Use .cursor/mcp.json in a project to share it with the project.

Cursor setup guide

Add to ~/.copilot/mcp-config.json

{
  "mcpServers": {
    "shield-kya": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@shield-agent/kya"
      ],
      "env": {
        "KYA_BASE_URL": "<KYA_BASE_URL>",
        "KYA_API_KEY": "<KYA_API_KEY>"
      }
    }
  }
}

Or put the same entry in .mcp.json at your workspace root to share it.

VS Code setup guide

Add with the CLI

Run in a terminal

codex mcp add shield-kya --env KYA_BASE_URL='<KYA_BASE_URL>' --env KYA_API_KEY='<KYA_API_KEY>' -- npx -y @shield-agent/kya

Or add to config.toml

Add to ~/.codex/config.toml

[mcp_servers.shield-kya]
command = "npx"
args = ["-y", "@shield-agent/kya"]
env = { KYA_BASE_URL = "<KYA_BASE_URL>", KYA_API_KEY = "<KYA_API_KEY>" }

Codex setup guide

Add to your client's MCP settings (most use this shape)

{
  "mcpServers": {
    "shield-kya": {
      "command": "npx",
      "args": [
        "-y",
        "@shield-agent/kya"
      ],
      "env": {
        "KYA_BASE_URL": "<KYA_BASE_URL>",
        "KYA_API_KEY": "<KYA_API_KEY>"
      }
    }
  }
}
  • Gemini CLI and Antigravity

    Gemini CLI

    Add to ~/.gemini/settings.json

    {
      "mcpServers": {
        "shield-kya": {
          "command": "npx",
          "args": [
            "-y",
            "@shield-agent/kya"
          ],
          "env": {
            "KYA_BASE_URL": "<KYA_BASE_URL>",
            "KYA_API_KEY": "<KYA_API_KEY>"
          }
        }
      }
    }

    Or run: gemini mcp add -s user -e KYA_BASE_URL='<KYA_BASE_URL>' -e KYA_API_KEY='<KYA_API_KEY>' shield-kya npx -- -y @shield-agent/kya

    Antigravity

    Add to ~/.gemini/config/mcp_config.json

    {
      "mcpServers": {
        "shield-kya": {
          "command": "npx",
          "args": [
            "-y",
            "@shield-agent/kya"
          ],
          "env": {
            "KYA_BASE_URL": "<KYA_BASE_URL>",
            "KYA_API_KEY": "<KYA_API_KEY>"
          }
        }
      }
    }

    Use .agents/mcp_config.json to add it to one workspace only.

    Gemini CLI and Antigravity setup guide

  • Devin Desktop (formerly Windsurf)

    Add to ~/.config/devin/mcp_config.json

    {
      "mcpServers": {
        "shield-kya": {
          "command": "npx",
          "args": [
            "-y",
            "@shield-agent/kya"
          ],
          "env": {
            "KYA_BASE_URL": "<KYA_BASE_URL>",
            "KYA_API_KEY": "<KYA_API_KEY>"
          }
        }
      }
    }

    On Windows the file is %APPDATA%\devin\mcp_config.json. Use .devin/mcp_config.json to share it with a project.

    Devin Desktop setup guide

  • Cline

    Add to cline_mcp_settings.json

    {
      "mcpServers": {
        "shield-kya": {
          "command": "npx",
          "args": [
            "-y",
            "@shield-agent/kya"
          ],
          "env": {
            "KYA_BASE_URL": "<KYA_BASE_URL>",
            "KYA_API_KEY": "<KYA_API_KEY>"
          }
        }
      }
    }

    Open it from the MCP Servers icon → Configure → Configure MCP Servers.

    Cline setup guide

  • Zed

    Add to Zed settings.json

    {
      "context_servers": {
        "shield-kya": {
          "command": "npx",
          "args": [
            "-y",
            "@shield-agent/kya"
          ],
          "env": {
            "KYA_BASE_URL": "<KYA_BASE_URL>",
            "KYA_API_KEY": "<KYA_API_KEY>"
          }
        }
      }
    }

    Open it with zed: open settings file. Merge context_servers into the settings you already have.

    Zed setup guide

  • JetBrains AI Assistant and Junie

    AI Assistant

    Add to Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add

    {
      "mcpServers": {
        "shield-kya": {
          "command": "npx",
          "args": [
            "-y",
            "@shield-agent/kya"
          ],
          "env": {
            "KYA_BASE_URL": "<KYA_BASE_URL>",
            "KYA_API_KEY": "<KYA_API_KEY>"
          }
        }
      }
    }

    The AI Assistant docs only show command and args. If the env block is ignored, use Junie for this server.

    Junie

    Add to ~/.junie/mcp/mcp.json

    {
      "mcpServers": {
        "shield-kya": {
          "command": "npx",
          "args": [
            "-y",
            "@shield-agent/kya"
          ],
          "env": {
            "KYA_BASE_URL": "<KYA_BASE_URL>",
            "KYA_API_KEY": "<KYA_API_KEY>"
          }
        }
      }
    }

    Use .junie/mcp/mcp.json to share it with a project.

    JetBrains AI Assistant and Junie setup guide

  • Kiro

    Add to ~/.kiro/settings/mcp.json

    {
      "mcpServers": {
        "shield-kya": {
          "command": "npx",
          "args": [
            "-y",
            "@shield-agent/kya"
          ],
          "env": {
            "KYA_BASE_URL": "<KYA_BASE_URL>",
            "KYA_API_KEY": "<KYA_API_KEY>"
          }
        }
      }
    }

    Use .kiro/settings/mcp.json to add it to one workspace only.

    Kiro setup guide

Using several servers? Build one config file with the MCP config generator.

Configuration

  • KYA_BASE_URLControl plane origin (e.g. http://127.0.0.1:8090 or hosted URL)Required
  • KYA_API_KEYAPI key for the control plane (required when auth is on)Required
  • KYA_HOSTDual-plane host tag: ide (authoring) or runtime (production)
  • KYA_AGENT_IDRegistered agent principal id

About Shield Kya

Most of the README is about what runs locally. After one command, kya start wires MCP config for Claude Code, Cursor and other hosts it detects, and opens a local dashboard recording every tool call. Local hooks fail open: they record everything and block only a short never-list of destructive commands, secret reads and exfiltration. Real blocking and human approval run through the MCP policy path against a hosted Shield workspace, where an agent that asks gets Allow, Review or Deny.

The CLI exit codes are deliberate: eval-tool, wrap and invoke return 0 on allow, 4 on require-approve and 1 on deny or unknown, so a chained command cannot skip the gate. An offline mode lets you try demo denials without a paid cloud. It never auto-approves an irreversible side effect, and agents that never call evaluate stay invisible because it does not scan your network.

It needs Node.js 22 or newer, with KYA_BASE_URL and KYA_API_KEY for a control plane. It is MIT licensed and also ships plugins for Claude Code, Codex and Gemini CLI, a GitHub Action, a VS Code extension, Homebrew and Scoop.

Tools this server provides (1)

Taken from the project documentation; the running server may differ.

From the tool list in its README, going by the names, 1 name doesn't say.

From the server's own tool labels and tool names; not verified by us.

kya.agent.register
Registers an agent; offline it returns REQUIRE_APPROVE.

What it does

Local activity report
Records each tool call on a local dashboard.
Default never-list
Denies a short list of destructive commands, secret reads and exfiltration.
Allow, review, deny
Policy decisions through a hosted control plane.
Human approval
Review decisions wait for a person.
Exit-code gating
Codes 0, 4 and 1 stop chained commands from bypassing the gate.
Many host plugins
Plugins and wiring for Claude Code, Codex, Gemini CLI and Cursor.

Good for

  • See what a coding agent did in a session
  • Block secret reads and destructive commands
  • Require approval for risky tool calls
  • Fail CI when an agent action is denied
  • Try policy decisions offline

Pricing

Open source

MIT licensed; enforcement uses a hosted Shield Agent workspace

Shield Kya FAQ

Does Shield Kya block anything on its own?

Local hooks block only the default never-list; full enforcement uses the hosted workspace.

What are the requirements?

Node.js 22 or newer, 24 recommended.

Is Shield Kya free?

The README says free forever under MIT.

Does Shield Kya scan my network?

No. Agents that never call evaluate stay invisible.

How do I add Shield Kya to Claude Code?

Run this command in your terminal: claude mcp add shield-kya --env KYA_BASE_URL='<KYA_BASE_URL>' --env KYA_API_KEY='<KYA_API_KEY>' -- npx -y @shield-agent/kya

What are the best alternatives to Shield Kya?

The closest alternatives to Shield Kya are REA, Context7, Chrome DevTools MCP, Codebase Memory and GitHub.

Where this comes from

  • Description: written from the project's README.
  • Install steps: from the official MCP Registry entry.

How AIPoweredBot checks servers