mcp
v0.11.0TinyCloud delegated operations MCP server
TinyCloud SDK is a comprehensive toolkit for building decentralized applications with TinyCloud. It provides easy-to-use interfaces for storage, authentication, delegations, and sharing. This monorepo contains the following packages: When a manifest or composed capability request includes tinycloud.encryption/decrypt for one of the signed-in user's own network IDs, the SDK adds a separate sign-in grant for tinycloud.encryption/network.create on that same network.
Summary extracted from the README.
TinyCloud SDK
TinyCloud SDK is a comprehensive toolkit for building decentralized applications with TinyCloud. It provides easy-to-use interfaces for storage, authentication, delegations, and sharing.
Features
- Web3 Authentication - Sign-in with Ethereum (SIWE) using your wallet
- Space Management - Create and manage user-owned data spaces
- KV Storage - Content-addressed key-value store scoped to user spaces
- Delegation System - Cryptographic capability chains for fine-grained access control
- Sharing - Portable delegation bundles for cross-user data sharing
- Encryption Networks - Network-scoped inline envelopes for secrets and vault data with
tinycloud.encryption/decrypt - Protocol Version Check - Automatic SDK-node compatibility verification during sign-in
- Wallet Integration - Seamless connection with popular Ethereum wallets (browser SDK)
- Server Support - Node.js SDK for server-side delegation chains and automation
- Type Safety - Written in TypeScript with comprehensive type definitions
Packages
This monorepo contains the following packages:
Core SDKs
| Package | Description | Platform |
|---|---|---|
@tinycloud/web-sdk |
Browser SDK with wallet integration | Browser |
@tinycloud/node-sdk |
Node.js SDK for server-side applications | Node.js |
Core Libraries
| Package | Description |
|---|---|
@tinycloud/web-core |
Shared types and utilities for browser SDK |
@tinycloud/sdk-core |
Core utilities and types shared across all SDKs |
@tinycloud/sdk-rs |
Rust implementation with cryptographic primitives |
WASM Bindings
| Package | Description |
|---|---|
@tinycloud/web-sdk-wasm |
WASM bindings for browser environments |
@tinycloud/node-sdk-wasm |
WASM bindings for Node.js environments |
Quick Start
Encryption Network Sign-In
When a manifest or composed capability request includes
tinycloud.encryption/decrypt for one of the signed-in user's own network IDs,
the SDK adds a separate sign-in grant for
tinycloud.encryption/network.create on that same network. After sign-in, the
SDK checks whether the network exists and creates it when missing, mirroring
autoCreateSpace behavior for newly hosted spaces.
This is the path used by apps such as Listen that request the user's default
network (urn:tinycloud:encryption:<ownerDid>:default) during manifest-driven
sign-in before delegating decrypt access to a backend.
Browser SDK
For OAuth-consented canonical-key sessions, see the manage-key integration guide.
npm install @tinycloud/web-sdk
import { TinyCloudWeb, type Manifest } from '@tinycloud/web-sdk';
// The manifest names the app. With no `permissions`, the app gets
// KV and SQL under `com.example.notes/` in the `applications` space.
const manifest: Manifest = { app_id: 'com.example.notes', name: 'Notes' };
const tc = new TinyCloudWeb({ manifest });
await tc.signIn();
// KV storage
await tc.kv.put('com.example.notes/myKey', { hello: 'world' });
const result = await tc.kv.get('com.example.notes/myKey');
Node.js SDK
npm install @tinycloud/node-sdk
import {
DEFAULT_SIGNED_READ_URL_EXPIRY_MS,
TinyCloudNode,
ownerFullAccess,
} from '@tinycloud/node-sdk';
// A backend acting as the owner of its own `default` space asks for every action there.
// An app acting for a user declares a `manifest` instead (see the web example).
const tc = new TinyCloudNode({
privateKey: process.env.PRIVATE_KEY,
domain: 'api.myapp.com',
...ownerFullAccess('default'),
});
await tc.signIn();
// KV storage
await tc.kv.put('myKey', { hello: 'world' });
const result = await tc.kv.get('myKey');
// Signed KV read URL for short-lived external reads.
// Requires tinycloud-node with the TC-1368 /signed/kv endpoint.
const signedAudio = await tc.kv.createSignedReadUrl('audio/meeting-1/recording', {
expiresInSeconds: Math.ceil(DEFAULT_SIGNED_READ_URL_EXPIRY_MS / 1000),
});
if (signedAudio.ok) {
console.log(signedAudio.data.url);
}
// Delegations
const delegation = await tc.createDelegation({
delegateDID: 'did:pkh:eip155:1:0x...',
abilities: ['tinycloud.kv/get', 'tinycloud.kv/put'],
});
Without a manifest, signIn() asks only for the app's own folder, applications/<your domain reversed>/ (KV and SQL), and logs a warning. A port other than 80 or 443 is part of the name: notes.example.com:8443 gets applications/com.example.notes_8443/. Apps with no domain share one folder, applications/node.app/, and log how to get their own. Sessions last 7 days unless you set sessionExpirationMs.
Documentation
For complete documentation, please visit:
Examples
Check out our examples directory for complete working examples of TinyCloud SDK integration.
Development
Prerequisites
- Bun (recommended) or Node.js v16+
- Rust for sdk-rs package
Building the SDK
# Clone the repository
git clone https://github.com/TinyCloudLabs/web-sdk.git
cd web-sdk
# Install dependencies
bun install
# Build all packages
bun run build
Running Tests
bun run test
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Inspiration
The TinyCloud Web SDK is the spiritual successor to the SSX SDK. SSX was an open source project built at SpruceID, made to make it easier to build apps with Sign in with Ethereum. While SSX saw limited adoption, it was a great project that pioneered the use of Ethereum for authentication and authorization. TinyCloud Web takes some of its architectural shape from SSX, but is built to be a modern SDK for building applications with TinyCloud.
License
This project is licensed under the TinyCloud Ecosystem General Public License (EGPL) v1.5 - see the LICENSE.md file for details.
Support
If you encounter any issues or have questions, please file an issue on our GitHub repository.
Community
Join the TinyCloud community: