Skip to main content
Glama
charted-sea-mcp

charted-sea-mcp

by ayenisholah

charted-sea-mcp

An MCP server for the Charted Sea scraping API. It lets Claude, Cursor and other AI agents check marketplace scraping health, run scraping tasks on Shopee and Lazada, and read the results, with a spend guard so an agent can't burn credits in a loop.

CI

Unofficial. Not affiliated with or endorsed by Charted Sea. Status: pre-release. All six tools, the task resource, stdio and HTTP transports and the Docker image are built and tested, including against the live API. It isn't on npm yet; until then, run it from a clone (see Install).

What it solves

AI agents are good at deciding what to look up, but calling a paid scraping API directly from an agent is risky:

  • Agents loop. One bad plan can submit the same 20 URLs a hundred times. The server caps submissions per session (default 50). Over-budget calls are refused with the remaining count, and calls default to a one-hour cache, which isn't billed.

  • Agents wait badly. A tool call that blocks for 10 minutes stalls the conversation. Waits are capped (default 300 s), and unfinished tasks come back with their UUIDs so the agent can check later.

  • Responses are huge. Marketplace pages are often hundreds of kilobytes. Tool results carry a preview (default 20,000 characters), and the full body is a resource the agent can read only when it needs to.

  • Scraped text can carry prompt injection. Every result with scraped content is labelled as third-party data, not instructions, and the server never acts on body content.

  • Platforms block scrapers. check_platform_health turns Charted Sea's health metrics into a go / caution / wait recommendation, so the agent can wait out a block instead of paying for failures.

  • Secrets. The token never reaches tool results, logs or errors. There are no proxy-configuration tools (ADR 0004), so an agent can't leak proxy credentials or wipe a working configuration.

All API calls go through charted-sea-client. That means the server inherits its safe retry policy: a dropped run is never resubmitted.

Related MCP server: ScrapeGraph MCP Server

Tools

Tool

What it does

Annotations

list_scrapers

Supported scrapers, countries and doc links. No network call

read-only

check_platform_health

Success rate and latency per scraper, country, device and endpoint, with a go / caution / wait recommendation

read-only

run_scraping_tasks

Submit 1–20 URLs (GET or POST), optionally wait for results, within the spend guard

spends credits

get_task_results

Status and truncated bodies for up to 100 tasks by UUID (not billed)

read-only

count_tasks

Task counts by status and country

read-only

cancel_tasks

Cancel tasks by UUID (cancelling by country is deliberately not exposed)

destructive

Resource: charted-sea://tasks/{scraper}/{uuid} returns the full task with its untruncated body, as JSON.

Install

You need Node 22 or newer and a Charted Sea API token: log in to the console, then choose Get API Token → Generate Token.

From a clone (until the npm release)

git clone https://github.com/ayenisholah/charted-sea-mcp && cd charted-sea-mcp
npm ci && npm run build

Then point your MCP client at node /absolute/path/to/charted-sea-mcp/dist/bin.js:

# Claude Code
claude mcp add charted-sea --env CHARTED_SEA_TOKEN=<your token> -- node /absolute/path/to/charted-sea-mcp/dist/bin.js
// Cursor and other clients: mcp.json
{
  "mcpServers": {
    "charted-sea": {
      "command": "node",
      "args": ["/absolute/path/to/charted-sea-mcp/dist/bin.js"],
      "env": { "CHARTED_SEA_TOKEN": "<your token>" }
    }
  }
}

From npm (after the first release)

Replace the command with npx -y charted-sea-mcp:

claude mcp add charted-sea --env CHARTED_SEA_TOKEN=<your token> -- npx -y charted-sea-mcp

Docker (Streamable HTTP)

docker build -t charted-sea-mcp .
docker run -p 3333:3333 \
  -e CHARTED_SEA_TOKEN=<your token> \
  -e MCP_HTTP_TOKEN=$(openssl rand -hex 24) \
  charted-sea-mcp

The image is distroless, runs as nonroot (about 56 MB), and has a /healthz health check. Point an MCP client at http://<host>:3333/mcp and send Authorization: Bearer <MCP_HTTP_TOKEN>.

Usage

Once it's connected, ask your agent in plain language. For example:

Check Shopee health in Singapore and Indonesia for the last hour. If search is healthy, fetch the first results page for "tshirt" on shopee.sg and tell me the top 5 item names and prices.

A typical agent run:

  1. check_platform_health with scrapers: ["SHOPEE"], countries: ["SG","ID"]. SG PRODUCT_SEARCH is go, ID is wait.

  2. run_scraping_tasks with scraper: "shopee" and requests: [{ url: "https://shopee.sg/api/v4/search/search_items?keyword=tshirt" }]. The task finishes within the wait and returns a body preview.

  3. If the preview was truncated, the agent reads charted-sea://tasks/shopee/<uuid> for the full body.

To try the tools without an agent, use the MCP Inspector:

CHARTED_SEA_TOKEN=<your token> npm run inspect

Configuration

All settings are environment variables.

Variable

Default

Purpose

CHARTED_SEA_TOKEN

required

API token from the Charted Sea console

CHARTED_SEA_MAX_TASKS_PER_SESSION

50

Spend guard: submissions allowed per server process

CHARTED_SEA_MAX_BODY_CHARS

20000

Inline body preview size (the full body stays a resource)

CHARTED_SEA_MAX_WAIT_SEC

