NA

n1byn1kt/apitap

浏览器自动化

本页由 AI 翻译,技术细节请以原文为准。 查看原文

131 stars 10 forks 质量 84 趋势 8Apache-2.0

n1byn1kt/apitap 是从 https://github.com/n1byn1kt/apitap. 导入的 MCP 服务器候选

概览

n1byn1kt/apitap 是从 https://github.com/n1byn1kt/apitap. 导入的 MCP 服务器候选

概述(AI 翻译)

CLI、MCP服务器和npm库,将任何网站变成API——无需文档,无需SDK,无需浏览器。

ApiTap 是一个 CLI、MCP 服务器和 npm 库,允许 AI 代理(包括你)通过 API 而非浏览器浏览网页。指向一个网站:它从真实流量中捕获内部 API,生成一个可移植的签名 **skill 文件,并直接用 fetch() 重放请求。凭据永远不存在文件中——它们保持在加密存储中,重放时注入——重放会与捕获的路由形状匹配,因此你的代理在任务失败前就知道端点漂移了。没有 DOM,没有选择器,没有不稳定的等待。令牌成本相比浏览器自动化降低了 20-100 倍。发布 OpenAPI 规范的网站可以通过 apitap import(APIs.guru 目录内置)完全跳过捕获。

网络是为人眼打造的;ApiTap让它原生于机器。

不做抓取。不使用浏览器。只有 API。


工作原理

ApiTap 有三种方式来构建其 API 知识:

  1. 捕获(30秒)——启动浏览器,访问网站,正常浏览。ApiTap 通过 CDP 拦截所有网络流量,过滤噪声,并生成技能文件。

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

ApiTap

The CLI, MCP server, and npm library that turns any website into an API — no docs, no SDK, no browser.

ApiTap is a CLI, MCP server, and npm library that lets AI agents (and you) browse the web through APIs instead of browsers. Point it at a site: it captures the internal API from real traffic, generates a portable signed skill file, and replays requests directly with fetch(). Credentials never live in the file — they stay in encrypted storage and are injected at replay — and replays are matched against the captured route shapes, so your agent learns an endpoint drifted before it fails mid-task. No DOM, no selectors, no flaky waits. Token costs drop 20-100x compared to browser automation. Sites that publish OpenAPI specs can skip capture entirely via apitap import (APIs.guru directory built in).

The web was built for human eyes; ApiTap makes it native to machines.

# Capture a site's private API once…
apitap capture https://polymarket.com

# …then replay it forever — no browser in this path
apitap replay gamma-api.polymarket.com get-events

# Read page content without a browser
apitap read https://en.wikipedia.org/wiki/Node.js
  ✓ Wikipedia decoder: ~127 tokens (vs ~4,900 raw HTML)

# Or import published OpenAPI specs directly
apitap import --from apis-guru --search stripe
apitap replay api.stripe.com get-listcharges limit=5

No scraping. No browser. Just the API.


How It Works

ApiTap has three ways to build its API knowledge:

  1. Capture (30 seconds) — Launch a browser, visit a site, browse normally. ApiTap intercepts all network traffic via CDP, filters noise, and generates a skill file. Or use apitap attach to capture from your already-running Chrome.
  2. Discover (automatic) — ApiTap auto-detects frameworks (WordPress, Next.js, Shopify) and probes for OpenAPI specs at common paths. Works without a browser.
  3. Import (instant) — Import OpenAPI/Swagger specs from the APIs.guru directory of 2,500+ public APIs, or from any spec URL/file. Endpoints get a confidence score based on spec quality. No browser needed.

All three paths produce the same artifact: a skill file — a portable JSON map of an API’s endpoints, stored at ~/.apitap/skills/.

Import:   OpenAPI spec → Converter → Merge → skill.json (confidence 0.6-0.85)
Capture:  Browser → CDP listener → Filter → Skill Generator → skill.json (confidence 1.0)
Attach:   Running Chrome → CDP attach → Filter → skill.json (confidence 0.8-1.0)
Replay:   Agent → Replay Engine (skill.json) → fetch() → API → JSON response
在 GitHub 查看完整 README

安装

npx apitap mcp
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "apitap": { "command": "apitap", "args": ["mcp"] } } }