Shodai Agreements

Shodai Agreements

MCP server for defining, validating, deploying, and operating Shodai machine-readable agreements with EIP-712 permit preparation, signed participant inputs, state reads, and input history.

Category
访问服务器

README

Shodai Agreements SDK + MCP

Shodai turns agreement definitions into machine-readable, verifiable coordination workflows for humans, products, and AI agents. Agreements carry readable terms plus participants, valid inputs, states, transitions, and history.

This repository supports builders using the TypeScript SDK and agents or tools using MCP.

Start Here

Need Start
Understand Shodai Shodai Home · Developer Docs · Demo App
Get access Dev Portal / API keys
Build Choose SDK vs MCP · MCP quickstart · TypeScript SDK quickstart · End-to-end workflow

Hosted MCP: https://shodai.network/mcp is the Shodai Agreements execution MCP endpoint. It uses Streamable HTTP, bearer API-key auth, an environment tool argument, environment-scoped keys, and no hosted private-key custody.

Packages: @cns-labs/agreements-api-client · @cns-labs/agreements-mcp-server · agreements-api-playground

Why Builders Use Shodai Agreements

  • Shared agreement state that humans, applications, and agents can inspect.
  • Deterministic next actions from authored states, inputs, issuers, and transitions.
  • Validation and deployment preflight before signatures.
  • EIP-712 signed authorization for deployment and participant inputs.
  • State and input history for receipts and monitoring.
  • Less repeated contract orchestration, indexing, and participant workflow plumbing.

Choose Your Path

Path Use it when First success
MCP / agent tools An agent or MCP-capable client will work with agreements through hosted Streamable HTTP or local stdio. Authenticate, read or list where permitted, validate an example, preflight deployment, and prepare deploy typed data.
TypeScript SDK You are building a TypeScript application or service. Authenticate, read or list agreements, validate an example, preflight deployment, and prove local EIP-712 signing readiness.

Both paths converge on the same agreement lifecycle. After one quickstart works, run the end-to-end workflow.

Hosted MCP Endpoint

Configure Shodai as a remote Streamable HTTP MCP server:

URL:
https://shodai.network/mcp

Auth:
Authorization: Bearer $SHODAI_API_KEY

Key shape:
cns_pk_...

Required API-calling tool argument:
environment: "testnet" | "production"

API keys only work in the environment where they were created. Hosted MCP never receives private keys; write tools use externally signed EIP-712 permits or typed-data preparation.

An ordinary browser GET to /mcp may return 405 because the endpoint expects MCP protocol requests. MCP surfaces on docs.shodai.network are for docs and search only; https://shodai.network/mcp is the Agreements execution endpoint.

What This Repository Contains

Package or app Location Purpose
@cns-labs/agreements-api-client packages/agreements-api-client Typed REST client for the Agreements API with viem permit-signing helpers.
@cns-labs/agreements-mcp-server packages/agreements-mcp-server Local MCP server package aligned with the hosted Agreements execution MCP surface.
agreements-api-playground apps/agreements-api-playground Reference Vite app for browser API experimentation and SDK workflow examples.

Install the TypeScript SDK

Most TypeScript consumers should install the published npm package rather than this monorepo:

npm install @cns-labs/agreements-api-client

Add viem if you want the built-in permit-signing helpers for deploy and input submission:

npm install @cns-labs/agreements-api-client viem

Create a client with a named Shodai environment:

const client = new ApiClient({
  environment: 'testnet',
  apiKey: process.env.AGREEMENTS_API_KEY,
});

SDK usage and API lifecycle docs live in packages/agreements-api-client/README.md. For constructor options, methods, signing helpers, diagnostics, and exports, see the TypeScript client reference.

Run MCP Locally

Use the published MCP package for local stdio clients:

{
  "mcpServers": {
    "shodai-agreements": {
      "command": "npx",
      "args": ["-y", "@cns-labs/agreements-mcp-server"],
      "env": {
        "AGREEMENTS_API_KEY": "YOUR_API_KEY",
        "AGREEMENTS_API_ENVIRONMENT": "testnet"
      }
    }
  }
}

Local stdio mode uses AGREEMENTS_API_ENVIRONMENT; hosted MCP uses the environment tool argument. See packages/agreements-mcp-server/README.md for self-hosting, environment variables, tools, resources, prompts, and Inspector usage.

Agreement Lifecycle

Phase TypeScript SDK MCP
Author agreement JSON Use complete agreement JSON artifacts and examples. Read example resources or use the authoring prompt.
Validate structure client.validateTemplate(...) validate_agreement
Preflight deployment client.validateDeployment(...) preflight_deployment
Prepare or sign deployment permit SDK signing helpers with viem prepare_deployment_typed_data and external signing
Deploy deployAgreementWithPermit(...) or client.deployWithPermit(...) deploy_agreement with signed permit fields
Read state client.getAgreementState(...) get_agreement_state
Prepare or sign input permit SDK input-signing helpers prepare_input_typed_data and external signing
Submit input submitAgreementInputWithPermit(...) or client.submitAgreementInput(...) submit_input with signed permit fields
Inspect history client.listAgreementInputs(...) get_input_history

For a guided run through validation, deployment, signed input submission, state reads, and input history, use the end-to-end workflow.

Agreements API Environments

The SDK prefers a named environment instead of a raw host:

const client = new ApiClient({
  environment: 'testnet',
  apiKey: process.env.AGREEMENTS_API_KEY,
});

Built-in mappings:

  • testnet -> https://test-api.shodai.network
  • production -> https://api.shodai.network

API keys are environment-scoped. Use a testnet key with testnet and a production key with production.

The client still supports baseUrl as an advanced override for local proxies, internal gateways, or non-standard deployments. It continues to add /v0/* automatically.

Local Development

# from the repository root
pnpm install
pnpm build
pnpm dev:playground

The playground defaults to http://localhost:5176.

If that port is already in use, start the playground on another port:

pnpm --filter agreements-api-playground exec vite --host 127.0.0.1 --port 4176

For local browser development, the playground is environment-first and defaults to testnet. Use the in-app environment selector to switch between hosted testnet and production API targets.

Optional package-specific validation commands:

pnpm --filter @cns-labs/agreements-api-client run lint
pnpm --filter @cns-labs/agreements-mcp-server test

See apps/agreements-api-playground/README.md for the full environment configuration.

Boundaries

Hosted MCP does not hold private keys. OAuth/session auth and x402 payments are not current setup paths. Shodai agreements do not claim legal finality or fully autonomous enforcement. Shodai does not move value without authorized signed inputs.

Open Source Project Notes

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选