300

Longest a tool call waits for results

CHARTED_SEA_HEALTH_GO / CHARTED_SEA_HEALTH_WAIT

0.8 / 0.5

Success-rate thresholds for go and wait

CHARTED_SEA_BASE_URL

Charted Sea API

Override the API host (testing)

MCP_TRANSPORT

stdio

stdio or http

MCP_HTTP_HOST / MCP_HTTP_PORT

127.0.0.1 / 3333

Where HTTP listens (/mcp, plus /healthz)

MCP_HTTP_TOKEN

required for http

Bearer token clients must send; separate from the Charted Sea token; at least 16 characters

MCP_ALLOWED_ORIGINS

empty

Extra allowed browser Origins, comma-separated; localhost is always allowed

The server fails fast with a readable message if a setting is missing or invalid. Logs are structured JSON on stderr, with secrets redacted; stdout is the MCP protocol channel.

Security

  • The spend guard and the wait cap are enforced in code, not left to the agent (ADR 0002).

  • HTTP mode binds to 127.0.0.1 by default. It requires its own bearer token (compared in constant time) and rejects foreign Origin headers.

  • See SECURITY.md for how secrets are handled and how to report a vulnerability.

How it's tested

  • 61 tests at 100% coverage per file, on Node 22 and 24.

  • Protocol tests connect a real MCP client to the server.

  • Transport tests check auth, Origin and /healthz over real HTTP.

  • CI starts the packed package over stdio and lists its tools with the official MCP Inspector. It also builds the Docker image and checks /healthz, tools/list over HTTP, the 401 without a token, and the non-root user.

  • A live smoke test calls the real API through the tool handlers.

Documentation

Spec · Architecture · Requirements · Test strategy · CI/CD · Release process · Roadmap · ADRs · Contributing · Security

Licence

MIT

Available Tools

6 tools
cancel_tasksCancel tasksA
DestructiveIdempotent

Cancels tasks (and their sub-tasks) by UUID. Cancelled tasks are not billed. Cancelling by country is deliberately not available here.

Inputs: uuids (required), scraper (required).

check_platform_healthCheck platform healthA
Read-only

Recent success rates and latency for scraping tasks and session preparation, per scraper, country, device and endpoint, aggregated across all Charted Sea customers. Use before submitting tasks: if the recommendation is 'wait', the platform is blocking and tasks would likely fail.

Inputs: scrapers (required), countries (required), window, knownApis.

count_tasksCount tasksB
Read-only

Counts this account's tasks by status and country (default: the last 7 days). Use PENDING,RUNNING,BLOCKED,ERROR to see what is still in flight.

Inputs: scraper (required), since, statuses.

get_task_resultsGet task resultsA
Read-only

Status and (truncated) response bodies for up to 100 tasks by UUID. Full bodies are available as resources at the returned resourceUri. Reading results is not billed.

Inputs: uuids (required), scraper (required).

list_scrapersList scrapersA
Read-only

Lists the Charted Sea scrapers (path names for tasks, upper-case names for health), the countries the health metrics cover, and documentation links. No network call.

Inputs: no named parameters.

run_scraping_tasksRun scraping tasksA

Submits 1–20 Shopee or Lazada URLs to Charted Sea and optionally waits for results. SPENDS CREDITS for each successful task not served from cache. Check platform health first. Tasks still running when the wait ends are returned with their status; fetch them later with get_task_results.

Inputs: scraper (required), requests (required), waitSec, includeFields, +1 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 6 tools

    Disambiguation5/5

    Each tool occupies a distinct point in the task lifecycle: discovery (list_scrapers), gating (check_platform_health), submission (run_scraping_tasks), retrieval (get_task_results), aggregation (count_tasks), and cleanup (cancel_tasks). No two tools could plausibly be confused, and descriptions reinforce the sequencing (health check before submit, fetch later after wait).

    Naming Consistency5/5

    All six names follow a strict snake_case verb_noun pattern with unambiguous verbs (list, check, run, get, count, cancel). Nouns consistently refer to the domain objects: scrapers, platform health, tasks, task results.

    Tool Count5/5

    Six tools is a tight, well-scoped surface for a scraping platform; every tool maps to a needed step and none is redundant. Nothing feels padded or conspicuously absent at this level of granularity.

    Completeness4/5

    The submit/status/count/cancel lifecycle plus read-only discovery and health gating is fully covered, including resource URIs for full bodies so retrieval isn't a dead end. Minor gaps remain: no way to check remaining credit balance despite credit-spending tasks, and no bulk or country-level cancellation (explicitly noted as omitted).

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Connects AI agents to the Shopee platform for real-time product searches and category mapping via the Affiliate and Seller Center APIs. It enables users to filter products by keyword, category, and commission rates directly through natural language.
      1
      -
    • F
      license
      Not graded
      quality
      B
      maintenance
      Enables language models to perform AI-powered web scraping through the ScrapeGraph AI API, including page scraping, structured extraction, web search, multi-page crawling, schema generation, and scheduled monitors. It also exposes credit and history lookups so assistants can manage and track their usage.
      -
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables AI assistants to scrape, extract structured data from, search, and crawl websites through the ScrapeGraph AI API, with markdown/HTML/screenshot and other output formats plus JSON Schema generation. Also supports scheduled monitors, page-change tracking, and account credit and history queries.
      -