Koma Gate MCP — Claude Code MCP server: what it does, how to install
Screens untrusted user prompts for jailbreaks and out-of-scope instructions before an agent executes tools.
claude mcp add --env KOMA_PROVIDER=<KOMA_PROVIDER> --env KOMA_MODEL=<KOMA_MODEL> --env GEMINI_API_KEY=<GEMINI_API_KEY> --env OPENAI_API_KEY=<OPENAI_API_KEY> --env ANTHROPIC_API_KEY=<ANTHROPIC_API_KEY> --transport stdio koma-gate-mcp -- npx -y koma-gate-mcpWhat Koma Gate MCP does
The server provides a single tool called classify_input. It inspects incoming text to verify whether an input is permissible. The response contains safety status alongside a descriptive reason.
Classification accepts an optional preset: general, code, support, or reference. By default, it runs the general profile. Backend options include google, openai, anthropic, deepseek, and ollama, with google enabled by default.
Because this filter relies on an underlying language model, it provides heuristic screening rather than a cryptographic security perimeter. You must pass a valid API key for the chosen provider in the environment variables, or tool execution will fail.
What it helps with
- screen untrusted user text for prompt injection attempts
- validate code-related inputs using the code preset before running scripts
- filter out off-topic requests before agents trigger sensitive actions
Example prompts for the agent
- Use
classify_inputon this user prompt to confirm it is safe before continuing. - Check the ticket description with the
supportpreset to spot jailbreak attempts. - Inspect the latest incoming payload to verify whether it stays in scope.
How to install Koma Gate MCP
Platform CLI
claude mcp add --env KOMA_PROVIDER=<KOMA_PROVIDER> --env KOMA_MODEL=<KOMA_MODEL> --env GEMINI_API_KEY=<GEMINI_API_KEY> --env OPENAI_API_KEY=<OPENAI_API_KEY> --env ANTHROPIC_API_KEY=<ANTHROPIC_API_KEY> --transport stdio koma-gate-mcp -- npx -y koma-gate-mcpReplace <…> with your own values. 1 more environment variable is in the server README
Platform CLI
codex mcp add koma-gate-mcp --env KOMA_PROVIDER=<KOMA_PROVIDER> --env KOMA_MODEL=<KOMA_MODEL> --env GEMINI_API_KEY=<GEMINI_API_KEY> --env OPENAI_API_KEY=<OPENAI_API_KEY> --env ANTHROPIC_API_KEY=<ANTHROPIC_API_KEY> -- npx -y koma-gate-mcpReplace <…> with your own values. 1 more environment variable is in the server README
Config file
{
"mcpServers": {
"koma-gate-mcp": {
"command": "npx",
"args": [
"-y",
"koma-gate-mcp"
],
"env": {
"KOMA_PROVIDER": "<KOMA_PROVIDER>",
"KOMA_MODEL": "<KOMA_MODEL>",
"GEMINI_API_KEY": "<GEMINI_API_KEY>",
"OPENAI_API_KEY": "<OPENAI_API_KEY>",
"ANTHROPIC_API_KEY": "<ANTHROPIC_API_KEY>"
}
}
}
}Replace <…> with your own values. 1 more environment variable is in the server README
Config file
{
"servers": {
"koma-gate-mcp": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"koma-gate-mcp"
],
"env": {
"KOMA_PROVIDER": "<KOMA_PROVIDER>",
"KOMA_MODEL": "<KOMA_MODEL>",
"GEMINI_API_KEY": "<GEMINI_API_KEY>",
"OPENAI_API_KEY": "<OPENAI_API_KEY>",
"ANTHROPIC_API_KEY": "<ANTHROPIC_API_KEY>"
}
}
}
}Replace <…> with your own values. 1 more environment variable is in the server README
Platform CLI
gemini mcp add -e KOMA_PROVIDER=<KOMA_PROVIDER> -e KOMA_MODEL=<KOMA_MODEL> -e GEMINI_API_KEY=<GEMINI_API_KEY> -e OPENAI_API_KEY=<OPENAI_API_KEY> -e ANTHROPIC_API_KEY=<ANTHROPIC_API_KEY> koma-gate-mcp npx -y koma-gate-mcpReplace <…> with your own values. 1 more environment variable is in the server README
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about Koma Gate MCP
How to install Koma Gate MCP in Claude Code?
Run `claude mcp add koma-gate-mcp -e GEMINI_API_KEY=<GEMINI_API_KEY> -e OPENAI_API_KEY=<OPENAI_API_KEY> -e ANTHROPIC_API_KEY=<ANTHROPIC_API_KEY> -e DEEPSEEK_API_KEY=<DEEPSEEK_API_KEY> -- npx -y koma-gate-mcp`. Replace the API key placeholder with your actual credential.
What does Koma Gate MCP do?
It equips the agent with classify_input to evaluate user submissions for prompt injections and scope violations. The tool returns verdict flags along with the model and reason.
What providers are supported by the classifier?
You can route classification through google, openai, anthropic, deepseek, or a local ollama instance. The default configuration targets google using GEMINI_API_KEY.