Skip to main content
Glama
@konsulto/mcp

@konsulto/mcp

Official
by konsulto

@konsulto/mcp

License: MIT Node

MCP 服务器,让 Claude Code(以及任何其他支持 MCP 的客户端)能够从 CLI 驱动 Konsulto 网络安全审计平台:

  • 读取 — 列出您参与的审计、搜索发现结果/模板、读取发现结果(包括渲染为 Markdown 的正文,以便 LLM 可以对文本进行推理)、读取单个部分。

  • 写入 — 从结构化字段编写发现结果(后端构建 Tiptap 正文)、更新标量值、使用 Markdown 追加/替换部分文本、通过试运行预览批量更改状态。

  • 证据 — 上传文件/内联内容/base64,将证据植入发现结果正文的正确部分。

  • 范围与资产 — 列出范围、列出/创建资产、匹配或创建资产并将其链接到发现结果。

以用户身份及其角色权限运行,并受每个用户 MCP 令牌的限制。有三个运行时门控:租户功能标志已启用、角色具有 mcp:use 权限、令牌未被撤销/过期。

快速入门

1. 在 Konsulto Web 应用中生成 MCP 令牌

登录 → 个人资料 (Profile) → MCP 令牌 (MCP Tokens) → 新建 MCP 令牌 (New MCP token)。复制 kon_mcp_… 值一次 — 它不会再次显示。(租户管理员必须先在 账户 (Account) → API 访问 (API Access) 下启用 MCP 集成。)

2. 在本地保存令牌

mkdir -p ~/.konsulto && chmod 700 ~/.konsulto
cat > ~/.konsulto/credentials <<EOF
token: kon_mcp_REPLACE_WITH_YOUR_TOKEN
endpoint: https://api.konsulto.io
EOF
chmod 600 ~/.konsulto/credentials

或者,如果您不想写入文件,可以使用 KONSULTO_TOKEN 环境变量。

3. 告知 Claude Code 关于该服务器的信息

添加到 ~/.claude/mcp.json:

{
  "mcpServers": {
    "konsulto": {
      "command": "npx",
      "args": ["-y", "@konsulto/mcp"]
    }
  }
}

验证连接:

npx @konsulto/mcp doctor

您应该会看到所有绿色的勾选标记。

Related MCP server: claude-sessions-mcp

文件夹固定(可选,推荐)

在参与文件夹内运行 npx @konsulto/mcp init 以将其固定到一个审计项目:

~/audits/acme-q2-pentest/
├── .konsulto.yml          ← pins this folder to one audit
├── recon/
└── notes.md

当 Claude Code 在该文件夹(或任何子文件夹)中启动时,MCP 会自动固定该审计项目。无需再考虑审计 ID。

该文件可与您的团队共享 — 它包含审计 ID 和可选的端点,不包含任何机密信息。

工作流模式

模式

何时使用

文件夹固定的 .konsulto.yml

在同一项参与中重复工作。每个文件夹运行一次 konsulto init。

每个会话 set_active_audit

一个工作区,在心理上切换审计。告诉 Claude “切换到 <审计名称>”。

每次调用显式指定

在一个会话中处理多个审计。将 audit: 传递给每个工具调用。

工具

每个工具都以 konsulto_ 为前缀,因此它不会与您可能配置的其他 MCP(Burp、nmap、prowler 等)冲突。

身份与上下文

工具

功能

konsulto_whoami

身份、权限、当前审计。在会话中首先调用。

konsulto_list_my_audits

列出您作为成员的审计。

konsulto_set_active_audit

在会话剩余时间内固定一个审计(按名称模糊匹配)。

konsulto_get_audit_context

一次性定位 — 名称、状态、范围/资产计数、严重性汇总、团队。

模板

工具

功能

konsulto_search_templates

按查询/严重性查找发现结果模板。精简格式 — id、标题、严重性、摘要、槽位名称、分类。无正文。

发现结果 — 读取

工具

功能

konsulto_search_findings

在审计中搜索(默认为当前审计)。

konsulto_get_finding

读取发现结果,包括渲染为 Markdown 的正文,以便 LLM 可以对文本进行推理。

konsulto_read_section

仅读取发现结果正文的一个部分作为 Markdown。对于“解释 POC”来说,比 get_finding 更经济。

发现结果 — 写入

工具

功能

konsulto_compose_finding

从结构化字段 + 可选模板 + 证据创建。后端构建 Tiptap 正文。

konsulto_update_finding

更改标量字段(标题、严重性、状态、分类、资产)。

konsulto_bulk_update_status

批量状态更改。支持 dryRun: true 进行预览。

konsulto_append_to_section

将 Markdown 文本添加到部分。部分名称接受别名(recommendations, mitigation, fix, summary 等) — 它们在服务器端规范化为规范键。

