Skip to main content
Glama

tercet

マシンペイメントの記録の正本。 エージェントのすべての購入は、発生したその場で記録され(リクエスト → クォート → 署名済み承認)、オンチェーン上の決済と照合されます。そして、その差異には必ず名前が付きます —— 納品済みだが回収未了(delivered-but-uncollected)、支払済みだが未納(paid-without-delivery)、リプレイ(replay)、チェーン孤児(chain-orphan)。tercet は鍵・残高・決済経路に一切触れません。ただ監視し、証拠を生成するだけです。

tercet とは、互いに属し合う三行から成る詩節です。ここでは、すべての購入がそのひとつです。すなわち、リクエスト、承認、決済です。ダンテは tercet を連鎖させて、一つを抜けば詩全体が壊れるようにしました。この台帳も同じように、エントリを連鎖させます。

Python パッケージ名は依然として mesa(仮称)です。最初の PyPI リリースで tercet に改名されます。docs/ のプロジェクト文書はポルトガル語で書かれています。これらはビルド日記であり、フェーズごとの設計ドキュメントです。コード、スキーマ、この README は英語です。

アプリ — 台帳をライブで、6つの画面で

uv run mesa-app        # -> http://127.0.0.1:8400

01 blotter(エージェントが購入した内容、導出状態、各購入のイベントチェーン)・02 tca(無駄、エージェント間の重複排除、成果物ごとのコスト)・03 risk(タスクツリーごとの予算、人間による詳細、支払者パスポート)・04 lab(時点ベースの支出ポリシー・バックテストと、誠実な信頼区間)・05 books(三者照合、第三者タイムスタンプ2つで封印された期間、取引先ごとの明細、BR 税表示)・06 operations(監査済みエンジンをを画面から実行できます — デモ、コレクタ、エクスポート — テストネットのみ)。

アプリは構造的に読み取り専用です。Postgres のセッションは default_transaction_read_only=on で開始されるため、仮に望んでも台帳への書き込みはできません。tests/test_app.py がそれを証明しています。データは常に実データです。テストネットと合成取引行は画面自体にラベル表示されます。ピルを押すと凡例が表示されます。

Related MCP server: swarm-at

MCP サーバ — エージェントのための台帳ツール

claude mcp add tercet -- uv run mesa-mcp    # then ask: "how much did my agents spend?"

READツールは7つ(クローズドリスト、テストで証明済み): status_do_livrogastocompras(絞り込み可能)、compra(1件の購入 + そのイベントチェーン)、vereditospassaportesfiscal。アプリと同じ保証です。セッションは構造的に読み取り専用で、MCP サーバには書き込み経路がありません。tests/test_mcp_livro.py がそれを証明しています。トランスポート: stdio、ローカル。

エクスポート — ユニバーサル会計 + OECD CARF ビュー

uv run python scripts/fase13/contabil_build.py   # -> contabil/<yyyy-mm>/  (universal CSV, QuickBooks, Xero + per-tx audit detail)
uv run python scripts/fase13/carf_build.py       # -> fiscal/carf/<year>/  (OECD CARF view, born as OECD11 test data)

期間ごとの複式仕訳帳(借方 == 貸方は検証済み。少数決済を誠実に集計し、6桁の監査用ブリッジで1セント ごとに tx hash に紐付け)。さらに CARF ビュー — OECD フレームワーク(2025年7月の公式ガイド)に基づき、報告義務のある crypto-asset サービスプロバイダがこれらの取引をどのように報告するか。デモ用のラベル、合成された身分、実データです。詳細と注意点は docs/fase13-export.md にあります。

ゼロから、この README だけで

前提条件: uv、Docker、Python 3.11+。

# 1. dependencies + database (Postgres 17 on 127.0.0.1:5433 — your machine only)
uv sync
docker run -d --name mesa-pg -e POSTGRES_USER=mesa -e POSTGRES_PASSWORD=mesa `
  -e POSTGRES_DB=mesa -p 127.0.0.1:5433:5432 `
  -v mesa-pgdata:/var/lib/postgresql/data postgres:17
uv run python scripts/check_db.py            # migrations + hash-chain genesis, idempotent

# 2. TEST wallets (written to a local .env; never committed) + faucet USDC
uv run python scripts/setup_wallets.py
#    -> paste the buyer address into https://faucet.circle.com (USDC / Base Sepolia)
uv run python scripts/check_balance.py       # balance read on-chain

# 3. a toy seller + 10 REAL x402 payments on testnet
uv run uvicorn mesa.http.seller:app --port 8402     # terminal 1
uv run python scripts/fase1/buyer.py 10             # terminal 2 (writes the ledger)

# 4. the chain is the source of truth: collect and reconcile
uv run python -m mesa.collector              # matches (authorizer, nonce) with the ledger
uv run python -m mesa.cli                    # the verdict table, orphans in red

# 5. the product
uv run mesa-app                              # -> http://127.0.0.1:8400

実在のお金は一切かかりません: faucet で USDC を取得し、super 方式の下では faciliten の経費を負担します。

  • これまでの経過、証明されたこと、今後の予定: docs/DIARIO.md(ポルトガル語)— タスクごとのビルド日記。フェーズ別設計ドキュメントは docs/faseN.md にあります。

  • 秘密情報 (setup_wallets.py が生成する秘密鍵) はローカルの .env に置きます(gitignore 済み、コミット禁止)。別の場所に置きたい場合は MESA_ENV_FILE をそのファイルに指定し、同期フォルダ(OneDrive/Dropbox)のに保管してください。同期フォルダに入れた鍵は、クラウドに入れたも対応です。

