Akf

io.github.HMAKT99由 GitHub 账号 HMAKT99 发布v1.6.2更新于 Oct 25, 2026

Trust metadata for AI agents — check files before building on them, stamp verified work.

概览

AI 生成的概览

本地 MCP 服务器,让助手在依赖文件之前检查、盖章、校验、审计和扫描文件的 AKF 信任元数据。

可以做什么
检查与评分文件:一行式信任检查、有效信任分,以及跨多种格式的 AKF 元数据安全扫描。盖章与嵌入:为 DOCX、PDF、图片、Markdown、代码等格式附加 AKF 信任元数据。校验与提取:按规范校验 .akf 文件,并提取声明、来源和信任分。审计与检测:针对 EU AI Act、SOX、HIPAA、GDPR、NIST AI RMF、ISO 42001 等框架执行合规审计,并运行 AI 专项威胁检测。创建声明并重放记录的探针配方,可选择执行记录的命令。
适用场景
适合多个代理或会话处理同一批文件、希望避免重复验证已完成工作的场景,也适合需要为文档和代码附加来源、信任分和合规式审计的场合。
运行要求
以本地进程通过 stdio 运行。需要 Python 3.10 或更高版本、mcp-server-akf 包(pip install mcp-server-akf)以及 akf 和 mcp 库。需在客户端的 MCP 配置中添加使用 python 命令和 mcp_server_akf 模块的服务器条目。未声明账户、API 密钥或环境变量。
安装前请注意
replay_file 在 run=true 时会执行记录的命令,属于任意代码,仅对可信文件使用。盖章、嵌入和创建声明会向文件写入元数据,建议在副本或受版本控制的文件上操作。审计结果由工具生成,不应视为正式的合规认证。

安装

在 SourceWeft 中

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

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

其他 MCP 客户端

参照 仓库 中的启动说明。

README

mcp-server-akf

mcp-name: io.github.HMAKT99/akf

MCP (Model Context Protocol) server that exposes 10 AKF tools to AI agents. Any MCP-compatible client (Claude Desktop, Claude Code, Cursor, Windsurf, etc.) can check, stamp, validate, audit, and scan files using the Agent Knowledge Format.

A stamp costs ~15 tokens. Re-verifying costs 15,000. Agents stamp what they verify; the next agent calls check_file and builds on it instead of redoing the work.

Installation

bash
pip install mcp-server-akf

Configuration

Claude Desktop

Add to ~/Library/Application Support/Claude/claude_desktop_config.json:

json
{  "mcpServers": {    "akf": {      "command": "python",      "args": ["-m", "mcp_server_akf"]    }  }}

Cursor

Add to .cursor/mcp.json in your project root:

json
{  "mcpServers": {    "akf": {      "command": "python",      "args": ["-m", "mcp_server_akf"]    }  }}

Tools

ToolDescription
check_fileOne-line trust check — can an agent build on this file without re-verifying? (OK / LOW / STALE / UNSTAMPED)
create_claimCreate an AKF claim with trust metadata
validate_fileValidate an .akf file against the spec
scan_fileSecurity scan any file for AKF metadata
trust_scoreCompute effective trust score for a claim
stamp_fileStamp trust metadata onto any file (20+ formats)
audit_fileCompliance audit (EU AI Act, SOX, HIPAA, GDPR, NIST, ISO 42001)
embed_fileEmbed AKF metadata into DOCX, PDF, HTML, images, etc.
extract_fileExtract AKF metadata from any supported format
detect_threatsRun 10 AI-specific security detections

Quick usage

Once configured, ask your AI agent:

"Stamp report.docx with AKF trust metadata, confidence 0.9, evidence 'quarterly review complete'"

The agent will call stamp_file through MCP and attach provenance automatically.

You can also run the server directly for testing:

bash
python -m mcp_server_akf

Verification state in tool results (experimental)

On mcp 2.x, a tool result for a file (any tool called with path) carries that file's verification state in _meta under the vendor key dev.akf/trust:

