
Trustmodel Mcp
io.github.karlmehta由 GitHub 帳號 karlmehta 發布v0.2.0更新於 Oct 24, 2026
Score any AI for trust across 10 dimensions; evaluate, monitor & govern LLMs and agents.
概覽
讓助理為 AI 模型與代理進行信任、安全、偏誤與安全性評分,並記錄代理執行軌跡以供評估。
- 可以做什麼
- 提供 TrustModel 工具,用於模型批次評估(安全、偏誤、準確度、幻覺)、代理軌跡擷取(開始、記錄步驟、結束、上傳、評估、評分)、額度查詢、MCP 伺服器安全掃描、紅隊探測,以及在 GitHub 與 GCP 上探索影子 AI。預設設定只會顯示六個常用工具,進階設定則會加入雲端批次評估、紅隊與檔案系統掃描工具。結果以評估或掃描 id 輪詢取得,報告可在 TrustModel 儀表板查看。
- 適用情境
- 當你希望在推出前為 LLM 或代理建立信任或安全基準、需要依工具使用、推理品質、目標完成度與安全合規為代理執行軌跡評分,或想對第三方 MCP 伺服器的工具清單做安全掃描、找出未登記的 AI 使用時,適合採用。
- 執行需求
- 透過 npx 以 stdio 在本機執行,需要 Node.js 20.19 或更新版本。校準類雲端工具需要 TRUSTMODEL_API_KEY 中的 TrustModel API 金鑰;本機評估與治理工具不需要金鑰。選用變數包括 TRUSTMODEL_BASE_URL、TRUSTMODEL_TRACE_DIR、TRUSTMODEL_PROFILE、TRUSTMODEL_ADVANCED_TOOLS 與 TRUSTMODEL_AGT_DISCOVERY_ENABLED。雲端呼叫需要網路存取。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Trustmodel Mcp,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
TrustModel MCP Server
A Model Context Protocol (MCP) server that lets any AI agent call TrustModel for trust evaluation, safety/bias analysis, and end-to-end agentic trace evaluation.
Works with Claude Code, Cursor, Windsurf, Claude Desktop, and any other MCP-compatible client.
Quick Start
1. Get an API key
Sign up at app.trustmodel.ai and create an API key under Settings → API Keys. Keys have the format tm-{env}-{keyid}_{secret} (e.g. tm-prod-abc12345_0123456789abcdef…).
2. Configure your MCP client
Claude Code
Cursor / Windsurf
Add to your MCP configuration file (.cursor/mcp.json or equivalent):
Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
Environment Variables
Tool profiles
To stay within the 5–8 tool best-practice budget (more tools degrade an agent's tool selection), the server exposes a small default set and keeps advanced tools opt-in.
Default profile (6 tools) — the daily drivers:
trustmodel_evaluate_local · trustmodel_score · trustmodel_trace_start · trustmodel_trace_step · trustmodel_trace_finalize · trustmodel_govern
Advanced — set TRUSTMODEL_PROFILE=security (or advanced / all, or TRUSTMODEL_ADVANCED_TOOLS=true) to additionally expose: trustmodel_evaluate (cloud batch), trustmodel_credits, trustmodel_upload_trace, trustmodel_evaluate_agent, trustmodel_score_agent, trustmodel_mcp_scan_server, trustmodel_shadow_discovery_*, trustmodel_redteam_*, and trustmodel_shadowai_* — 20 tools total.
Tools
The server exposes 18 tools across six areas. Use this table to pick the right one; full input/output docs follow below.
Shadow Discovery tools (
trustmodel_shadow_discovery_*) touch the local filesystem. They are always listed, but return a skip report unlessTRUSTMODEL_AGT_DISCOVERY_ENABLED=trueis set on the server.
Classic evaluation
trustmodel_evaluate
Create a batch evaluation run against a specified AI model. The backend runs a comprehensive suite (safety, bias, accuracy, hallucination, reasoning, etc.) and returns an id you can poll with trustmodel_score.
Inputs:
model_identifier(string, required) — e.g."gpt-4o","claude-sonnet-4-5". Discover viaGET /sdk/v1/models/.vendor_identifier(string, required) — e.g."openai","anthropic","google".api_key(string, optional) — Vendor API key for BYOK. Omit to use TrustModel's platform key. Do not pass a TrustModel API key here — that goes in theTRUSTMODEL_API_KEYenv var.categories(string[], optional) — Category names to evaluate. Only honored whenevaluation_typeis"Custom"or"Score Only".evaluation_type(string, optional, default"Custom") — One of"Custom","Score Only","Comprehensive","Limited","Quick Scan".application_type(string, optional, default"generic") —chatbot,knowledge-agent,creation-tool,document-repository,analysis-tool,automation-agent,generic.user_personas(string[], optional, default["external-customer"]) — Any ofexternal-customer,internal-employee,technical-user,domain-expert,vulnerable-groups,generic.application_description(string, optional).domain_expert_description(string, optional) — Whenuser_personasincludes"domain-expert". One of"cross-domain"(default),"medical","commercial_banking".model_config_name(string, optional) — Display name for this run.template_id(UUID, optional),template_name(string, optional) — Reuse or rename an existing evaluation template.
trustmodel_score
Fetch the detail (status, completion %, scores) for an evaluation created via trustmodel_evaluate.
Inputs:
evaluation_id(integer or numeric string, required) — Theidreturned bytrustmodel_evaluate.
trustmodel_credits
Check remaining API credit balance. No inputs.
Agentic trace evaluation
TrustModel evaluates AI agents by consuming their execution trace (thoughts, tool calls, tool results, responses) and scoring them across 4 categories: tool_use_accuracy, reasoning_quality, goal_completion, safety_compliance.
There are two ways to submit a trace — streaming (preferred for live agents) and one-shot (when you have a pre-assembled trace).
Streaming capture (preferred)
Open a session, record steps as the agent works, finalize at the end. Finalize uploads to cloud storage and auto-creates the evaluation run.
trustmodel_trace_start
Open a new trace session.
Inputs:
goal(string, required) — What the agent is trying to achieve.name(string, required) — Display name for the evaluation run.agent_framework(string, required) — e.g."langchain","crewai","claude-code","custom".agent_model(string, optional) — e.g."gpt-4o","claude-sonnet-4-5".user_query(string, optional) — Original user prompt, if different fromgoal.expected_outcome(string, optional).metadata(object, optional) — Free-form passthrough metadata.
Returns: { trace_id, started_at }.
trustmodel_trace_step
Append a single step to the active session. Call once per reasoning step, tool call, tool result, or user-facing response.
Inputs:
trace_id(string, required) — Fromtrustmodel_trace_start.step_type(enum, required) — One ofthought,think,tool_call,tool_result,observation,decision,error,human_input,response,final_answer.content(string, required) — Human-readable text for the step. Empty string allowed.tool_name(string, optional),tool_args(object, optional) — Use withtool_call.tool_result(string or object, optional),tool_call_success(boolean, optional) — Use withtool_result.model_used(string, optional),input_tokens/output_tokens(int, optional),duration_ms(int, optional),timestamp(ISO 8601, optional).
Returns: { trace_id, step_number, steps_recorded }. step_number is auto-assigned.
trustmodel_trace_finalize
Close the session, upload the trace, and auto-create the evaluation run.
Inputs:
trace_id(string, required).final_response(string, optional),actual_outcome(string, optional),goal_achieved(boolean, optional),success(boolean, optional),total_duration_ms(int, optional — computed from step durations if omitted).goal/name/agent_framework/agent_model/expected_outcome(all optional) — Override start-time metadata if the agent learned more at runtime.
Returns (happy path): { trace_id, file_path, expires_in, step_count, evaluation_run_id, evaluation_status, evaluation_message }.
Returns (evaluate failed after successful upload): { trace_id, file_path, expires_in, step_count, evaluation_error }. You can retry evaluation without re-uploading via trustmodel_evaluate_agent({ file_path, goal, name, agent_framework }).
One-shot (pre-assembled trace)
trustmodel_upload_trace
PUT an already-built trace JSON object to cloud storage. Returns a file_path you then pass to trustmodel_evaluate_agent.
Inputs:
trace(object, required) — CompleteAgentTraceJSON.
Returns: { file_path, expires_in }.
trustmodel_evaluate_agent
Create an agentic evaluation run against a previously-uploaded trace.
Inputs:
file_path(string, required) — Fromtrustmodel_upload_traceortrustmodel_trace_finalize.goal/name/agent_framework(strings, required).agent_model/expected_outcome/actual_outcome(string, optional).goal_achieved(boolean, optional).
Returns: { evaluation_run_id, status, message }.
trustmodel_score_agent
Fetch the detail (scores, grade, summary) for an agentic evaluation run.
Inputs:
evaluation_run_id(integer or numeric string, required).
Security
trustmodel_mcp_scan_server
Run AGT's MCP security scanner over a third-party MCP server's tool list to detect tool poisoning, typosquatting, hidden instructions, and rug-pull patterns. Static analysis — no LLM, no network, deterministic. Intended as a pre-registration check before an agent enables a third-party MCP server.
Inputs:
tools(array, required) — The third-party server's tool definitions (name,description, optional input schema).
Returns: A ScanReport with overall status (ok / warning / blocked), worst severity seen, and per-tool findings.
Shadow Discovery
Filesystem-touching. Returns a skip report unless
TRUSTMODEL_AGT_DISCOVERY_ENABLED=true.
trustmodel_shadow_discovery_scan_paths
Walk local filesystem paths and detect agents in config files (agentmesh.yaml, crewai.yaml, mcp.json, claude_desktop_config.json, …), Dockerfiles/compose, and optionally source. Reconciles detections against a caller-supplied registry and returns the unregistered ones as shadow agents with AGT risk scoring + remediation. Static analysis only.
Inputs:
paths(string[], required) — Local paths to scan.registry(array, optional) — Known agents (did,name,owner, …) to reconcile against.
trustmodel_shadow_discovery_fingerprint_keys
Fingerprint a batch of provider API keys (OpenAI / Anthropic) by calling each provider's read-only models endpoint — no inference is run. A reachable key is flagged high-risk (possible credential exposure); a revoked key is informational. Key material is never logged or returned — only a provider:****last4 fingerprint.
Inputs:
keys(string[], required) — API keys to probe.
Red Team
trustmodel_redteam_evaluate
Run an adversarial red-team evaluation against an OpenAI-compatible target. Probes cover 8 attack categories aligned with OWASP LLM Top 10 (2025) — prompt injection, jailbreak, PII extraction, bias elicitation, hallucination triggers, and more.
Inputs:
model_name(string, required) — e.g."openai/gpt-oss-20b:free".api_key(string, required),api_base_url(string, required) — e.g."https://openrouter.ai/api/v1".categories(string[], optional),severities(string[], optional),metadata(object, optional).
Returns: The evaluation id — poll with trustmodel_redteam_results.
trustmodel_redteam_results
Get status, progress, overall score, per-category breakdown, and severity buckets for a red-team evaluation. Partial progress while running, full summary when completed.
Inputs:
evaluation_id(integer or numeric string, required).
trustmodel_redteam_list_probes
Browse the red-team probe library (metadata only — payloads are not exposed). Filter by category, severity, or tag.
Inputs:
category(string, optional),severity(string, optional),tag(string, optional).
Shadow AI
trustmodel_shadowai_scan
Kick off a Shadow AI Discovery scan against GitHub orgs/repos and (optionally) GCP projects. Detects unregistered AI by sniffing source for LLM SDK usage (15 libraries) and listing Vertex AI endpoints, Cloud Run services with AI env vars, and BigQuery ML models.
Inputs:
github_orgs(string[], optional),github_repos(string[] ofowner/name, optional),gcp_projects(string[], optional),metadata(object, optional).
Returns: The scan id — poll with trustmodel_shadowai_results, page discoveries with trustmodel_shadowai_events.
trustmodel_shadowai_results
Get status, scan filter, total event count, and discoveries-by-system-type / by-source aggregates for a Shadow AI scan.
Inputs:
scan_id(integer or numeric string, required).
trustmodel_shadowai_events
Page through individual discovery events — each is one discovered AI system with system_type, discovered_via, evidence, and a stable system_id fingerprint. Filter by system_type or source.
Inputs:
scan_id(integer or numeric string, required), plus optionalsystem_type/sourcefilters and pagination.
Example — streaming agent capture
Example — realistic agentic flow
Below is a real-world scenario: you ask Claude Code to perform a task while instrumenting itself with TrustModel trace capture. At the end, TrustModel scores the agent across tool-use accuracy, reasoning quality, goal completion, and safety compliance — giving you a trust report before you ship the agent to production.
Scenario: research agent
Paste this prompt into Claude Code (or any MCP client with TrustModel connected):
What happens
The agent researches the topic while self-tracing every reasoning step, search, and conclusion. A typical session looks like:
The evaluation result
Poll trustmodel_score_agent({ evaluation_run_id: 42 }) after 1-2 minutes. TrustModel returns:
A PDF/HTML report with detailed findings is also generated and accessible from the TrustModel dashboard.
Why this matters
Every AI agent making decisions — reviewing code, processing claims, screening candidates — needs a trust baseline before going to production. This flow gives you that baseline with zero changes to your agent's core logic: just wrap it with trace_start, record steps as it works, and trace_finalize when it's done. TrustModel handles the rest.
Trace persistence
Active trace sessions are written as append-only JSONL at $TRUSTMODEL_TRACE_DIR/<trace_id>.jsonl (default ~/.trustmodel-mcp/traces/). Disk is the source of truth; the in-memory map is a cache that rehydrates lazily — so sessions survive an MCP server restart. On successful trustmodel_trace_finalize the local file is deleted (the trace is already in cloud storage).
Sessions idle more than 30 minutes are auto-evicted. Maximum 100 concurrent sessions per server.
Dashboard
Reports, evaluation history, and detailed PDF/HTML findings are available in the TrustModel dashboard at app.trustmodel.ai.
Troubleshooting
TrustModel open-source
This MCP server is part of the TrustModel OSS toolkit:
- CLI + SDK —
trustmodelon PyPI: local trust scoring, governance, and the cloud client.pip install trustmodel. - MCP server (this repo) —
@trustmodel/mcp-serveron npm: exposes TrustModel to any MCP client.
License
MIT
來源:README.md,提交 7f8807b
工具
0版本歷史
1- v0.2.0最新Sep 16, 2026
評分
已滿足適用檢查項的 40%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分
請在儲存庫或註冊中心條目中宣告授權條款。