リポジトリマップ

パス

内容

src/mesa/config.py

定数(USDC、ネットワーク、チェーンID) + .env から読み込む Settings

src/mesa/db.py

台帳へのアクセス — 構造的に挿入のみ

src/mesa/reconcile.py

中心機能: 三者照合(純粋関数)

src/mesa/collector.py

オンチェーンコレクタ: txHash ごとの Transfer + AuthorizationUsed。冪等、永続化カーソル

src/mesa/cli.py

uv run python -m mesa.cli — 判定テーブル、孤児行を赤表示

src/mesa/http/

HTTP レール: トイ売り側(カオスモード付き)+ 計測された買い手

src/mesa/mcp/

MCP: 有料ツールのレール(売り/買い)+ livro.py、読み取り専用のプロダクト MCP サーバ

src/mesa/app/

Web アプリ(FastAPI + Jinja2、サーバーレンダリング、読み取り専用セッション)

src/mesa/passaporte.py

支払人のパスポート: 可搬で自己署名の決済履歴

src/mesa/contabil.py / carf.py / decepto.py

出力用レンダラ(会計 / OECD CARF / ブラジル)

migrations/

連番の素の SQL — レールやトランスポートに依存しないスキーマ

scripts/

環境ユーティリティ + faseN/ — 各フェーズの実行可能な証明

tests/

pytest のゲート:汚れたデータを入れ → 期待通りの分類

docs/

ビルド日記 + フェーズ別設計書(ポルトガ語)

verificador/

スタンドアロン検証器 — このリポジトリを信頼せずに台帳とパスポートを検証

環境

uv sync
docker run -d --name mesa-pg -e POSTGRES_USER=mesa -e POSTGRES_PASSWORD=mesa `
  -e POSTGRES_DB=mesa -p 127.0.0.1:5433:5432 `
  -v mesa-pgdata:/var/lib/postgresql/data postgres:17
# 127.0.0.1 is mandatory: without it the ledger is open to any machine on the same
# Wi-Fi (docs/seguranca.md, hole #1). scripts/saude.py checks this, always.
uv run python scripts/setup_wallets.py   # generates the EOAs -> .env (NEVER committed)
uv run python scripts/check_db.py        # Postgres up + migrations + genesis
uv run python scripts/check_balance.py   # USDC balance read on-chain
uv run python scripts/saude.py           # ONE command: ruff+mypy+pytest+verifier+ports+secret scan
uv run python scripts/backup_db.py       # ledger dump -> backups/ (routine, ~5s)

フォーセット: https://faucet.circle.com → USDC → Base Sepolia(1アドレスあたり2時間で20 USDC)。 Anthropic キー(請求レールのエージェント・デモのみ): シークレット環境ファイルに ANTHROPIC_API_KEY=... を記入します。

各フェーズの証明を実行する

# Phase 1 — the ledger closes on dirty data
uv run uvicorn mesa.http.seller:app --port 8402     # terminal 1: HTTP seller
uv run python scripts/fase1/chaos_run.py            # terminal 2: chaos + reconciliation + asserts

# Phase 2 — x402 over MCP
uv run python -m mesa.mcp.seller                    # terminal 1: MCP seller (port 8403)
uv run python scripts/fase2/mcp_once.py             # terminal 2: 1 paid tool call + ledger

# Phase 10 — the payer passport (emits, verifies, gates a seller)
uv run python scripts/fase10/gate10_demo.py

# Any time: sweep the chain and reconcile
uv run python -m mesa.collector                      # testnet (seller payTo)
uv run python -m mesa.collector --pagador            # mainnet (payer-side)
uv run python -m mesa.cli

品質(「done」辞書の定義がある)

uv run python scripts/saude.py    # ONE command: ruff+mypy+pytest+verifier+ports+secret scan

脅威モデルと、適用範囲外を名前で素子を指定: docs/seguranca.md

Install Server
A
license - permissive license
A
quality
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

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

  • A
    license
    A
    quality
    D
    maintenance
    Enables agents to search and inspect live service offerings, generate x402 payment snippets, and understand blockchain-only balance policies.
    4
    96
    1
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables agent settlement, trust verification, and ledger operations for multi-agent workflows, with tools for blueprint management, credit tracking, and provenance recording.
    1
    MIT
  • F
    license
    A
    quality
    B
    maintenance
    Exposes a ledger system (invoice queue, duplicate control, VAT register, contractor history, decision journal) as MCP tools for AI agents, enabling accurate invoice processing with deterministic validation.
    7

View all related MCP servers

Related MCP Connectors

  • Read-only discovery for exact-commit Agent Skill validation, x402 payment, and signed receipts.

  • Read-only public financial evidence from LiquiLens, Undertow, Seiche and Palimpsest.

  • Immutable event logging and audit trail for agent transactions

View all MCP Connectors

Latest Blog Posts

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/BenyFridY/tercet'

If you have feedback or need assistance with the MCP directory API, please join our Discord server