CNSLabs/agreements-api-sdk

🤝 Agreements & Coordination🟢 Verified Active
0 Views
0 Installs

📇 ☁️ 🏠 - Remote Streamable HTTP and local stdio MCP server for defining, validating, deploying, and operating machine-readable agreements with EIP-712 permit preparation, signed participant inputs, state reads, and input history.

Quick Install

One-Click IDE Configuration
claude_desktop_config.json
{
  "mcpServers": {
    "cnslabs-agreements-api-sdk": {
      "command": "npx",
      "args": [
        "-y",
        "cnslabs-agreements-api-sdk"
      ]
    }
  }
}
Or

Using an AI coding agent (Claude Code, Cursor, etc.)? Copy a ready-made prompt that tells it to fetch the setup instructions and install this server for you.

Documentation Overview

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, agents or tools using MCP, and the canonical Shodai Reference App built on top of the SDK.

Start Here

NeedStart
Understand ShodaiShodai Home · Developer Docs · Demo App
Get accessDev Portal / API keys
BuildChoose 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 and apps: @shodai-network/agreements-api-client · @shodai-network/agreements-mcp-server · agreements-api-playground · shodai-reference-app

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

PathUse it whenFirst success
MCP / agent toolsAn 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 SDKYou 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 appLocationPurpose
@shodai-network/agreements-api-clientpackages/agreements-api-clientTyped REST client for the Agreements API with viem permit-signing helpers.
@shodai-network/agreements-mcp-serverpackages/agreements-mcp-serverLocal MCP server package aligned with the hosted Agreements execution MCP surface.
agreements-api-playgroundapps/agreements-api-playgroundReference Vite app for browser API experimentation and SDK workflow examples.
shodai-reference-appapps/shodai-reference-appFull-stack React/Nest/Mongo reference implementation for developer platform auth, Agreements API usage, agreement lifecycle UX, signing, persistence, and webhook reconciliation.

Install the TypeScript SDK

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

npm install @shodai-network/agreements-api-client

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

npm install @shodai-network/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", "@shodai-network/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

PhaseTypeScript SDKMCP
Author agreement JSONUse complete agreement JSON artifacts and examples.Read example resources or use the authoring prompt.
Validate structureclient.validateTemplate(...)validate_agreement
Preflight deploymentclient.validateDeployment(...)preflight_deployment
Prepare or sign deployment permitSDK signing helpers with viemprepare_deployment_typed_data and external signing
DeploydeployAgreementWithPermit(...) or client.deployWithPermit(...)deploy_agreement with signed permit fields
Read stateclient.getAgreementState(...)get_agreement_state
Prepare or sign input permitSDK input-signing helpersprepare_input_typed_data and external signing
Submit inputsubmitAgreementInputWithPermit(...) or client.submitAgreementInput(...)submit_input with signed permit fields
Inspect historyclient.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

The default dev command starts the Shodai Reference App. Its backend defaults to http://localhost:4199 and its frontend defaults to http://localhost:5184/agreements/.

Stop the reference app dev stack with:

pnpm dev:stop

See apps/shodai-reference-app/README.md for the required local environment files.

Run the API playground explicitly with:

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 @shodai-network/agreements-api-client run lint
pnpm --filter @shodai-network/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

Related MCP Servers

humanforai/humanforai-mcp

🎖️ 📇 ☁️ - Hire a real human operator for tasks that need physical presence, perception, or judgment: real-world verification, product testing, AI output review, data collection, and local errands. Remote streamable HTTP at https://humanforai.dev/mcp or local stdio via npx -y humanforai.

🤝 Agreements & Coordination0 views
modelcontextprotocol/server-gitlabVerified

📇 ☁️ 🏠 - GitLab platform integration for project management and CI/CD operations

🔄 Version Control2 views
Moxie-Docs-MCP★ Featured

MCP & Agent Skills for Automated Documentation, and codebase conventions + context

💻 Developer Tools2 views
modelcontextprotocol/server-gitVerified

🐍 🏠 - Direct Git repository operations including reading, searching, and analyzing local repositories

🔄 Version Control1 views

Engagement

Views
0
Installs
0
Upvotes
0

Views and upvotes are unique per visitor network (hashed IP). Installs count copy actions.

Status

Health: Active

Recent health check succeeded.

Last checked: 7/28/2026, 9:14:49 PM

Unclaimed listing (imported or pending owner verification). Claim it →
★ Spotlight Slot

Feature Your MCP Server

Get maximum visibility for your server across our directory, search results, and detail pages.

Spotlight Your Server

Own this project?

This directory is pre-filled from public sources. Claim via GitHub README, site badge, or DNS TXT to get the verified badge and attach your website.

Claim this listing

Promote this listing

Optional paid placement. Free listings stay free forever.

Share & Embed

Add our SVG badge (dark/light directory styles) or embeddable widget to your site.