io.github.sapiom/mcp

平台与服务

by sapiom

Sapiom 的 MCP server,提供 authentication、verification 以及 API 相关工具能力。

什么是 io.github.sapiom/mcp

Sapiom 的 MCP server,提供 authentication、verification 以及 API 相关工具能力。

README

Sapiom SDK

License: MIT TypeScript

⚠️ Beta Status: Currently in v0.x (beta). API may change before v1.0.0. Production-ready and actively maintained.

TypeScript SDK for building AI agents and applications with the Sapiom API. Provides seamless payment handling, authorization flows, and framework integrations.

📦 Packages

This is a monorepo containing multiple focused packages. Install only what you need:

Core Package

PackageVersionDescription
@sapiom/corev0.1.1Core transaction client, handlers, and utilities

HTTP Client Integrations

PackageVersionDescription
@sapiom/axiosv0.1.1Axios HTTP client integration
@sapiom/fetchv0.1.1Native Fetch API integration
@sapiom/node-httpv0.1.2Node.js HTTP/HTTPS integration

Framework Integrations

PackageVersionLangChainDescription
@sapiom/langchainv0.1.1v1.xLangChain v1.x integration (recommended)
@sapiom/langchain-classicv0.1.1v0.3+LangChain v0.x integration (legacy)

Coming Soon

  • @sapiom/mastra - Mastra framework integration
  • @sapiom/langgraph - LangGraph integration
  • @sapiom/openai - OpenAI SDK integration

🚀 Quick Start

New to Sapiom? Check out the examples folder for complete setup instructions and working demos.

For Axios Users

bash
npm install @sapiom/axios axios
typescript
import axios from 'axios';
import { createSapiomClient } from '@sapiom/axios';

const client = createSapiomClient(axios.create({
  baseURL: 'https://api.example.com'
}));

const response = await client.get('/premium-endpoint');

For Fetch Users

bash
npm install @sapiom/fetch
typescript
import { createSapiomFetch } from '@sapiom/fetch';

const fetch = createSapiomFetch();
const response = await fetch('https://api.example.com/data');

For LangChain v1.x Users

bash
npm install @sapiom/langchain langchain
typescript
import { createAgent } from "langchain";
import { createSapiomMiddleware } from "@sapiom/langchain";

const agent = createAgent({
  model: "gpt-4",
  tools: [getWeather, sendEmail],
  middleware: [
    createSapiomMiddleware({
      apiKey: process.env.SAPIOM_API_KEY,
    }),
  ],
});

const result = await agent.invoke({
  messages: [{ role: "user", content: "What's the weather?" }],
});

For LangChain v0.x Users (Legacy)

bash
npm install @sapiom/langchain-classic
typescript
import { createSapiomReactAgent } from '@sapiom/langchain-classic';

const agent = await createSapiomReactAgent(
  { llm: new ChatOpenAI({ model: "gpt-4" }), tools: [...] },
  { apiKey: process.env.SAPIOM_API_KEY }
);

const response = await agent.invoke({ messages: [...] });

For Direct API Access

If you only need the transaction client without HTTP integrations:

bash
npm install @sapiom/core
typescript
import { SapiomClient } from '@sapiom/core';

const client = new SapiomClient({
  apiKey: process.env.SAPIOM_API_KEY
});

const transaction = await client.transactions.create({
  service: 'api',
  action: 'call',
  resource: 'completion'
});

📚 Documentation

🏗️ Package Architecture

code
@sapiom/core              Core transaction API & utilities
    ↑
    ├── @sapiom/axios     Axios integration
    ├── @sapiom/fetch     Fetch integration
    ├── @sapiom/node-http Node HTTP integration
    └── @sapiom/langchain LangChain integration

All integration packages depend on @sapiom/core but are independent of each other.

🔧 Version Compatibility

LangChain Support

PackageLangChain VersionStatus
@sapiom/langchainv1.x✅ Recommended
@sapiom/langchain-classicv0.3+✅ Legacy Support
  • New projects: Use @sapiom/langchain with LangChain v1.x
  • Existing v0.x projects: Use @sapiom/langchain-classic (no changes needed)

🛠️ Development

This is a pnpm workspace monorepo.

Setup

bash
# Install dependencies
pnpm install

# Build all packages
pnpm build

# Run tests
pnpm test

