bayxa-mcp-server

v1.1.0
io.github.vhnamgau/bayxa-mcp-server Checked 2 days ago Published 1 day ago

Official MCP server for Bayxa AI: web reader, live search, screenshots/PDFs, and llms.txt audits.

bayxa-mcp-server is a Model Context Protocol server that wraps the four Bayxa AI APIs as first-class tools for Claude Desktop, Cursor, Cline, Roo Code and any other MCP-compatible client. It runs locally over stdio, talks to the Bayxa APIs through API.market (default) or RapidAPI, and is published on npm — no clone, no build step, no dependencies on your machine. Add it to any MCP client with a single free API key from api.market/store/bayxa:

Summary extracted from the README.

Bayxa MCP Server

npm version License: MIT Node.js >= 18

Give any AI agent clean web pages, AI-readiness audits, live search and screenshots — in one npx command.

bayxa-mcp-server is a Model Context Protocol server that wraps the four Bayxa AI APIs as first-class tools for Claude Desktop, Cursor, Cline, Roo Code and any other MCP-compatible client.

It runs locally over stdio, talks to the Bayxa APIs through API.market (default) or RapidAPI, and is published on npm — no clone, no build step, no dependencies on your machine.

npx -y bayxa-mcp-server

Add it to any MCP client with a single free API key from api.market/store/bayxa:

{
  "mcpServers": {
    "bayxa": {
      "command": "npx",
      "args": ["-y", "bayxa-mcp-server"],
      "env": {
        "BAYXA_API_KEY": "your-api-market-key",
        "BAYXA_PROVIDER": "apimarket"
      }
    }
  }
}

Why use it

  • One key, four APIs. A single free API key unlocks scraping, AI-readiness auditing, search and rendering.
  • LLM-ready output. Every tool returns clean JSON/text designed to be pasted straight into a context window.
  • Config-driven. Each API is one declarative entry in the TOOLS array, so extending the server takes a single object.
  • Zero-install. Runs via npx; the client config is just a few JSON lines.

The four tools

Tool What it does Best for
bayxa_web_reader Fetches any URL and returns clean Markdown, HTML, text, links, images or a screenshot. Smart hybrid routing (fast HTTP first, Chromium fallback for JS-heavy / anti-bot pages). Optional LLM extraction with a JSON Schema. Reading docs, articles, product pages; structured data extraction.
bayxa_ai_auditor Audits a page's AI readiness: robots.txt AI-crawler access, /llms.txt presence & quality, content extractability, metadata, JSON-LD/OpenGraph, semantics. Returns a 0–100 score, A–F grade, per-check details and prioritized fixes. GEO/AEO audits, "why can't the AI read my site?", llms.txt QA.
bayxa_web_search Live web or news search via a self-hosted SearXNG engine. Returns titles, URLs, snippets and a ready-to-paste llm_context. Set scrape_top_n to fetch and attach the top pages' full Markdown. Fresh facts, citations, RAG grounding, market/news monitoring.
bayxa_screenshot Captures a page as PNG / JPEG / WebP (full-page or single element) or renders a URL / raw HTML into a print-ready PDF. Desktop/mobile, dark mode, ad blocking, cookie-banner hiding and pre-capture actions. Visual regression, thumbnails, invoices, PDF reports, social cards.

Example prompts once installed

  • "Read https://example.com and summarize the main article."
  • "Audit https://example.com for AI readiness and list the top three fixes."
  • "Search the news for 'AI regulation' this week and ground the top 2 results."
  • "Take a full-page screenshot of https://example.com and save it to ./shot.png."
  • "Render this HTML invoice to a PDF and give me the file path."

Install

1. Get a free API key

Create a free account and subscribe to the Bayxa product(s) you need:

Free plans are metered at roughly 1 request/second, which is plenty for agent use.

2. Add the server to your MCP client

The server starts with npx -y bayxa-mcp-server. The only required setting is BAYXA_API_KEY.

Claude Desktop

Edit claude_desktop_config.json:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "bayxa": {
      "command": "npx",
      "args": ["-y", "bayxa-mcp-server"],
      "env": {
        "BAYXA_API_KEY": "your-api-market-key",
        "BAYXA_PROVIDER": "apimarket"
      }
    }
  }
}

Cursor

Create .cursor/mcp.json in your project (or edit the global ~/.cursor/mcp.json):

{
  "mcpServers": {
    "bayxa": {
      "command": "npx",
      "args": ["-y", "bayxa-mcp-server"],
      "env": {
        "BAYXA_API_KEY": "your-api-market-key",
        "BAYXA_PROVIDER": "apimarket"
      }
    }
  }
}

Cline

Open Cline → MCP Servers → Configure MCP Servers and add:

{
  "mcpServers": {
    "bayxa": {
      "command": "npx",
      "args": ["-y", "bayxa-mcp-server"],
      "env": {
        "BAYXA_API_KEY": "your-api-market-key",
        "BAYXA_PROVIDER": "apimarket"
      },
      "disabled": false,
      "autoApprove": ["bayxa_web_reader", "bayxa_ai_auditor", "bayxa_web_search"]
    }
  }
}

