Koma Gate MCP

io.github.swnotmetal由 GitHub 账号 swnotmetal 发布v0.1.1更新于 Oct 24, 2026

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

已验证STDIO仅桌面安全与监控AI 与机器学习

概览

AI 生成的概览

一个本地 MCP 服务器,把 Koma Gate 基于大模型的分类器暴露给助手,用于在采取行动前检查不可信输入是否含提示注入、越狱或超出范围。

可以做什么
分类不可信文本:调用 classify_input,传入用户输入和可选预设(general、code、support 或 reference),返回判定结果,包括是否允许、是否在范围内、原因、所用预设以及作出判断的模型。
适用场景
适用于助手处理不可信用户文本、并希望在据此行动前先做检查的场景,例如可选择预设的客服、编程或参考资料工作流。它只是启发式把关,并非万无一失,应与其他防护措施配合使用。
运行要求
通过 stdio 在本地运行,通常用 npx 启动该 npm 包。需用 KOMA_PROVIDER 选择大模型提供方(openai、anthropic、google、deepseek 或 ollama,默认 google),并提供对应密钥:GEMINI_API_KEY、OPENAI_API_KEY、ANTHROPIC_API_KEY 或 DEEPSEEK_API_KEY。KOMA_MODEL 可覆盖模型。需要能访问所选提供方的网络。
安装前请注意
提交的不可信文本会发送给所选第三方大模型提供方进行分类,请注意数据敏感性。提供方密钥从环境变量读取,可能产生调用费用。README 说明这是基于大模型的范围内分类器,而非密码学意义上的提示注入防御,不应单独依赖它。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Koma Gate MCP,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

Koma Gate MCP

Expose Koma Gate's prompt-injection classification as an MCP tool for AI agents.

bash
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:

bash
# Provider: openai | anthropic | google | deepseek | ollama (default: google)export KOMA_PROVIDER=googleexport GEMINI_API_KEY=sk-...

Claude Desktop

Add to claude_desktop_config.json:

json
{  "mcpServers": {    "koma-gate": {      "command": "npx",      "args": ["-y", "koma-gate-mcp"]    }  }}

Tool: classify_input

  • text (required) — the untrusted user input to classify
  • preset (optional) — general | code | support | reference (default: general)

Returns:

json
{  "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.

来源:packages/koma-gate-mcp/README.md,提交 d31b9f6

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.1最新Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分