Token导航 LogoToken导航TokenDH.com
toolcast (Djsand) logo
运维云端stdio官方级别未说明来源级核验

toolcast (Djsand)

MCP Server

toolcast

toolcast是一个将任何OpenAPI规范转换为AI代理工具的解决方案,通过简单命令即可创建MCP服务器,支持多种API调用。

工具数

7

提示词数

0

GitHub Stars

5

资源数

0
API代理TypeScriptClaudeAI工具集成ClaudeCursor

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

Djsand

提供方

Djsand

最后核验

2026/5/17 20:20

运行时

Node.js

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

npx toolcast serve https://petstore3.swagger.io/api/v3/openapi.json

详细介绍

toolcast

Turn any API into an AI agent tool. One command.

Point at an OpenAPI spec. Get a working MCP server in 10 seconds.

Your AI agent can now call Stripe, GitHub, Slack, Notion — or any API with a spec.

Quick Start • Registry • How It Works • Examples • Contributing

______________________________________________________________________

问题

您希望您的人工智能代理调用API。今天你必须:

  1. 为特定的API查找或构建MCP服务器
  2. 编写工具定义、参数模式、身份验证处理
  3. 测试、调试、部署
  4. 对每个新的API重复

toolcast在一个命令中完成所有这些。

快速开始

# Try it right now with the demo Petstore API (no auth needed)
npx toolcast serve https://petstore3.swagger.io/api/v3/openapi.json

就是这样。你的人工智能代理现在有19个工具来管理宠物、订单和用户。

添加一个真正的API

# Add Stripe to your Claude Code config
npx toolcast add stripe

# Or point at any OpenAPI spec
npx toolcast serve https://api.example.com/openapi.json --bearer-token $MY_TOKEN

上菜前检查

# See what tools would be generated
npx toolcast inspect https://petstore3.swagger.io/api/v3/openapi.json
  Swagger Petstore v1.0.27

  19 Tools:

  addPet                    POST    /pet              (1 params)
  updatePet                 PUT     /pet              (1 params)
  findPetsByStatus          GET     /pet/findByStatus (1 params)
  getPetById                GET     /pet/{petId}      (1 params)
  getInventory              GET     /store/inventory  (0 params)
  placeOrder                POST    /store/order      (1 params)
  createUser                POST    /user             (1 params)
  ...

注册表

toolcast附带了流行API的预构建配置。添加它们的一个命令:

API命令获得的内容
GitHubtoolcast add githubrepo、问题、PR、操作、用户
条纹toolcast add stripe付款、订阅、发票
Slacktoolcast add slack消息、渠道、用户、反应
概念toolcast add notion页面、数据库、块、搜索
线性toolcast add linear问题、项目、团队、周期
OpenAItoolcast add openai完成、嵌入、图像
宠物店toolcast add petstore用于测试的演示API
# List all available APIs
toolcast list

# Search by keyword
toolcast search payments

想要添加API吗?贡献.

运作原理

                    +-----------------+
  OpenAPI Spec ---> |     toolcast      | ---> MCP Server (stdio)
  (URL or file)     |                 |      ready for Claude Code,
                    | 1. Parse spec   |      Cursor, or any MCP client
                    | 2. Build tools  |
                    | 3. Handle auth  |
                    +-----------------+
  1. 解析 --读取任何OpenAPI 3.0/3.1规范(JSON或YAML、URL或文件)。解决 $refs、 提取端点、参数和身份验证方案。
  1. 构建工具 -每个API端点都成为一个MCP工具,具有:

- 人类可读的名称(来自 operationId) - 清晰的描述(来自 summary + description) - 类型化的输入模式(来自参数+请求体) - 正确的参数处理(路径、查询、标头、正文)

  1. 服务 -启动一个stdio MCP服务器,该服务器使用正确的身份验证、头和错误格式将工具调用代理到真正的API。

例子

与Claude Code一起使用

添加到您的 .mcp.json:

{
  "mcpServers": {
    "my-api": {
      "command": "npx",
      "args": ["toolcast", "serve", "https://api.example.com/openapi.json"],
      "env": {
        "API_TOKEN": "your-token-here"
      }
    }
  }
}

或者使用 add 自动配置命令:

toolcast add github
# Adds to .mcp.json automatically

与本地规范文件一起使用

toolcast serve ./my-api-spec.yaml --base-url https://localhost:3000

以编程方式使用

import { parseSpec, createMcpServer } from "toolcast";

const spec = await parseSpec("https://api.example.com/openapi.json");
const server = createMcpServer(spec, {
  baseUrl: "https://api.example.com",
  auth: { type: "bearer", value: process.env.API_TOKEN },
});

认证

toolcast支持三种身份验证方法,可从OpenAPI规范中自动检测:

方法环境变量标志
持有者令牌API_TOKEN, BEARER_TOKEN, AUTH_TOKEN--bearer-token
API密钥API_KEY,或源自方案名称--api-key
基本认证API_USER + API_PASSWORD

注册表项指定要使用哪个env变量(例如。, GITHUB_TOKEN GitHub)。

CLI参考

toolcast serve        Start MCP server from OpenAPI spec
  --base-url         Override base URL
  --api-key          API key auth
  --bearer-token   Bearer token auth

toolcast inspect      Preview tools without starting server

toolcast add          Add registry API to .mcp.json
  --config 
         Config file path (default: .mcp.json)

toolcast list               List all registry APIs
toolcast search      Search registry
toolcast --version          Show version
toolcast --help             Show help

贡献

将API添加到注册表

  1. 在中创建一个YAML文件 registry/:
name: my-api
displayName: My API
description: What this API does
specUrl: https://example.com/openapi.json
baseUrl: https://api.example.com
authType: bearer
authEnvVar: MY_API_KEY
tags:
  - category
  - keywords
  1. 提交PR。就是这样。

发展

git clone https://github.com/your-username/toolcast.git
cd toolcast
npm install
npm run build
npm test

# Test locally
node dist/cli.js inspect https://petstore3.swagger.io/api/v3/openapi.json

许可证

麻省理工学院

目录标签

目录标签

API代理TypeScriptClaudeAI工具集成本地部署OpenAPI转换MCP服务器

支持客户端

ClaudeCursor

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

api-key

运行时(runtime,运行环境)

Node.js

来源包(packageName,安装包名)

toolcast

工具数量(toolCount,工具数)

7

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdioapi-key部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP