@agentlair/mcp
AgentLair
为你的 AI 智能体提供一个邮箱地址、加密保险库和行为信任评分——一个 API,无需 OAuth。
能力 | 描述 |
邮箱 | 在 |
保险库 | 加密的凭据存储。客户端 AES-GCM 加密——服务器仅存储密文。 |
审计追踪 | 每个操作都记录 Ed25519 签名。防篡改,可独立验证。安全发现会获得一个永久公开 URL——查看已验证的发现 → |
信任评分 | 基于观察到的行为得出的行为评分(0–100)——一致性、克制性、透明性。 |
MCP 服务器 | 所有能力均可作为 MCP 工具在 Claude Code、Cursor 或任何 MCP 客户端中使用。 |
Pods | 为多智能体或多租户部署提供命名空间隔离。 |
30 秒快速体验
无需注册。看看实时信任评分响应是什么样的:
# Healthy agent — high trust (score 84, principal level)
curl https://agentlair.dev/v1/demo{
"agentId": "acc_demo_healthy_XXXXXXXXXX",
"score": 84,
"confidence": 0.91,
"atfLevel": "principal",
"trend": "stable",
"dimensions": {
"consistency": { "score": 0.82 },
"restraint": { "score": 0.87 },
"transparency": { "score": 0.80 }
},
"observationCount": 1847
}# Suspicious agent — score 31, declining trend
curl 'https://agentlair.dev/v1/demo?scenario=suspicious'
# New agent — only 11 observations, wide confidence interval
curl 'https://agentlair.dev/v1/demo?scenario=new'每个 IP 限流 10 次请求/分钟。响应结构与实时 /v1/trust/:agentId 端点一致。
完整交互式演示——注册一个真实智能体,提交观察数据,获取实时信任评分(curl + jq,约 60 秒):
curl -sL https://raw.githubusercontent.com/piiiico/agentlair/main/examples/quickstart.sh | bashRelated MCP server: AgentTrust MCP Server
注册智能体
curl -X POST https://agentlair.dev/v1/auth/agent-register \
-H "Content-Type: application/json" \
-d '{"name": "my-research-agent"}'{
"api_key": "al_live_...",
"account_id": "acc_...",
"email_address": "my-research-agent@agentlair.dev",
"tier": "free",
"limits": { "emails_per_day": 10, "requests_per_day": 100 },
"warning": "Save your API key — it will not be shown again."
}从这里开始,智能体使用 api_key 进行身份验证,以发送邮件、存储凭据并发出带签名的审计事件。
快速开始:为你的智能体添加 AgentLair
1. 安装
pip install agentlair # Python
npm install @agentlair/sdk # TypeScript / Node2. 设置环境变量
export AGENTLAIR_API_KEY=al_live_...
export AGENTLAIR_EMAIL=my-agent@agentlair.dev3. 接入生命周期钩子
# Python — three integration points
import os, agentlair
lair = agentlair.AgentLair(os.environ["AGENTLAIR_API_KEY"])
addr = os.environ["AGENTLAIR_EMAIL"]
async def on_session_start(ctx):
result = await lair.email.inbox(addr)
if result["messages"]:
ctx.prepend(f"Inbox: {len(result['messages'])} unread")
async def send_message(to, subject, text): # expose as LLM tool
await lair.email.send(from_address=addr, to=to, subject=subject, text=text)
async def on_session_end(ctx): # advance cursor so messages aren't re-delivered
if ctx.last_message_id:
await lair.vault.store("inbox_cursor", ctx.last_message_id)// TypeScript
import { AgentLair } from '@agentlair/sdk';
const lair = new AgentLair(process.env.AGENTLAIR_API_KEY!);
const addr = process.env.AGENTLAIR_EMAIL!;
// Session start — drain inbox before planning
const { messages } = await lair.email.inbox(addr);
if (messages.length) context.prepend(`Inbox: ${messages.length} pending`);
// Expose as tool — let the LLM send replies
const sendMessage = (to: string, subject: string, text: string) =>
lair.email.send({ from: addr, to, subject, text });离线期间消息会累积,并在下次会话开始时排空。完整的插件示例(peek+ack、崩溃安全投递):hermes-agentlair。
MCP 服务器
npx @agentlair/mcp@latest为你的 MCP 客户端添加 9 个工具:智能体注册、邮件收发、保险库存储/读取、审计事件发出和信任评分查询。
智能体记忆需要信任层
智能体记忆是真正的基础设施。4 层记忆层级、多智能体租约、51+ 个 MCP 工具用于跨智能体会话的存储和检索。当多个智能体共享一个记忆池时,这个类别是可行的。
缺口在于:任何智能体都可以向共享记忆写入任何内容。无法验证谁写了什么,无法审计有争议的状态,破坏性写入没有信任门控。没有身份标识的共享记忆池就像一本任何人都可以乱写乱画的记事本。
每次写入都应当可归因。 AgentLair 的智能体证明令牌(AAT)是一种短期 EdDSA JWT,携带智能体的 did:web 身份和行为信任评分。在记忆写入时将其作为 Authorization 头提供——该写入现在具有密码学签名且可审计:
import { AgentLair } from '@agentlair/sdk';
const lair = new AgentLair(process.env.AGENTLAIR_API_KEY!);
// Issue a short-lived AAT (5 min) scoped to the memory server
const { token } = await lair.tokens.issue({
audience: 'memory.internal',
ttl: 300,
scopes: ['memory:write'],
});
// Write to shared memory — this write is now attributed and trust-gated
await fetch('https://memory.internal/mcp/memory/write', {
method: 'POST',
headers: {
'Authorization': `Bearer ${token}`, // signed agent identity
'Content-Type': 'application/json',
},
body: JSON.stringify({
key: 'research/competitor-analysis',
value: { /* ... */ },
}),
});记忆服务器通过标准 JWKS 验证 AAT——接收端无需 AgentLair SDK。al_trust 声明允许其按行为信任级别对写入进行门控(例如,拒绝来自 junior 以下智能体的写入)。
没有 AAT:共享记忆 = 共享记事本。任何智能体都可以写入任何内容,有争议的状态没有来源。
有了 AAT:共享记忆 = 信任图谱。每次写入都有签名、可归因、可审计。
SDK
npm install @agentlair/sdkAgentLair API 的 TypeScript 客户端。参见 agentlair.dev/getting-started。
免费套餐
每天 10 封邮件
每天 100 次 API 请求
10 个邮箱地址
Pro:每栈每月 $5,可获得更高限额。
架构
API:Cloudflare Workers——边缘部署,低延迟
状态存储:Cloudflare KV
保险库加密:通过
@agentlair/vault-crypto实现客户端 AES-GCM 加密。服务器仅存储密文——静态状态下无明文凭据。审计追踪:Ed25519 签名的事件链。每个事件都可独立验证,无需信任服务器。
我们一直在生产环境中使用 AgentLair 运行自己的智能体基础设施。关于构建行为信任评分时遇到的问题和学到的经验笔记:agentlair.dev/blog/from-0-to-41-building-behavioral-trust-in-production
文档
AAT × APS 边界(跨协议参考)
AgentLair AAT 是签发方内部的会话身份。AEOESS APS 是交接后的委托链和双边收据。三个声明桥接了两层:jti(APS 收据上的会话锚点)、al_nid(一个 Ed25519 密钥同时签署 AAT 和 APS 收据)、以及 al_trust(在 iat 时刻由签发方证明的行为快照,可在 APS 验证方一侧用于导入时降级)。
共同维护的参考:
agent-passport.org/aat-aps-boundary.html(AEOESS 侧,权威版本)
仓库结构
packages/
worker/ — Core API worker (Cloudflare Workers)
sdk/ — @agentlair/sdk client library
mcp-server/ — @agentlair/mcp MCP server
vault-crypto/ — @agentlair/vault-crypto end-to-end encryption
verify/ — @agentlair/verify AAT token verification
email-worker/ — Email processing worker
apps/
dashboard/ — Agent dashboard UI
email-channel/ — Email MCP channel开发
bun install # install all dependencies
bun run typecheck # type-check all packages许可证
MIT
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceExposes identity, tools, workflows, guardrails, and evaluation as MCP tools — so any AI agent can read and write your ecosystem programmatically.32MIT

AgentTrust MCP Serverofficial
AlicenseNot gradedqualityDmaintenanceEnables AI agents to use email, instant messaging, and cloud file storage via MCP tools, giving each agent a verified identity with its own email address, real-time chat, and file sharing capabilities.821MIT- AlicenseNot gradedqualityCmaintenanceEnables AI agents to discover and execute tools via a secure MCP server with JWT authentication, RBAC, rate limiting, and audit logging.1MIT
- AlicenseAqualityAmaintenanceProvides AI agents with compliance screening (OFAC sanctions, risk scoring, Know-Your-Agent) plus disposable email and SMS verification for OTPs, accessible via MCP tools, HTTP API, and CLI.101MIT
Related MCP Connectors
Hosted email MCP for AI agents with inboxes, send/receive, memory, recovery, and credits.
MCP-native Trust Infrastructure for AI Agents. Persistent encrypted memory with Trust Quotient.
Phone, SMS & email for AI agents — one remote MCP endpoint, OAuth login, zero install.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/piiiico/agentlair'
If you have feedback or need assistance with the MCP directory API, please join our Discord server