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
⚠️ 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
| Package | Version | Description |
|---|---|---|
| @sapiom/core | v0.1.1 | Core transaction client, handlers, and utilities |
HTTP Client Integrations
| Package | Version | Description |
|---|---|---|
| @sapiom/axios | v0.1.1 | Axios HTTP client integration |
| @sapiom/fetch | v0.1.1 | Native Fetch API integration |
| @sapiom/node-http | v0.1.2 | Node.js HTTP/HTTPS integration |
Framework Integrations
| Package | Version | LangChain | Description |
|---|---|---|---|
| @sapiom/langchain | v0.1.1 | v1.x | LangChain v1.x integration (recommended) |
| @sapiom/langchain-classic | v0.1.1 | v0.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
npm install @sapiom/axios axios
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
npm install @sapiom/fetch
import { createSapiomFetch } from '@sapiom/fetch';
const fetch = createSapiomFetch();
const response = await fetch('https://api.example.com/data');
For LangChain v1.x Users
npm install @sapiom/langchain langchain
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)
npm install @sapiom/langchain-classic
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:
npm install @sapiom/core
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
- Examples - Getting started with working examples
- @sapiom/core - Core SDK documentation
- @sapiom/axios - Axios integration guide
- @sapiom/fetch - Fetch integration guide
- @sapiom/node-http - Node.js HTTP integration guide
- @sapiom/langchain - LangChain integration guide
🏗️ Package Architecture
@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
| Package | LangChain Version | Status |
|---|---|---|
@sapiom/langchain | v1.x | ✅ Recommended |
@sapiom/langchain-classic | v0.3+ | ✅ Legacy Support |
- New projects: Use
@sapiom/langchainwith LangChain v1.x - Existing v0.x projects: Use
@sapiom/langchain-classic(no changes needed)
🛠️ Development
This is a pnpm workspace monorepo.
Setup
# Install dependencies
pnpm install
# Build all packages
pnpm build
# Run tests
pnpm test
# Lint and format
pnpm lint
pnpm format
Package Scripts
# 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:
# Create a changeset
pnpm changeset
# Version packages
pnpm version-packages
# Publish to npm
pnpm release
🤝 Contributing
Contributions welcome! Please read our Contributing Guide first.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - 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
聚焦高质量 MCP Server 开发,覆盖协议研究、工具设计、错误处理与传输选型,适合用 FastMCP 或 MCP SDK 对接外部 API、封装服务能力。
✎ 想让 LLM 稳定调用外部 API,就用 MCP构建:从 Python 到 Node 都有成熟指引,帮你更快做出高质量 MCP 服务器。
Slack动图
by anthropics
面向Slack的动图制作Skill,内置emoji/消息GIF的尺寸、帧率和色彩约束、校验与优化流程,适合把创意或上传图片快速做成可直接发送的Slack动画。
✎ 帮你快速做出适配 Slack 的动图,内置约束规则和校验工具,少踩上传与播放坑,做表情包和演示都更省心。
MCP服务构建器
by alirezarezvani
从 OpenAPI 一键生成 Python/TypeScript MCP server 脚手架,并校验 tool schema、命名规范与版本兼容性,适合把现有 REST API 快速发布成可生产演进的 MCP 服务。
✎ 帮你快速搭建 MCP 服务与后端 API,脚手架完善、扩展顺手,尤其适合想高效验证服务能力的开发者。
相关 MCP Server
Slack 消息
编辑精选by Anthropic
Slack 是让 AI 助手直接读写你的 Slack 频道和消息的 MCP 服务器。
✎ 这个服务器解决了团队协作中需要 AI 实时获取 Slack 信息的痛点,特别适合开发团队让 Claude 帮忙汇总频道讨论或发送通知。不过,它目前只是参考实现,文档有限,不建议在生产环境直接使用——更适合开发者学习 MCP 如何集成第三方服务。
by netdata
io.github.netdata/mcp-server 是让 AI 助手实时监控服务器指标和日志的 MCP 服务器。
✎ 这个工具解决了运维人员需要手动检查系统状态的痛点,最适合 DevOps 团队让 Claude 自动分析性能数据。不过,它依赖 NetData 的现有部署,如果你没用过这个监控平台,得先花时间配置。
by d4vinci
Scrapling MCP Server 是专为现代网页设计的智能爬虫工具,支持绕过 Cloudflare 等反爬机制。
✎ 这个工具解决了爬取动态网页和反爬网站时的头疼问题,特别适合需要批量采集电商价格或新闻数据的开发者。不过,它依赖外部浏览器引擎,资源消耗较大,不适合轻量级任务。