Skip to content

Lay4U/tabapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ” TabAPI

Record browser sessions β†’ Auto-discover hidden APIs β†’ Export TypeScript SDK + OpenAPI + MCP Server

npm version License: MIT Stars TypeScript

Stop reverse-engineering APIs by hand. Just use the app β€” TabAPI figures out the rest.


TabAPI watches real browser traffic while you click through a web app, then turns that traffic into clean, reusable API artifacts.

No devtools archaeology. No guessing endpoints. No manually rebuilding payload shapes from minified frontend code.

Use TabAPI when you need to:

  • Build integrations against undocumented/private APIs
  • Generate an internal SDK from behavior, not docs
  • Add contract checks in CI for API drift
  • Give AI agents safe, structured API access via MCP

Demo

1) Record a live browser session

tabapi record https://app.example.com
βœ” Browser launched (Playwright)
βœ” Capturing network traffic + metadata
βœ” Session recorded: 2026-03-01_abc123
βœ” Saved: .tabapi/sessions/2026-03-01_abc123/session.json

2) Analyze captured traffic

tabapi analyze
βœ” Normalized requests/responses
βœ” Inferred endpoint groups
βœ” Inferred auth patterns + schema candidates
βœ” Saved models to .tabapi/sessions/<session-id>/models

3) Export production-ready artifacts

tabapi export --sdk ts --openapi --mcp --tests
βœ” OpenAPI 3.0 spec generated
βœ” TypeScript SDK generated
βœ” MCP server config generated
βœ” Replay tests generated
βœ” Output written to ./generated

4) Run MCP server for AI tools

tabapi mcp serve
βœ” Loaded discovered API tools
βœ” MCP server running on :3333
βœ” Ready for Cursor / Claude Desktop / custom agents

Alpha note: current CLI requires session-id for analyze, export, replay, and mcp serve. Example: tabapi analyze <session-id>.

Features

  • βœ… πŸŽ₯ Record any web app via real browser automation (Playwright)
  • βœ… πŸ” Auto-discover API endpoints from live network traffic
  • βœ… πŸ“ Infer request and response schemas from real payloads
  • βœ… πŸ” Auto-redact tokens, cookies, and API keys (local-first processing)
  • βœ… πŸ“¦ Export TypeScript SDK, OpenAPI 3.0, MCP server config, and tests
  • βœ… πŸ”„ Replay and diff behavior to detect breaking API changes in CI
  • βœ… πŸ€– MCP-ready API tooling for AI agents and assistants

Quick Start

npx tabapi record https://app.example.com

Then run:

# Use the session id printed by the record command
tabapi analyze <session-id>
tabapi export <session-id> --all
tabapi replay <session-id> --report summary
tabapi mcp serve <session-id> --port 3333

Installation

Option A: Run with npx (no global install)

npx tabapi --help

Option B: Global install

npm install -g tabapi

Option C: Local project install

npm install --save-dev tabapi

Requirements

  • Node.js 20+
  • npm 10+
  • Network access to target web app
  • Permission to test/inspect the target application

Usage

CLI overview

tabapi --help

record command

tabapi record <url> [--headless] [--output .tabapi] [--timeout 120]
  • Opens a real browser and captures request/response activity
  • Stores session data at .tabapi/sessions/<session-id>/session.json

analyze command

tabapi analyze <session-id> [--session-dir .tabapi/sessions]
  • Normalizes captured traffic
  • Clusters requests into endpoint groups
  • Writes inferred models under models/endpoint-groups.json

export command

tabapi export <session-id> [--openapi] [--sdk ts] [--mcp] [--tests] [--all] [--output ./generated] [--allow-secrets]
  • Generates artifacts from inferred models
  • Use --all for full output in one command
  • Keep --allow-secrets off unless absolutely required

replay command

tabapi replay <session-id> [--report summary|json]
  • Replays inferred endpoints
  • Returns pass/fail/changed summary for drift detection

mcp serve command

tabapi mcp serve <session-id> [--port 3333]
  • Starts MCP server based on exported session artifacts
  • Exposes discovered APIs as structured tools for agents

How It Works

graph LR
  A[🌐 Browse Web App] --> B[πŸ“‘ Capture Traffic]
  B --> C[πŸ” Infer Endpoints]
  C --> D[πŸ“¦ Export SDK/OpenAPI/MCP]
  D --> E[πŸ€– AI Agent / CI / Code]
Loading

Pipeline stages:

  1. record: capture raw traffic, headers, timing, and navigation context
  2. analyze: normalize noise, detect endpoint patterns, infer schemas
  3. export: generate typed artifacts for developers, CI, and AI runtimes
  4. replay: compare behavior over time and surface drift

Export Formats

Format Output Why it matters
TypeScript SDK generated/sdk/ Typed client for app and backend integrations
OpenAPI 3.0 generated/openapi/openapi.yaml Standard contract for docs, mocks, and tooling
MCP Server Config generated/mcp/ Agent-compatible tools from discovered endpoints
Replay Tests generated/tests/ CI guardrails for API regressions

MCP Integration

TabAPI can expose discovered APIs as MCP tools so AI assistants can execute validated API calls instead of hallucinating request formats.

Cursor

  1. Generate MCP artifacts with tabapi export <session-id> --mcp
  2. Start server using tabapi mcp serve <session-id>
  3. Add local MCP server entry in Cursor settings

Claude Desktop

  1. Export MCP artifacts
  2. Run local MCP server
  3. Register the server in Claude Desktop MCP configuration

Custom agents

Use any MCP-compatible runtime and point it to the local TabAPI MCP endpoint.

Security & Privacy

TabAPI is designed local-first by default:

  • Data stays on your machine unless you explicitly move it
  • Sensitive headers and tokens are redacted in normalized artifacts
  • Secrets can be excluded from exported outputs
  • You control which sessions are recorded and retained

Recommended practices:

  • Use dedicated test accounts while recording
  • Avoid recording personal or production-sensitive activity
  • Review artifacts before sharing in repos or tickets
  • Run CI replay checks against controlled environments

CI/CD Workflow Example

# baseline capture
tabapi record https://staging.example.com
tabapi analyze <session-id>
tabapi export <session-id> --openapi --tests

# in CI
tabapi replay <session-id> --report json

Use replay summaries to fail builds on unexpected API contract drift.

Roadmap

  • Smarter latest-session auto-resolution for all commands
  • More SDK targets (Python, Go)
  • Improved auth flow modeling
  • Snapshot minimization for cleaner diffs
  • GitHub Action for nightly drift reports

Contributing

PRs are welcome. Check CONTRIBUTING.md for setup and workflow.

Good issues to start with:

  • Endpoint inference edge cases
  • Exporter quality improvements
  • Replay stability and reporting
  • MCP ergonomics and tool metadata

License

Released under the MIT License. See LICENSE.

Support The Project

If TabAPI saves you hours of reverse-engineering:

  • Star the repo
  • Share it with your team
  • Open issues with real-world API edge cases
  • Contribute improvements

⭐ Star TabAPI to help more developers stop reverse-engineering APIs by hand.

Releases

No releases published

Packages

 
 
 

Contributors