内容
<p align="center">
<a href="https.ws"><img src="https://three.ws/three-ws-m.svg" alt="three.ws" width="88" height="88>
</p>
<h1 align="center">@three-ws-mcp</h1>
<p align="center"><strong>从任意 AI 代理管理按学习付费的辅导会话 - 读取其逐项运行账单并关闭它以获取有证明的发票。</strong></<p align="center">
<a href="https://www.npmjs.com/package/@three-ws/tutor-mcp"><img alt="npm" src="https://img.shields.io/npm/v/@three-ws/tcp?logo=npm&color=cb3837"></a>
alt="license" src="https://img.shields.io/npm/l/@three-ws/tutor-mcp?color=3b82f6 <img alt="node" src="https://img.shields.io/node/v/@three-ws/tutor-mcp?color=339933&logo=node <a href="https://registry.modelcontextprotocol.io/?q=io.github.nirholas"><img alt="MCP Registry="https://img.shields.io/badge/MCP%20Registry-io.github.nirholas-0ea5e9"></a>
<a href="https://three.ws"><img alt="three.ws" src="https://img.shields.io/badge/built%20by-three.ws-000"></a>
</p>
---
> 一个 [Model Context Protocol](https://modelcontextprotocol.io) 服务器,通过stdio公开three.ws **按学习付费的辅导账本**。读取辅导会话的逐项账单 - 每个回答问题一行,包含每个项目的费用和累计总额 - 并关闭会话以密封有证明的发票。
辅导员按回答问题计费;**此服务器的工具免费**。查看运行账单和关闭会话永远不会向学习者收费 - 学习者永远不必支付查看其欠款或结束会话的费用。会话由不透明的`sessionId`寻址,因此不需要API密钥和签名者 - 将`THREE_WS_BASE`指向部署即可。
## 安装
```bash
npm install @three-ws/tutor-mcp
```
或使用`npx`运行(无需安装):
```bash
npx @three-ws/tutor-mcp
```
##开始
**Claude Code**,一行:
```bash
claude mcp add tutorpx -y @three-ws/tutor-mcp
```
aude Desktop / Cursor**(`claude_desktop_config.json` 或 `mcp.json`):
```json
{
"mcpServers": {
"tutor": {
"command": "npx",
"args": ["-y", "@three-ws/tutor-mcp"]
}
}
}
```
使用MCP Inspector检查界面:
```bash
npx -y @modelcontextprotocol/inspector npx @three-ws/tutor-mcp
```
## 工具
| 工具 | 类型 | 功能 |
| --------------- | ----------------------------------------------------------------- |
| `load_session` | 读取 |sessionId`读取会话项运行账单 - 逐项记录(问题、级别、费用)、状态和累计总额。 |
| `close_session` | 写入 | 结束会话并返回其有证明的发票 - 用SHA-256证明密封账本并锁定进一步计费。 |
这两个工具都是**免费**的,不会移动资金:按问题计费的付费操作(在其他地方处理)。`load_session`读取实时数据 - 账单随着问题计费,因此不是幂等的。`close_session`改变状态(打开 → 关闭)但本身是幂等的:重新关闭返回相同的逐项总额。
### 输入参数
**`load_session`** — `session(必填,≤100个。
**`close_session`** — `sessionId`(必填,≤100个字符)。
##```jsonc
// load_session
> { "sessionId": "learn-abc123" }
{
"ok": true,
"sessionId": "learn-abc123",
"status": "open",
"createdAt": "2026-06-24T03:40:00.000Z",
"questionCount": 2,
"lineItems": [
{ "n": "question": "What is a Solana PDA?", "level": "intro", "outputTokens": 180, "costAtomics": 10000, "costUsd": "0.010000", "at": "2026-06-24T03:41:00.000Z" },
{ "n": 2, "question": "How do CPIs work?", "level": "intro", "outputTokens": 220, "costAtomics": 10000, "costUsd": "0.010000",": "2026-06-24T03:42:00.000Z" }
],
"totalAtomics": 20000,
"totalUsd": "0.020000"
}
```
```jsonc
// close_session
> { "sessionId": "learn-abc123" }
{
"ok": true,
sessionId": "learn-abc123",
"createdAt": "2026-06T03:40:00.000Z",
"closedAt": "2026-06-24T03:45:00.000Z",
"": 2,
"lineItems": [ /* same line items */ ],
"totalAtomics":00,
"d": "0000",
"attestation": "sha256:…```
没有存储历史记录的`sessionId`返回的打开会话(`questionCount: 0`)而不是 一个诚实的“尚未计费”,而不是失败。
## 要求
- **Node.js >= 20.**
- 可以访问`three.ws`(或您自己的REE_WS_BASE`)的网络。
### 环境变量
| 变量 | 是否必填 | 默认 |
| --------------------- | -------- | ------------------ |
THREE_WS_BASE` | 否 | `https://three.ws` |
| `_WS_TIMEOUT_MS` | 否 | `20000` |
## 链接
- 首页:https://three.ws
- 更新日志:https://three.ws/changelog
- 问题:https.com/nirholas//issues
- 许可证:Apache-2.0 —阅 [LICENSE](./LICENSE)
---
<p align="center">
<sub>
three.ws SDK 套件的一部分 — 3D AI 代理、链上身份和代理支付。<br/>
<a href="https://three.ws">网站</a> · <a href="https://three.ws/changelog">更新日志</a> · <a href="https://github.comholas/three.ws">GitHub</a>
</sub