About Koma Gate MCP
Koma Gate MCP exposes an LLM-based classifier that checks untrusted user text for prompt injection, jailbreaks, and out-of-scope input. It is intended for AI agents to classify input before acting, and is not a cryptographic defense.
Key features
- 01Classify untrusted text for safety and scope
- 02Choose from four classification presets
- 03Return allow, scope, reason, and model fields
Use cases
- 01Check user input before an agent acts on it
- 02Apply different checks for code or support tasks
MCP support
Provides the `classify_input` tool to MCP clients, accepting text and an optional preset and returning classification fields.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
npx -y koma-gate-mcpKOMA_PROVIDERLLM provider: openai, anthropic, google, deepseek, or ollama (default: google)KOMA_MODELOptional model override for the selected providerGEMINI_API_KEYSecretGoogle Gemini API key (used by the default provider)OPENAI_API_KEYSecretOpenAI API key when KOMA_PROVIDER=openaiANTHROPIC_API_KEYSecretAnthropic API key when KOMA_PROVIDER=anthropicDEEPSEEK_API_KEYSecretDeepSeek API key when KOMA_PROVIDER=deepseekLocal servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.
Tools
1Saved tool list · updated 2w ago
| Parameter | Type | Required | Description |
|---|---|---|---|
| text | string | Yes | The untrusted user input to classify |
| preset | enum | No | Which guard domain to use. Default: general knowledge assistantgeneral | code | support | reference |
Details
From the project READMEKoma Gate MCP
Expose Koma Gate's prompt-injection classification as an MCP tool for AI agents.
npm install koma-gate-mcp
What it does
Provides a single tool, classify_input, that an AI agent can call to check whether untrusted user text is safe and in-scope before acting on it.
Setup
Set the provider and API key:
# Provider: openai | anthropic | google | deepseek | ollama (default: google)
export KOMA_PROVIDER=google
export GEMINI_API_KEY=sk-...
Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"koma-gate": {
"command": "npx",
"args": ["-y", "koma-gate-mcp"]
}
}
}
Tool: classify_input
text(required) — the untrusted user input to classifypreset(optional) —general|code|support|reference(default: general)
Returns:
{
"allowed": true,
"in_scope": true,
"reason": "in scope",
"preset": "general",
"model": "gemini-2.5-flash"
}
Security Boundary
This is an LLM-based scope classifier, not a cryptographic prompt-injection defense. See koma-gate's README for the full security boundary and BENCHMARKS.md for evaluation results.
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.