inkog-io/inkog-mcp
GitHub: inkog-io/inkog-mcp
Inkog 是一个基于 MCP 协议的安全扫描服务器,在 AI Agent 开发过程中实时检测逻辑缺陷和安全风险并验证治理合规性。
Stars: 2 | Forks: 0
# Inkog MCP 服务器
**适用于 Claude、Cursor 和 Claude Code 中 AI Agent 开发的安全伴侣。**
让你的 AI 结对程序员构建一个 Agent。Inkog 会在你编写代码时进行检查——扫描漏洞、用浅显易懂的语言解释发现的问题、验证 AGENTS.md 治理规范,并审计 Agent 间的委托调用。所有操作都在同一个对话中完成,无需切换上下文。
可在 Claude Desktop、Cursor、Claude Code、ChatGPT 以及任何兼容 MCP 的客户端中使用。
[](https://www.npmjs.com/package/@inkog-io/mcp)
[](LICENSE)
[](https://modelcontextprotocol.io)
## 开发流程循环
Inkog 旨在驻留在你构建 Agent 的对话中——而不是作为事后把关者:
1. **让 Claude 构建一段 Agent 逻辑。**
2. **让 Claude 使用 Inkog 进行扫描** —— `"Scan this with Inkog and show me any CRITICAL or HIGH findings."`
3. **让 Claude 用浅显易懂的语言解释每个发现的问题** —— `"Explain the top finding. What's the risk, and how do I fix it?"`
4. **让 Claude 应用修复。** 检查差异、批准、重新扫描。
5. **在发布之前,验证治理规范** —— `"Verify my AGENTS.md against the code"` 以及 `"Audit the agent-to-agent delegation"`。
阅读完整的演练指南:[使用 Claude Code 和 Inkog MCP 构建安全的 AI Agent](https://inkog.io/labs/building-secure-agents-with-claude-code)。
### 推荐提示词
- *"Scan the current directory with Inkog and show me any CRITICAL or HIGH findings."*
- *"Explain the top finding in plain English. What's the risk, and how do I fix it?"*
- *"Verify my AGENTS.md against the code."*
- *"Audit the agent-to-agent delegation in this crew."*
- *"Run a compliance report and map the findings to EU AI Act Articles 12, 14, and 15."*
- *"Audit the MCP servers I'm integrating with."*
## 何时使用 Inkog
- **构建 AI Agent** —— 在开发过程中进行扫描,在无限循环、提示注入和缺少安全防护等问题发布前捕获它们
- **为 CI/CD 添加安全检查** —— 将 `inkog-io/inkog@v1` 添加到 GitHub Actions,在每个 PR 上设置自动化安全门禁
- **为 EU AI Act 做准备** —— 生成合规报告,将你的 Agent 映射到 Article 14、NIST AI RMF、OWASP LLM Top 10
- **审查 Agent 代码** —— 从 Claude Code、Cursor 或任何 MCP 客户端使用,在编写代码时获取安全分析
- **审计 MCP Server** —— 在安装前检查任何 MCP Server 的工具投毒、权限提升或数据泄露风险
- **验证 AGENTS.md** —— 验证治理声明与实际代码行为是否一致
- **构建多 Agent 系统** —— 检测 Agent 之间的委托循环、权限提升和未经授权的交接
## Inkog 的功能
- **逻辑缺陷检测**:发现无限循环、递归风险和缺失的退出条件
- **安全分析**:检测提示注入路径、不受限制的工具和数据泄露风险
- **AGENTS.md 治理**:验证代码行为与治理声明是否一致
- **合规报告**:生成针对 EU AI Act、NIST AI RMF、OWASP LLM Top 10 的报告
- **MCP Server 审计**:在安装前审计任何 MCP Server
- **多 Agent 分析**:审计 Agent 间的通信以排查逻辑和安全问题
## 安装
### Claude Desktop
添加到你的 `claude_desktop_config.json` 中:
```
{
"mcpServers": {
"inkog": {
"command": "npx",
"args": ["-y", "@inkog-io/mcp"],
"env": {
"INKOG_API_KEY": "sk_live_your_api_key"
}
}
}
}
```
### Cursor
添加到你的 Cursor MCP 设置中:
```
{
"mcpServers": {
"inkog": {
"command": "npx",
"args": ["-y", "@inkog-io/mcp"],
"env": {
"INKOG_API_KEY": "sk_live_your_api_key"
}
}
}
}
```
### 全局安装
```
npm install -g @inkog-io/mcp
```
## 获取你的 API Key
1. 在 [app.inkog.io](https://app.inkog.io) 免费注册
2. 从控制面板复制你的 API key
3. 将其设置为 `INKOG_API_KEY` 环境变量
## 可用工具
### P0 - 核心分析(基础)
| 工具 | 描述 |
|------|-------------|
| `inkog_scan` | 用于逻辑缺陷和安全风险的静态分析 |
| `inkog_verify_governance` | 验证 AGENTS.md 声明与实际代码行为是否一致 |
### P1 - 企业功能
| 工具 | 描述 |
|------|-------------|
| `inkog_compliance_report` | 生成 EU AI Act、NIST、OWASP 合规报告 |
| `inkog_explain_finding` | 获取有关发现问题的详细修复指导 |
| `inkog_audit_mcp_server` | 在安装前审计任何 MCP Server |
| `inkog_generate_mlbom` | 生成 ML 物料清单 (CycloneDX, SPDX) |
### P2 - 多 Agent 分析
| 工具 | 描述 |
|------|-------------|
| `inkog_audit_a2a` | 审计 Agent 间的通信 |
## 工具详情
### inkog_scan
AI Agent 代码的静态分析 - 发现逻辑缺陷和安全风险。
```
Arguments:
path (required) File or directory path to scan
policy (optional) Analysis policy: low-noise, balanced, comprehensive, governance, eu-ai-act
output (optional) Output format: summary, detailed, sarif
```
**示例**:"Scan my LangChain agent for logic flaws"
### inkog_verify_governance
验证 AGENTS.md 声明是否与实际代码行为一致。**这是 Inkog 独有的差异化优势** —— 没有其他工具能做到治理验证。
```
Arguments:
path (required) Path to directory containing AGENTS.md and agent code
```
**示例**:"Verify my agent's governance declarations"
### inkog_compliance_report
生成针对监管框架的合规报告。
```
Arguments:
path (required) Path to scan
framework (optional) eu-ai-act, nist-ai-rmf, iso-42001, owasp-llm-top-10, all
format (optional) markdown, json, pdf
```
**示例**:"Generate an EU AI Act compliance report for my agent"
### inkog_explain_finding
获取有关安全发现问题的详细解释和修复指导。
```
Arguments:
finding_id (optional) Finding ID from scan results
pattern (optional) Pattern name (e.g., prompt-injection, infinite-loop)
```
**示例**:"Explain how to fix prompt injection vulnerabilities"
### inkog_audit_mcp_server
对来自注册中心或 GitHub 的任何 MCP Server 进行安全审计。
```
Arguments:
server_name (optional) MCP server name from registry (e.g., "github", "slack")
repository_url (optional) Direct GitHub repository URL
```
**示例**:"Audit the GitHub MCP server for security issues"
### inkog_generate_mlbom
生成一份机器学习物料清单,列出所有 AI 组件。
```
Arguments:
path (required) Path to agent codebase
format (optional) cyclonedx, spdx, json
include_vulnerabilities (optional) Include known CVEs (default: true)
```
**示例**:"Generate an MLBOM for my AI project"
### inkog_audit_a2a
审计 Agent 间通信的安全风险。
```
Arguments:
path (required) Path to multi-agent codebase
protocol (optional) a2a, crewai, langgraph, auto-detect
check_delegation_chains (optional) Check for infinite loops (default: true)
```
**示例**:"Audit my CrewAI multi-agent system for security risks"
## 支持的框架
Inkog 适用于所有主流 AI Agent 框架:
- LangChain / LangGraph
- CrewAI
- AutoGen
- n8n
- Flowise
- Dify
- Microsoft Copilot Studio
- 自定义实现
## 配置
所有配置均通过环境变量完成:
| 变量 | 描述 | 默认值 |
|----------|-------------|---------|
| `INKOG_API_KEY` | 你的 API key(必填) | - |
| `INKOG_API_URL` | API 基础 URL | `https://api.inkog.io` |
| `INKOG_API_VERSION` | API 版本 | `v1` |
| `INKOG_API_TIMEOUT` | 请求超时时间 (ms) | `30000` |
| `INKOG_LOG_LEVEL` | 日志级别 | `info` |
| `INKOG_LOG_FORMAT` | 日志格式 (json/text) | `json` |
## 开发
```
# 安装依赖
npm install
# 构建
npm run build
# 以开发模式运行
npm run dev
# 运行测试
npm test
# Lint
npm run lint
```
## 为什么选择 Inkog?
### 安全融入开发流程,而非事后补救
大多数 AI Agent 安全工具在代码编写完成后运行。Inkog 则驻留在你构建 Agent 的对话中——因此问题在进入 PR 之前就能得到修复,而不是三周之后。
### 唯一具备 AGENTS.md 验证的工具
Inkog 是**唯一**能够根据实际代码行为验证 Agent 治理声明的工具。这对于以下方面至关重要:
- **EU AI Act Article 14** 合规(人工监督)
- **企业治理**要求
- **防止治理漂移** 随着代码演进
### 专为 AI Agent 打造
与传统的代码扫描器(Snyk、Semgrep、SonarQube)不同,Inkog 理解 AI 特有的问题:
- 无限循环和递归风险
- 提示注入路径
- 不受限制的工具访问
- 缺失的退出条件
- 跨租户数据泄露
### 多框架支持
Inkog 的通用 IR(中间表示)适用于任何 Agent 框架。一次集成,即可获得针对所有框架的分析。
## 许可证
Apache-2.0 - 详见 [LICENSE](LICENSE)
## 链接
- [文档](https://docs.inkog.io)
- [控制面板](https://app.inkog.io)
- [网站](https://inkog.io)
- [GitHub](https://github.com/inkog-io/inkog-mcp)
由 [Inkog.io](https://inkog.io) 安全构建
标签:AI代理, AI安全, AI开发, Chat Copilot, ChatGPT, CISA项目, Claude, Cursor, CVE检测, DevSecOps, MCP, MITM代理, Promptflow, URL发现, 上游代理, 人工智能治理, 代码安全, 代码审查, 大模型应用安全, 安全合规, 安全检测, 插件, 暗色界面, 欧盟AI法案, 漏洞枚举, 网络代理, 自动化攻击, 足迹探测, 零日漏洞检测, 风险检测