konsulto_replace_section

替换部分的文本。旧内容保存在审计跟踪中。

证据

工具

功能

konsulto_attach_evidence

上传文件路径 / 内联内容 / base64。返回 evidenceId。

konsulto_add_evidence_to_finding

将 evidenceId 植入现有发现结果的正文(auto 放置方式为 poc → description → impact → remediation → end)。

范围与资产

工具

功能

konsulto_list_scope

审计的范围元素 — 授权测试的内容。

konsulto_list_assets

审计中的资产(或租户范围内的资产)。

konsulto_create_asset

当扫描发现未跟踪的资产时,创建主机 / URL / IAM 角色等。

konsulto_link_asset

按名称匹配或创建资产并将其附加到发现结果。

辅助 CLI

该包附带两个二进制文件:

  • konsulto-mcp — stdio MCP 服务器。Claude Code 会启动它。您无需直接运行它。

  • konsulto — 交互式助手:

    • konsulto init — 为当前文件夹写入 .konsulto.yml

    • konsulto whoami — 验证令牌,显示身份 + 权限 + 当前审计

    • konsulto doctor — 健全性检查凭据文件模式、令牌有效性、网络可达性、MCP 功能是否启用、角色是否具有 mcp:use 权限

故障排除

症状

可能原因

修复

No Konsulto credentials found

没有 KONSULTO_TOKEN 环境变量,没有 ~/.konsulto/credentials 文件

设置环境变量或创建文件(参见快速入门第 2 步)。

This token is a tenant integration key, not an MCP token

您使用了 kon_live_* 令牌

在“个人资料 → MCP 令牌”下生成 kon_mcp_* 令牌。

每个工具都出现 401 / “authentication failed”

令牌已撤销或过期

生成新令牌并更新 ~/.konsulto/credentials。

403 / “tenant has disabled MCP”

租户管理员关闭了 MCP

请管理员在“账户 → API 访问”下重新开启。

403 / “role no longer permits MCP”

您的角色失去了 mcp:use 权限

请管理员授予您的角色该权限。

permissions file mode is 644

凭据文件权限过松

chmod 600 ~/.konsulto/credentials

konsulto doctor 会明确涵盖上述每一项,并提供一行修复命令。

安全模型

  • 每个 API 请求都有三个实时门控:租户功能标志已启用、您的角色具有 mcp:use 权限、您的令牌未被撤销/过期。其中任何一个发生变化都会立即切断 MCP 流量 — 无需针对每个令牌进行撤销。

  • 令牌存储:~/.konsulto/credentials (chmod 600) 或 KONSULTO_TOKEN 环境变量。绝不存储在 ~/.claude/mcp.json 中。

  • 新 IP 首次使用邮件提醒:当您的令牌从以前未见过的 IP 使用时,您会收到一封电子邮件,以便可以检测到泄露。电子邮件中包含撤销流程的链接。

  • 默认有效期:90 天。最长 365 天。

  • 权限实时读取:更改您的角色会在一个请求内传播 — 您无需重新颁发令牌。

单机多参与处理

设置 KONSULTO_PROFILE=acme 以读取 ~/.konsulto/credentials.acme 而不是默认文件。当您在同一台笔记本电脑上为客户的 Konsulto 租户和您公司的租户工作时,这非常有用。

许可证

MIT — 参见 LICENSE。

Available Tools

19 tools
konsulto_add_evidence_to_findingA

Graft an already-uploaded attachment into an existing finding's body at the named section. The "auto" section walks poc → description → impact → remediation → end-of-doc. Use this when adding evidence after the finding was created (e.g. screenshots taken later, additional reproduction logs).

Inputs: findingId (required), evidenceId (required), caption, section.

konsulto_append_to_sectionA

Append markdown prose to a named section of a finding. Use this to add a paragraph or two without touching the rest of the finding. Content is markdown — paragraphs, lists, code blocks, links. The backend converts it to the finding's rich-text format.

Inputs: findingId (required), section (required), content (required).

konsulto_attach_evidenceA

Upload a file (or inline content) as an attachment in the active audit. Returns an evidenceId. Pass the evidenceId to konsulto_add_evidence_to_finding or include it in konsulto_compose_finding's evidence array to graft it into a finding's body. This tool only uploads — it does NOT link to a finding by itself. Exactly one of filePath/content/contentBase64 must be set.

Inputs: audit, filePath, content, contentBase64, +2 more.

konsulto_bulk_update_statusA

Change the status of many findings at once. Use for "client confirmed the fix on all of these" or "all stale findings should be closed". Set dryRun: true first to preview affected findings before committing.

Inputs: findingIds (required), status (required), dryRun.

konsulto_compose_findingA

