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 分