Roo Code

Open Roo Code → MCP Servers → Edit MCP Settings (or edit .roo/mcp.json) and add:

{
  "mcpServers": {
    "bayxa": {
      "command": "npx",
      "args": ["-y", "bayxa-mcp-server"],
      "env": {
        "BAYXA_API_KEY": "your-api-market-key",
        "BAYXA_PROVIDER": "apimarket"
      }
    }
  }
}

Tip: on some Windows setups npx needs cmd /c: set "command": "cmd" and "args": ["/c", "npx", "-y", "bayxa-mcp-server"].


Configuration

Variable Required Default Description
BAYXA_API_KEY yes — Your API.market or RapidAPI key.
BAYXA_PROVIDER no apimarket apimarket or rapidapi.
BAYXA_RAPIDAPI_HOST RapidAPI only bayxa.p.rapidapi.com Host shown on the RapidAPI Hub page.
BAYXA_RAPIDAPI_BASE_URL no https://<host> Full base URL override for RapidAPI.
BAYXA_APIMARKET_BASE_URL no https://prod.api.market/api/v1/bayxa API.market base URL override.
BAYXA_API_KEY_HEADER no x-api-market-key Header used to send the API.market key (legacy alias x-magicapi-key also works).
BAYXA_TIMEOUT_MS no 180000 Per-request timeout in milliseconds.

Using RapidAPI

{
  "mcpServers": {
    "bayxa": {
      "command": "npx",
      "args": ["-y", "bayxa-mcp-server"],
      "env": {
        "BAYXA_API_KEY": "your-rapidapi-key",
        "BAYXA_PROVIDER": "rapidapi",
        "BAYXA_RAPIDAPI_HOST": "bayxa.p.rapidapi.com"
      }
    }
  }
}

The server sends x-rapidapi-key and x-rapidapi-host automatically when BAYXA_PROVIDER=rapidapi.


Endpoint reference

All calls are POST with a JSON body. Product routing mirrors the public Bayxa gateway.

Tool API.market path RapidAPI path
bayxa_web_reader /web-reader/v1/scrape /web-reader/v1/scrape
bayxa_ai_auditor /ai-auditor/v1/audit /ai-auditor/v1/audit
bayxa_web_search (kind=web) /web-search/v1/search /web-search/v1/search
bayxa_web_search (kind=news) /web-search/v1/news /web-search/v1/news
bayxa_screenshot (output_type=screenshot) /shot/v1/screenshot /shot/v1/screenshot
bayxa_screenshot (output_type=pdf) /shot/v1/pdf /shot/v1/pdf

API.market publishes the screenshot product under the /shot slug; the MCP server already maps this for you.

Tool parameters at a glance

bayxa_web_reader — url (required), formats[], render_js, only_main_content, wait_for, wait_ms, timeout_ms, device, headers, actions[], include_tags[], exclude_tags[], extract{prompt,schema}, max_age.

bayxa_ai_auditor — url (required), max_age.

bayxa_web_search — query (required), kind (web/news), category, time_range, language, safesearch, max_results, scrape_top_n, max_age.

bayxa_screenshot — output_type (screenshot/pdf), url, html, output_path, format, quality, full_page, selector, paper_format, landscape, margin_mm, print_background, device, device_scale_factor, dark_mode, block_ads, hide_cookie_banners, wait_for, wait_ms, actions[], headers, timeout_ms, max_age.

Screenshots are returned as image content so the agent can see them directly; pass output_path to write the file instead. PDFs are written to a temp file and the path is returned.


Local development

git clone https://github.com/vhnamgau/bayxa-mcp-server.git
cd bayxa-mcp-server
npm install
npm run build
BAYXA_API_KEY="your-key" node build/index.js

Inspect the server with the MCP Inspector:

npx @modelcontextprotocol/inspector node build/index.js

Add a fifth API

Open src/index.ts and append one object to the TOOLS array:

{
  name: "bayxa_my_new_tool",
  title: "My New Bayxa Tool",
  description: "What it does, written for an LLM.",
  inputSchema: {
    url: z.string().url().describe("Target URL."),
  },
  resolve: (args) => ({
    apiMarketPath: "/my-product/v1/run",
    rapidapiPath: "/my-product/v1/run",
    body: compact({ url: args.url }),
  }),
}

Rebuild, and the tool is registered automatically. No other wiring required.


Troubleshooting

Symptom Fix
Missing BAYXA_API_KEY on startup Set the key in the client's env block, then restart the client.
HTTP 401/403 Key is invalid or not subscribed to that product. Activate the product in your dashboard.
HTTP 429 Rate limit hit. Free plans allow ~1 req/s; retry shortly.
No active Subscription found Upstream API.market rejection — subscribe to the product for this key.
Screenshot/PDF times out Increase BAYXA_TIMEOUT_MS (default 180s) for very heavy pages.

License

MIT © Bayxa