# Lint and format
pnpm lint
pnpm format

Package Scripts

bash
# Build specific package
pnpm --filter @sapiom/core build
pnpm --filter @sapiom/axios build

# Test specific package
pnpm --filter @sapiom/langchain test

# Run in watch mode
pnpm --filter @sapiom/core dev

Publishing

We use Changesets for version management:

bash
# Create a changeset
pnpm changeset

# Version packages
pnpm version-packages

# Publish to npm
pnpm release

🤝 Contributing

Contributions welcome! Please read our Contributing Guide first.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📄 License

MIT © Sapiom

🔗 Links

🌟 Features

  • Modular architecture - Install only what you need
  • Lightweight core - Minimal dependencies and small footprint
  • HTTP client agnostic - Works with Axios, Fetch, Node HTTP
  • Framework integrations - LangChain, Mastra (coming soon)
  • Automatic payment handling - 402 Payment Required flows
  • Pre-emptive authorization - Protect endpoints before access
  • TypeScript native - Full type safety
  • Tree-shakeable - Optimal bundle sizes
  • Node.js 18+ - Native fetch support

🗺️ Roadmap

  • Core transaction API
  • Axios integration
  • Fetch integration
  • Node.js HTTP integration
  • LangChain v0.x integration
  • LangChain v1.x integration (middleware-based)
  • GitHub Actions CI/CD
  • Mastra integration
  • LangGraph integration
  • OpenAI SDK integration
  • Browser support (via bundlers)
  • WebSocket support for streaming

常见问题

io.github.sapiom/mcp 是什么?

Sapiom 的 MCP server,提供 authentication、verification 以及 API 相关工具能力。

相关 Skills

MCP构建

by anthropics

Universal
热门

聚焦高质量 MCP Server 开发,覆盖协议研究、工具设计、错误处理与传输选型,适合用 FastMCP 或 MCP SDK 对接外部 API、封装服务能力。

想让 LLM 稳定调用外部 API,就用 MCP构建:从 Python 到 Node 都有成熟指引,帮你更快做出高质量 MCP 服务器。

平台与服务
未扫描111.8k

Slack动图

by anthropics

Universal
热门

面向Slack的动图制作Skill,内置emoji/消息GIF的尺寸、帧率和色彩约束、校验与优化流程,适合把创意或上传图片快速做成可直接发送的Slack动画。

帮你快速做出适配 Slack 的动图,内置约束规则和校验工具,少踩上传与播放坑,做表情包和演示都更省心。

平台与服务
未扫描111.8k

MCP服务构建器

by alirezarezvani

Universal
热门

从 OpenAPI 一键生成 Python/TypeScript MCP server 脚手架,并校验 tool schema、命名规范与版本兼容性,适合把现有 REST API 快速发布成可生产演进的 MCP 服务。

帮你快速搭建 MCP 服务与后端 API,脚手架完善、扩展顺手,尤其适合想高效验证服务能力的开发者。

平台与服务
未扫描9.8k

相关 MCP Server

Slack 消息

编辑精选

by Anthropic

热门

Slack 是让 AI 助手直接读写你的 Slack 频道和消息的 MCP 服务器。

这个服务器解决了团队协作中需要 AI 实时获取 Slack 信息的痛点,特别适合开发团队让 Claude 帮忙汇总频道讨论或发送通知。不过,它目前只是参考实现,文档有限,不建议在生产环境直接使用——更适合开发者学习 MCP 如何集成第三方服务。

平台与服务
83.1k

by netdata

热门

io.github.netdata/mcp-server 是让 AI 助手实时监控服务器指标和日志的 MCP 服务器。

这个工具解决了运维人员需要手动检查系统状态的痛点,最适合 DevOps 团队让 Claude 自动分析性能数据。不过,它依赖 NetData 的现有部署,如果你没用过这个监控平台,得先花时间配置。

平台与服务
78.3k

by d4vinci

热门

Scrapling MCP Server 是专为现代网页设计的智能爬虫工具,支持绕过 Cloudflare 等反爬机制。

这个工具解决了爬取动态网页和反爬网站时的头疼问题,特别适合需要批量采集电商价格或新闻数据的开发者。不过,它依赖外部浏览器引擎,资源消耗较大,不适合轻量级任务。

平台与服务
34.9k

评论