mcpField
T
tinysend

tinysend

远程服务
tinysend.com开发工具018 周前更新

关于 tinysend

tinysend 是 tinysend API 的官方 TypeScript SDK,适用于需要处理邮件和新闻简报数据的应用与 Agent。它基于 fetch、无依赖,并覆盖完整 API。

主要功能

  1. 01管理邮件列表
  2. 02创建和读取列表
  3. 03通过 fetch 调用 API
  4. 04零运行时依赖
  5. 05支持自定义基础 URL 和 fetch

适用场景

  1. 01在 TypeScript 代码中调用 tinysend API
  2. 02通过 SDK 管理列表
  3. 03配置自定义 fetch 实现

配置

远程服务无需本地安装。选择你使用的客户端,复制配置或使用一键安装。

服务地址https://mcp.tinysend.com
一键复制安装命令
Claude CodeTerminal
Cursor.cursor/mcp.json
VS Code.vscode/mcp.json
Claude Desktopclaude_desktop_config.json
Windsurf~/.codeium/windsurf/mcp_config.json

命令在终端中运行;JSON 粘贴到对应客户端的 MCP 配置后重启。需要授权的服务会在首次连接时提示登录。

工具

详细介绍

tinysend

适用于 tinysend API 的官方 TypeScript SDK。零依赖,基于 fetch — 可在 Node.js、Bun、Deno、Cloudflare Workers 和浏览器中使用。

订阅者

安装

npm install tinysend

获取令牌

每次调用都需要一个 bearer 令牌(sk_...)。

用法

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 规范进行验证。

错误处理

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

第一次接触 MCP?

从协议是什么,到在客户端里装上第一个服务,这几条回答覆盖了大多数入门问题。

一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。