Agentify

io.github.sani-savaliya由 GitHub 账号 sani-savaliya 发布v0.1.1更新于 Oct 25, 2026

Turn any OpenAPI/Swagger spec into an MCP server - every API operation becomes an agent tool.

已验证STDIO仅桌面开发者工具AI 与机器学习

概览

AI 生成的概览

Agentify 把任意 OpenAPI 或 Swagger 规范转成本地 MCP 服务器,让每个 API 操作都成为助手可调用的工具。

可以做什么
从 URL 或本地文件加载 OpenAPI 3.x 或 Swagger 2.0 规范,把发现的每个 API 操作列为一个工具,无需写代码或自行托管。调用这些工具可构造并发送真实 HTTP 请求,支持路径、查询、请求头和 JSON 请求体参数,并返回响应状态与内容。可按标签、HTTP 方法、名称通配符或工具数量上限筛选暴露的工具,并可限制为只读方法。通过环境变量提供 bearer、basic 或 API key 认证凭据,也可在命令行注入原始请求头。
适用场景
当你想让助手使用的 API 已发布 OpenAPI 或 Swagger 文档,且希望无需手写集成即可调用其操作时使用。适合规范很大、只需筛选出少数相关端点的场景,以及对 API 的只读探索。
运行要求
通过 npx 从 npm 包 agentify-openapi 以 stdio 在本地运行,需要 Node.js。需要规范 URL 或文件路径,以及访问目标 API 的网络。可选凭据通过 AGENTIFY_BEARER_TOKEN、AGENTIFY_BASIC_USER 与 AGENTIFY_BASIC_PASS,或 AGENTIFY_API_KEY 配合 AGENTIFY_API_KEY_HEADER 或 AGENTIFY_API_KEY_QUERY 提供。
安装前请注意
工具会向上游 API 发送真实 HTTP 请求,非只读操作可能创建、修改或删除数据,建议用只读选项限制暴露范围。凭据通过 AGENTIFY_BEARER_TOKEN、AGENTIFY_BASIC_PASS、AGENTIFY_API_KEY 等环境变量传递,还可注入原始请求头,请勿放入共享配置。不支持 cookie 参数和 OAuth2 流程,multipart 或表单请求体仅尽力处理。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Agentify,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

agentify

Turn any OpenAPI / Swagger spec into an agent-ready MCP server.

[npm] Listed on the official MCP Registry (io.github.sani-savaliya/agentify) and Smithery.

Point it at a spec — a URL, a file, OpenAPI 3.x or Swagger 2.0 — and every operation becomes a tool an AI agent can call. No code generation, no per-API boilerplate, no hosting. One command.

bash
npx agentify-openapi https://petstore3.swagger.io/api/v3/openapi.json --list
Swagger Petstore - OpenAPI 3.0 v1.0.27Base URL: https://petstore3.swagger.io/api/v3Tools: 19
  getPetById    Find pet by ID.  findPetsByStatus    Finds Pets by status.  ...

Why

"Today, agents have to operate software designed for humans. The interfaces of the future will be built for agents — APIs, MCPs, CLIs — with agents as first-class citizens." — YC RFS: Software for Agents

There are tens of thousands of APIs that already describe themselves with an OpenAPI document. agentify makes every one of them agent-native, instantly, without anyone hand-writing an integration.

Use it with Claude, Cursor, Windsurf — any MCP client

Add it to your client's MCP config. The same command/args shape works in Claude Desktop, Claude Code (claude mcp add), Cursor (.cursor/mcp.json), Windsurf, Cline, and anything else that speaks MCP:

json
{  "mcpServers": {    "petstore": {      "command": "npx",      "args": ["-y", "agentify-openapi", "https://petstore3.swagger.io/api/v3/openapi.json"]    }  }}

The agent now has one tool per API operation. Calling a tool builds the HTTP request (path params, query string, headers, JSON body) and returns the live response.

Big API? Pick just the tools you need

Pointing at GitHub (1000+ operations) or Stripe (400+) would flood your agent with hundreds of tools and wreck its tool-selection accuracy. Filter down to what matters — by tag, HTTP method, or name glob — and cap the total:

bash
# GitHub, read-only, just the repo endpointsnpx agentify-openapi https://api.github.com/openapi.json --tag repos --read-only
# Stripe customer endpoints only, hard cap at 25 toolsnpx agentify-openapi ./stripe.json --include "*Customer*" --max-tools 25
json
{  "mcpServers": {    "github-repos": {      "command": "npx",      "args": ["-y", "agentify-openapi", "https://api.github.com/openapi.json",               "--tag", "repos", "--read-only", "--max-tools", "30"],      "env": { "AGENTIFY_BEARER_TOKEN": "ghp_your_token" }    }  }}

--read-only (GET/HEAD/OPTIONS) is also a simple safety rail — expose a giant API to an agent without exposing anything that can mutate state.

Auth

Provide credentials via environment variables — agentify reads the spec's declared security scheme to find the right header name when it can:

VariableEffect
AGENTIFY_BEARER_TOKENAuthorization: Bearer <token>
AGENTIFY_BASIC_USER / AGENTIFY_BASIC_PASSHTTP basic auth
AGENTIFY_API_KEYAPI key (sent as a header by default)
AGENTIFY_API_KEY_HEADEROverride the api-key header name
AGENTIFY_API_KEY_QUERYSend the api key as a query param instead

You can also inject raw headers from the CLI: --header "X-Org-Id: 42" (repeatable).

CLI

agentify <spec-url-or-file> [options]
  --base-url <url>     Override the API base URL from the spec  --header "K: V"      Add a raw header to every request (repeatable)  --name <name>        Override the MCP server name  --list               Print the discovered tools and exit (no server)  -h, --help           Show help
  Tool selection (keep big APIs from flooding the agent's context):  --tag <tag>          Keep only operations with this tag (repeatable)  --exclude-tag <tag>  Drop operations with this tag (repeatable)  --method <verb>      Keep only this HTTP method, e.g. GET (repeatable)  --read-only          Shorthand: keep only GET/HEAD/OPTIONS operations  --include <glob>     Keep only tools matching this glob (repeatable)  --exclude <glob>     Drop tools matching this glob (repeatable)  --max-tools <n>      Hard cap on tool count (warns when it truncates)

How it works

A small, pure pipeline — each stage is independently unit-tested:

spec ──▶ operations ──▶ tool defs ──▶ http request ──▶ response │           │              │              │              │load &    one tool       JSON Schema   path/query/    fetch + surfacederef     per op         for inputs    header/body    status & body$refs                                  + auth

Only the HTTP execution and MCP transport touch the outside world; everything else is deterministic and tested.

Programmatic use

ts
import { loadSpec, extractOperations, resolveBaseUrl, createServer } from "agentify-openapi";
const spec = await loadSpec("./openapi.yaml");const tools = extractOperations(spec);const baseUrl = resolveBaseUrl(spec);// ...build your own MCP server, or just inspect the generated tool defs

Limitations

  • JSON request/response bodies are first-class; multipart/form bodies are passed through best-effort.
  • cookie parameters and OAuth2 flows are not yet handled (use --header for now).
  • One server per spec. Multi-spec aggregation is on the roadmap.

Development

bash
npm installnpm test          # vitest, 80%+ coverage enforcednpm run build     # tsc -> dist/node scripts/smoke.mjs   # end-to-end MCP client smoke test (network)

License

MIT

来源:README.md,提交 2adbbdf

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v0.1.1最新Sep 16, 2026

评分

已满足适用检查项的 40%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分

    请在仓库或注册中心条目中声明许可证。