json
"_meta": {  "dev.akf/trust": {    "v": "1",    "status": "OK",    "trust": 0.7447,    "evidence": ["human_review"],    "agent": "claude-code",    "age_days": 4  }}

status is computed live (OK / LOW / STALE / UNSTAMPED), so a client sees whether the file changed since it was verified. The key is absent when the result isn't about a file. Clients that don't know the key ignore it.

To annotate your own server's results:

python
from mcp_server_akf.meta import TRUST_META_KEY, trust_meta
meta = trust_meta(path)return CallToolResult(content=[...], _meta={TRUST_META_KEY: meta} if meta else None)

To read it in a client:

python
result = await client.call_tool("extract_file", {"path": "report.md"})state = (result.meta or {}).get("dev.akf/trust")if state and state["status"] == "OK":    ...  # verified and unchanged: build on it without re-verifying

Multi-Agent Support

The MCP server works seamlessly with multi-agent orchestration platforms:

  • Agent Identity: Create and verify agent cards via akf agent create / akf agent verify
  • A2A Protocol: Export/import agent cards for cross-platform discovery via akf agent export-a2a
  • Team Certification: Use akf certify --team for per-agent trust breakdowns in CI
  • Delegation: Trust ceilings cap delegate output when agents hand off work
  • Team Streaming: Multi-agent sessions with per-agent claim attribution

Supports: Claude Agent Teams, Copilot Cowork, Codex multi-agent, and any A2A-compatible platform.

Requirements

  • Python >= 3.10
  • akf >= 1.0.0
  • mcp >= 1.0.0

来源:packages/mcp-server-akf/README.md,提交 2a0142e

工具

11

replay_file

Replay-verify a stamp's falsifiable probe recipe. Default inspects only: shows the recorded command and whether the claim's inputs drifted since issuance. With run=true, EXECUTES the recorded command (arbitrary code — only for files you trust) and returns CONFIRMED / CONFIRMED_DRIFTED (succeeded against diverged inputs) / REFUTED / UNREPLAYABLE.

输入参数runpath必填

check_file

One-line trust check before building on a file. Returns OK (fresh stamp, trust above threshold — skip re-verification), LOW (trust below threshold), STALE (modified after stamping or claims expired — re-verify), or UNSTAMPED (no metadata). Use this before re-reading, re-testing, or re-deriving work another agent already verified.

输入参数path必填threshold

create_claim

Create an AKF claim with trust metadata. Returns a JSON object with the claim, trust score, and provenance.

输入参数sourcecontent必填confidence必填ai_generated

validate_file

Validate an .akf file against the AKF specification. Returns validity status, validation level (0-3), errors, and warnings.

输入参数path必填

scan_file

Security scan any file for AKF trust metadata. Works with .akf, .docx, .pdf, .html, .md, .json, images, and any format with a sidecar.

输入参数path必填

trust_score

Compute the effective trust score for a claim using AKF's trust computation engine. Factors in confidence, authority tier, and temporal decay.

输入参数content必填confidence必填authority_tier

stamp_file

Stamp AKF trust metadata onto any file. Supports DOCX, PDF, images, Markdown, code, and 20+ formats. Use this after creating or modifying files.

输入参数path必填agentevidenceconfidenceclassification

audit_file

Run compliance audit on an AKF file against regulatory frameworks (EU AI Act, SOX, HIPAA, GDPR, NIST AI RMF, ISO 42001).

输入参数path必填regulation

embed_file

Embed AKF trust metadata into any supported file format (DOCX, PDF, HTML, images, Markdown, etc.).

输入参数path必填sourcecontent必填confidenceclassification

extract_file

Extract AKF trust metadata from any supported file format. Returns claims, classification, provenance, and trust scores.

输入参数path必填

detect_threats

Run 10 AI-specific security detections on an AKF file: hallucination risk, knowledge laundering, classification downgrade, trust degradation, and more.

输入参数path必填

版本历史

2
  1. v1.6.2最新Oct 24, 2026
  2. v1.6.0Sep 16, 2026

评分

已满足适用检查项的 90%

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

  • 近 30 天内可连通25 分
  • 已声明认证方式10 分

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

  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分