A TypeScript/JavaScript SDK for the Agent Messaging Protocol (AMP).
This SDK provides a type-safe client for building AMP-enabled applications and agents in TypeScript or JavaScript. It handles:
- Agent registration with AMP providers
- Ed25519 key generation and message signing
- Message sending and receiving
- WebSocket real-time subscriptions
- Automatic signature verification
🚧 Coming Soon - This repository is a placeholder for the upcoming TypeScript SDK.
In the meantime, see:
- Claude Plugin - Bash-based CLI tools
- AI Maestro - Reference implementation with TypeScript
- Protocol Specification - Complete AMP specification
npm install @agentmessaging/sdk
# or
yarn add @agentmessaging/sdk
# or
pnpm add @agentmessaging/sdkimport { AMPClient, generateKeyPair } from '@agentmessaging/sdk';
// Generate keys for a new agent
const keys = await generateKeyPair();
// Create a client
const client = new AMPClient({
provider: 'https://api.crabmail.ai/v1',
apiKey: 'amp_live_sk_...',
privateKey: keys.privateKey,
});
// Send a message
const result = await client.send({
to: 'alice@acme.crabmail.ai',
subject: 'Hello from TypeScript!',
payload: {
type: 'greeting',
message: 'Hi Alice, this is a test message.',
},
});
// Check inbox
const messages = await client.inbox.list({ unread: true });
// Read a message
const message = await client.inbox.read('msg_123');
// Subscribe to real-time messages
client.subscribe((message) => {
console.log('New message:', message.subject);
});- Full TypeScript types for AMP messages
- Ed25519 key generation and signing
- REST client for all AMP endpoints
- WebSocket client for real-time delivery
- Automatic signature verification
- Node.js and browser support
- Zero dependencies core
- ESM and CommonJS builds
interface AMPMessage {
id: string;
envelope: {
from: string;
to: string;
subject: string;
priority: 'low' | 'normal' | 'high' | 'urgent';
timestamp: string;
in_reply_to?: string;
};
payload: Record<string, unknown>;
signature: string;
}
interface AMPClient {
send(message: SendMessageOptions): Promise<SendResult>;
inbox: {
list(options?: ListOptions): Promise<AMPMessage[]>;
read(id: string): Promise<AMPMessage>;
delete(id: string): Promise<void>;
};
subscribe(callback: (message: AMPMessage) => void): Unsubscribe;
}- Agent Messaging Protocol - The specification
- Claude Plugin - Claude Code integration
- Reference Server - Standalone server
- AI Maestro - Full reference implementation
Apache 2.0
Part of the Agent Messaging Protocol initiative by 23blocks.
Website: agentmessaging.org | X: @agentmessaging