Back to Browse

Project Koma MCP Server

Developer ToolsLow Risk9.7MCP RegistryLocal
Free

Server data from the Official MCP Registry

Classifies prompt injection, jailbreaks, and out-of-scope user input before agents act on it.

About

Classifies prompt injection, jailbreaks, and out-of-scope user input before agents act on it.

Security Report

9.7
Low Risk9.7Low Risk

Valid MCP server (1 strong, 5 medium validity signals). No known CVEs in dependencies. ⚠️ Package registry links to a different repository than scanned source. Imported from the Official MCP Registry. 1 finding(s) downgraded by scanner intelligence.

14 files analyzed · 1 issue found

Security scores are indicators to help you make informed decisions, not guarantees. Always review permissions before connecting any MCP server.

Permissions Required

This plugin requests these system permissions. Most are normal for its category.

database

Check that this permission is expected for this type of plugin.

HTTP Network Access

Connects to external APIs or services over the internet.

What You'll Need

Set these up before or after installing:

LLM provider: openai, anthropic, google, deepseek, or ollama (default: google)Optional

Environment variable: KOMA_PROVIDER

Optional model override for the selected providerOptional

Environment variable: KOMA_MODEL

Google Gemini API key (used by the default provider)Required

Environment variable: GEMINI_API_KEY

OpenAI API key when KOMA_PROVIDER=openaiRequired

Environment variable: OPENAI_API_KEY

Anthropic API key when KOMA_PROVIDER=anthropicRequired

Environment variable: ANTHROPIC_API_KEY

DeepSeek API key when KOMA_PROVIDER=deepseekRequired

Environment variable: DEEPSEEK_API_KEY

How to Install

Add this to your MCP configuration file:

{
  "mcpServers": {
    "io-github-swnotmetal-koma-gate-mcp": {
      "env": {
        "KOMA_MODEL": "your-koma-model-here",
        "KOMA_PROVIDER": "your-koma-provider-here",
        "GEMINI_API_KEY": "your-gemini-api-key-here",
        "OPENAI_API_KEY": "your-openai-api-key-here",
        "DEEPSEEK_API_KEY": "your-deepseek-api-key-here",
        "ANTHROPIC_API_KEY": "your-anthropic-api-key-here"
      },
      "args": [
        "-y",
        "koma-gate-mcp"
      ],
      "command": "npx"
    }
  }
}

Documentation

View on GitHub

From the project's GitHub README.

Koma

A prompt-injection firewall for Node.js.

Stop malicious prompts before they reach your LLM, tools, or RAG pipeline.

npm install koma-gate

Security primitives distilled from a real AI application.How Koma was built


What It Stops

Your appAttackFixInstall
AI chatbotPrompt injection / jailbreakSemantic filter blocks attacks before the modelkoma-gate
Voice AIAudio abuse / floodingValidation + rate limiting + geokoma-scout
RAG / searchData enumeration / scrapingSplit index from content, token-gate retrievalkoma-core

Different attacks cross different boundaries. Koma provides a small primitive for each one.


What Koma Is — and Isn't

Is: composable security primitives · defense-in-depth · usable independently · sits outside the model's authority

Isn't: a model · an agent framework · a replacement for authorization · a magic prompt-injection detector · a complete security boundary by itself


Benchmarks

I threw 1,769 real prompt-injection attacks at Koma Gate in fail-closed mode, using real providers — not mock adapters.

ProviderRecallPrecisionFalse Positives
DeepSeek (deepseek-chat)98.8%100%0
Google (gemini-2.5-flash)96.2%100%0

Chinese attack set: 100% recall · 100% precision · 0% FPR across 8 categories.

Can you break it? Open an issue with an attack Koma misses. → Full methodology


Quick Start

import { createGeneralKnowledgeGuard } from 'koma-gate';

const guard = createGeneralKnowledgeGuard({
  llm: { apiKey: process.env.GEMINI_API_KEY },
});

app.post('/api/chat', guard.middleware(), async (req, res) => {
  // Only in-scope requests reach your model
  res.json({ reply: await chat(req.body.message) });
});
git clone https://github.com/swnotmetal/Project-Koma
cd Project-Koma && node demo/server.js
curl http://localhost:8080/self-test

Three Defenses

koma-gate — Prompt injection firewall. LLM-based scope classifier that blocks jailbreaks, off-topic requests, and instruction overrides. Supports OpenAI, Anthropic, Google, DeepSeek, and local Ollama models. README →

koma-scout — Perimeter protection. Rate limiting, audio upload validation, geo allowlisting. Cheap checks before expensive AI work. README →

koma-core — Protected RAG storage. Public search index, private content, opaque HKDF-derived tokens. Discovery is not authorization. README →

Each package works standalone. Stack them: Gate filters → Scout throttles → Core stores.

MCP servers — expose Koma to AI agents directly:

  • koma-gate-mcpclassify_input tool for prompt-injection checks. README →
  • koma-core-mcpsearch_docs + retrieve_doc for protected RAG retrieval. README →
{
  "mcpServers": {
    "koma-gate": { "command": "npx", "args": ["-y", "koma-gate-mcp"] },
    "koma-core": { "command": "npx", "args": ["-y", "koma-core-mcp"] }
  }
}

Using an AI coding agent?

Tell it:

"Add Koma to protect this AI endpoint. Use koma-gate for prompt injection, koma-scout for perimeter abuse, and koma-core for protected RAG retrieval. Each works standalone."

Koma is designed for both human and agent discoverability — including two MCP servers. See llms.txt.


Trust & Safety

  • Zero runtime dependencies. No supply-chain surface.
  • No code execution. Classifies, rate-limits, stores — never executes AI output.
  • Fail-closed by default. A broken guard blocks, not passes.
  • CodeQL on every push. Targets OWASP LLM01.
  • MIT licensed.

Security policy · Known limitations · Comparison with alternatives · Contributing


Koma comes from Komainu ("狛犬"), the stone guardian lions of Japanese Shinto shrines. Three defense layers. Each standalone. Patterns distilled from production, not papers.

License

Reviews

No reviews yet

Be the first to review this server!