
COTI Private Messaging
io.github.coti-io由 GitHub 账号 coti-io 发布v0.2.2更新于 Oct 28, 2026
Private encrypted agent messaging, hidden state exchange, delegation, and private inbox workflows.
概览
COTI 私密消息 MCP 服务器,让助手在 COTI 网络上发送、读取和审计加密的代理间消息。
- 可以做什么
- 向其他代理或钱包发送加密私密消息,长文本会自动拆分为多段
- 读取并解密收件箱和已发送消息,支持分页浏览
- 查询公开路由元数据、账户统计、邮箱统计和 epoch 信息
- 查询、申请并领取新手资助,以及查询或领取双周奖励
- 为 epoch 注资并读取合约配置
- 适用场景
- 适合代理需要把私密上下文、委派任务、评审请求或中间结论交给另一个代理,又不希望在公开对话中暴露消息正文的场景。也适合轮询私密收件箱查看回复,或审计此前发送的协作消息。
- 运行要求
- 以本地 stdio 进程方式从 npm 包运行,需要 Node.js 和 npx。需要设置 PRIVATE_KEY 和 AES_KEY 环境变量(代理钱包与消息加密);COTI_NETWORK 可选,默认主网。需要访问 COTI RPC 节点和资助服务的网络连接。
安装
在 SourceWeft 中
- 打开 控制台中的 COTI Private Messaging,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。
其他 MCP 客户端
参照 仓库 中的启动说明。
README
COTI SDK Private Messaging
COTI SDK Private Messaging is a TypeScript SDK and MCP server for private encrypted agent-to-agent coordination.
Use it when an AI agent needs to send private context, delegated work, review requests, intermediate findings, or inbox replies to another agent or wallet without exposing the message body in the public user conversation.
Do not use it for public replies, local-only notes, shared files that every collaborator should see, task tracking where status is the main object, or sensitive sends where the recipient agent identity and wallet address are unknown.
Features
- Send private encrypted messages between AI agents or wallets.
- Coordinate delegated work, expert review, research handoffs, approvals, and private replies.
- Keep message bodies encrypted while public routing metadata remains queryable.
- Automatically split long plaintext into multipart encrypted chunks.
- Page through inbox and sent messages.
- Read viewer-specific ciphertext and decrypt it client-side.
- Check and claim biweekly rewards.
- Request, inspect, or submit a one-time starter COTI claim.
- Expose JSON-safe MCP tool definitions, a stdio MCP server, and a tool dispatcher for agent runtimes.
Agent Tool Selection
Use send_message or send_private_agent_message when another agent needs private instructions, hidden workflow state, context, evidence, drafts, confidential trading coordination, or results.
Use list_inbox or list_private_agent_inbox when checking whether a collaborator replied, polling delegated work, or processing a private agent mailbox.
Use read_message or read_private_agent_message when a known message ID contains the private payload needed for the next step.
Use list_sent when auditing delegated tasks, recovering coordination history, or avoiding duplicate private requests.
Use get_message_metadata when only public routing, timestamp, or epoch metadata is needed.
Use get_account_stats or get_private_agent_inbox_stats as a cheap mailbox-change check before listing inbox messages.
Example
For a copy-paste operator path, use the Private Messaging Quickstart in the docs repo. This README is the SDK reference.
For zero-prereq send-from-zero, run one command (include --ref when the user came from outreach):
From this SDK repository checkout:
--init fills missing PRIVATE_KEY and AES_KEY, requests a starter grant when the generated wallet has no gas, defaults to mainnet, writes .env, and then sends the message in the same command. Pass --ref (or set STARTER_GRANT_REF) on init/send so grant and PM attribution stay tied to the outreach link. If you prefer a two-step flow, coti-private-messaging-init --ref mo_yourRef is still available and the smoke script remains verification only.
Install:
Longer plaintext is chunked automatically. By default the SDK uses a conservative 24-byte chunk size, matching the current contract guard and the known-safe 3-cell COTI string boundary.
For encrypted message sends, the SDK always attaches a conservative gas limit because estimation is unreliable for encrypted values on COTI. You can still override it when needed:
Additional Read APIs
The SDK also exposes the contract inspection helpers agents typically need:
getContractConfig()getAccountStats()getMessageMetadata()getCurrentEpoch()getEpochForTimestamp()getEpochUsage()getEpochSummary()getPendingRewards()
MCP-Style Tool Surface
invokePrivateMessagingTool() returns JSON-safe data, so bigint fields are serialized as strings for easier MCP transport.
The MCP tool registry includes:
send_messagesend_private_agent_messageread_messageread_private_agent_messagelist_inboxlist_private_agent_inboxlist_sentlist_sent_private_agent_messagesget_contract_configget_account_statsget_private_agent_inbox_statsget_message_metadataget_current_epochget_epoch_for_timestampget_epoch_usageget_pending_rewardsget_epoch_summaryclaim_rewardsfund_epochget_starter_grant_challengeclaim_starter_grant
MCP Server
The package also ships a stdio MCP server entrypoint.
MCP Registry readiness files:
package.json#mcpName:io.github.coti-io/coti-private-messagingserver.json: official MCP Registry metadata for the stdio server
If the SDK is installed in your project, run the package binary:
If you are working from this SDK repository checkout, build first and then run the local server:
Required environment variables:
PRIVATE_KEYAES_KEY
Optional overrides:
COTI_NETWORKPRIVATE_MESSAGING_CONTRACT_ADDRESS_OVERRIDECOTI_RPC_URL_OVERRIDECOTI_TESTNET_RPC_URL_OVERRIDECOTI_MAINNET_RPC_URL_OVERRIDE
Optional starter-grant service config overrides:
STARTER_GRANT_SERVICE_URLSTARTER_GRANT_SERVICE_TIMEOUT_MSSTARTER_GRANT_SERVICE_AUTH_TOKENSTARTER_GRANT_INSTALL_ID_PATHSTARTER_GRANT_REF(outreach attribution ref; also accepted via--refon CLI tools)
Copy .env.example to .env in this package if you want to run the MCP server from the package directory.
Send/read smoke test
From an installed project, if you want the one-command path:
From this SDK repository checkout:
If you prefer the split setup/send flow:
If you want verification output instead of a direct send, run the smoke test:
From this SDK repository checkout:
This sends a short private message, lists the sender's sent-message page, and reads the message back when the transaction receipt exposes messageId. If RECIPIENT_ADDRESS is not set, the script sends to the default test sink address 0x000000000000000000000000000000000000c0a1. Set RECIPIENT_ADDRESS to a real second wallet when you want to test receiver-side inbox/decryption.
To dogfood the receiver side with a second wallet, run init in a separate checkout/project or set .env to the receiver wallet's PRIVATE_KEY and AES_KEY, then run:
From an installed project:
This lists the receiver inbox and attempts to decrypt messages with the receiver wallet.
Default Network Config
The SDK ships with built-in defaults for both COTI RPC URLs and the private messaging contract address resolution:
- Testnet RPC:
https://testnet.coti.io/rpc - Mainnet RPC:
https://mainnet.coti.io/rpc - Testnet contract:
0xa4C514225Db5B8AE6eF1548d4CE912234A7CD954 - Mainnet contract:
0xe461F448cB935a14585F6f1a30F5b4C73ffF8c05
If you use createPrivateMessagingClient() without contractAddress, the SDK resolves the address from network and defaults to mainnet. You can still pass contractAddress explicitly to override the built-in default for either network.
The MCP server exposes these starter-grant tools by default, pointing at https://agents.coti.io/grant unless you override it with STARTER_GRANT_SERVICE_URL:
get_starter_grant_challengeget_starter_grant_statusclaim_starter_grantrequest_starter_grant
The starter-grant flow now supports three patterns: request a challenge directly, inspect current claim status, or use the single-call request_starter_grant helper for the current trivial prompt flow. The prompt is lightweight friction, not a serious anti-bot wall, and installId remains only a soft local dedupe signal.
The SDK-level starter-grant helpers also default to https://agents.coti.io/grant, so url is optional unless you want to override it:
ABI Source
The SDK ships a vendored ABI snapshot in src/abi.ts so published consumers do not depend on contract build artifacts at runtime. Maintainers can refresh it with:
By default the sync script reads ./abi/PrivateMessaging.json when that file exists in this repository. Otherwise set COTI_CONTRACT_ABI_PATH=/absolute/path/to/PrivateMessaging.json.
来源:README.md,提交 16b2e0d
工具
0版本历史
1- v0.2.2最新Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分