tinysend について
tinysendはtinysend APIの公式TypeScript SDKで、メールやニュースレターのデータを扱うアプリケーションやエージェント向けです。依存関係のないfetchベースの設計で、API全体を利用できます。
主な機能
- 01メーリングリストの管理
- 02リストの作成と取得
- 03fetchによるAPIアクセス
- 04実行時依存関係なし
- 05ベースURLとfetchのカスタマイズ
活用シーン
- 01TypeScriptコードからtinysend APIを利用
- 02SDKでリストを管理
- 03カスタムfetch実装を設定
設定
リモートサーバーはインストール不要です。クライアントを選んで設定をコピーするか、ワンクリックで導入できます。
エンドポイント
https://mcp.tinysend.comインストールコマンドをコピー
Claude CodeTerminal
claude mcp add --transport http tinysend-node https://mcp.tinysend.comCursor.cursor/mcp.json
{"mcpServers":{"tinysend-node":{"type":"http","url":"https://mcp.tinysend.com"}}}Cursor で開くVS Code.vscode/mcp.json
{"servers":{"tinysend-node":{"type":"http","url":"https://mcp.tinysend.com"}}}VS Code で開くClaude Desktopclaude_desktop_config.json
{"mcpServers":{"tinysend-node":{"type":"http","url":"https://mcp.tinysend.com"}}}Windsurf~/.codeium/windsurf/mcp_config.json
{"mcpServers":{"tinysend-node":{"serverUrl":"https://mcp.tinysend.com"}}}コマンドはターミナルで実行し、JSON は各クライアントの MCP 設定に貼り付けて再起動します。認可が必要なサーバーは初回接続時にログインを求めます。
ツール
詳細
tinysend
tinysend API 用の公式 TypeScript SDK です。依存関係ゼロで、fetch ベースです。Node.js、Bun、Deno、Cloudflare Workers、ブラウザーで動作します。
- ウェブサイト:tinysend.com
- ドキュメント:tinysend.com/docs
- エージェント:tinysend.com/agents
インストール
npm install tinysend
トークンの取得
すべての呼び出しにはベアラートークン(sk_...)が必要です。
- 人間の場合:tinysend.com のアカウント設定で作成します
- エージェントの場合:人間の介在なしで、自分自身を登録します。プロトコルは tinysend.com/auth.md(id.tinysend.com/agent/auth に POST)、手順ガイドは tinysend.com/agents/agent-auth にあります
使い方
import { Tinysend } from 'tinysend';
const ts = new Tinysend('sk_...');
// lists
const lists = await ts.lists.list();
const list = await ts.lists.create({ name: 'Weekly Update' });
// subscribers
await ts.subscribers.create(list.id, { email: '[email protected]', verified: true });
// send an email
const post = await ts.posts.create(list.id, {
subject: 'Hello World',
body_html: '<p>Welcome to our newsletter!</p>',
});
await ts.posts.send(list.id, post.id);
// contacts
const contacts = await ts.contacts.list({ search: 'john' });
// mailboxes
const mailboxes = await ts.mailboxes.list();
// stats
const stats = await ts.stats.project();
// webhooks
const hook = await ts.webhooks.create({
url: 'https://example.com/webhook',
events: ['post.sent', 'subscriber.created'],
});
// sender domain (who emails come from)
await ts.sender.set(list.id, { type: 'custom_domain', name: 'James', email: 'james', domain: 'acme.com' });
await ts.sender.check(list.id); // re-check DNS
// custom domain for the archive site
await ts.siteDomains.set(list.id, { domain: 'news.acme.com' });
// waitlists
await ts.lists.join(list.id, { email: '[email protected]' });
await ts.lists.invite(list.id, { count: 100 });
// automations, invites, usage, settings
const automations = await ts.automations.list();
const invites = await ts.invites.list();
const usage = await ts.usage.get();
この SDK は API の全機能をカバーしており、リリースのたびにライブの openapi spec と照合して検証されます。
エラー処理
import { Tinysend, TinysendError } from 'tinysend';
try {
await ts.lists.get('nonexistent');
} catch (err) {
if (err instanceof TinysendError) {
console.log(err.status); // 404
console.log(err.code); // 'not_found'
console.log(err.message); // 'list not found'
}
}
設定
const ts = new Tinysend('sk_...', {
baseUrl: 'https://api.tinysend.com/v1', // default
fetch: customFetch, // custom fetch implementation
});
ライセンス
MIT
system operator の製品です
コメント
Markdown 対応
AI アプリケーションが外部のツールやデータソースに統一的な方法で接続するためのオープンなプロトコルです。クライアントはモデルとの対話を担い、MCP サーバーはツール・リソース・プロンプトテンプレートを提供します。標準メッセージでやり取りするため、1 つのサーバーを複数のクライアントで再利用できます。