Create a brand-new finding from structured fields + optional template + optional evidence. The backend builds the Tiptap body from a layout — NEVER pass Tiptap JSON as a field. Use plain prose for summary/impact/remediation, an array of plain strings for stepsToReproduce. Evidence is grafted into the body at the requested section ("auto" walks poc → description → impact → remediation → end).

Inputs: fields (required), audit, templateId, severity, +2 more.

konsulto_create_assetA

Create a new asset in the active audit. Use when a scan or evidence reveals a host/URL/IP that isn't yet tracked. After creating, use konsulto_link_asset to attach it to a finding.

Inputs: name (required), type (required), audit, identifiers, +2 more.

konsulto_get_audit_contextA

One-shot orientation tool — returns the active audit's name, status, dates, scope element count, asset count, finding severity rollup, and team. Call this at session start (after whoami) to ground yourself before doing work in the audit. Defaults to the active audit; pass audit to override.

Inputs: audit.

konsulto_get_findingA

Read a single finding by ID, including its body rendered as markdown so the LLM can reason about the prose. Use when the user asks to review, explain, or summarize a specific finding. The body markdown is alongside the structured fields (severity, status, taxonomy, etc.).

Inputs: findingId (required).

konsulto_list_assetsA

List assets in the audit (or tenant-wide if no audit filter). Returns name, type, identifiers (hostname/ip/url/cidr) so you can match evidence to the right asset. Use konsulto_link_asset to attach an asset to a finding.

Inputs: audit, q, limit.

konsulto_list_my_auditsA

List audits this user is a team member of. Use to find the audit ID you want to work in. Filter by status (active/draft/completed/archived).

Inputs: status, limit.

konsulto_list_scopeA

List the scope elements for an audit — what's authorized to be tested. Use to confirm targets are in-scope before recording findings against them. Defaults to the active audit.

Inputs: audit.

konsulto_read_sectionA

Read just one section of a finding's body as markdown. Use for "explain the POC", "summarize the impact", "show me the remediation". Cheaper context-wise than konsulto_get_finding when the user only cares about one section. Section name accepts aliases (recommendations, mitigation, summary, etc.) — they map to canonical names server-side.

Inputs: findingId (required), section (required).

konsulto_replace_sectionA

Replace the entire prose under a named section. The previous content is preserved on the audit trail (recoverable). Prefer konsulto_append_to_section unless the user explicitly wants to rewrite the section. Content is markdown.

Inputs: findingId (required), section (required), content (required).

konsulto_search_findingsA

Search findings within an audit. Defaults to the active audit when set. Returns titles, severities, statuses, and IDs — the body field is not included. Use to check for duplicates before creating a new finding and to find a specific finding to update or attach evidence to.

Inputs: audit, q, severity, status, +1 more.

konsulto_search_templatesA

Search the finding-template catalog. Returns a slim shape (id, title, severity, summary, slot names, taxonomy) — NOT the full template body. Use this to pick a template before calling konsulto_compose_finding. When multiple candidates match, prefer the one whose summary best fits the evidence in hand.

Inputs: q, severity, limit.

konsulto_set_active_auditA

Pin one audit as the session's active audit. Subsequent tools that take an optional audit argument will default to this one. Accepts an audit ID OR a substring of the audit name (fuzzy match — exact match wins, then unique substring). Folder-level pinning via .konsulto.yml is the recommended persistent alternative.

Inputs: audit (required).

konsulto_update_findingA

Update scalar fields on an existing finding. Use this for changing title, severity, status, taxonomy, or assets — NOT for editing the prose body (use konsulto_append_to_section / konsulto_replace_section for that). NOT for evidence (use konsulto_add_evidence_to_finding).

Inputs: findingId (required), patch (required).

konsulto_whoamiA

Show who the MCP is acting as, their permissions, the active audit, and how authentication is configured. Call this first in any session to orient yourself before performing actions. Returns user identity, tenant, role permissions, MCP token expiry, and active audit pin.

Inputs: no named parameters.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.2/5.0

    Scored across 19 tools

    Disambiguation5/5

    Every tool has a clearly distinct purpose. Overlaps like append_to_section and replace_section are differentiated by operation type, and search vs get findings serve different needs. No ambiguity.

    Naming Consistency5/5

    All tools follow a consistent 'konsulto_verb_noun' pattern. Verbs are action-specific (add, append, attach, compose, create, etc.) and nouns target distinct entities, making names predictable and easy to navigate.

    Tool Count5/5

    19 tools cover the core workflows of a security audit MCP server—finding management, evidence, assets, templates, and audit context. The count is well-scoped, each tool earning its place without bloat.

    Completeness4/5

    The tool surface is comprehensive for the stated purpose, covering creating, reading, updating, and searching findings, evidence lifecycle, asset management, and audit orientation. The only notable gap is the absence of deletion operations (findings, assets, etc.), which may be intentional but slightly reduces completeness.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers