diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci-docs-mcp.yaml
similarity index 65%
rename from .github/workflows/ci.yaml
rename to .github/workflows/ci-docs-mcp.yaml
index 60e3ee5..54c7db8 100644
--- a/.github/workflows/ci.yaml
+++ b/.github/workflows/ci-docs-mcp.yaml
@@ -1,4 +1,4 @@
-name: CI
+name: CI Docs MCP
on:
push:
@@ -6,16 +6,26 @@ on:
- main
- stage
- dev
+ paths:
+ - 'apps/docs-mcp/**'
+ - '.github/workflows/ci-docs-mcp.yaml'
pull_request:
branches:
- main
+ paths:
+ - 'apps/docs-mcp/**'
+ - '.github/workflows/ci-docs-mcp.yaml'
permissions:
contents: read
+defaults:
+ run:
+ working-directory: ./apps/docs-mcp
+
jobs:
lint:
- name: Lint
+ name: Lint and Typecheck
runs-on: ubuntu-latest
steps:
- name: Checkout code
@@ -24,14 +34,15 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
- node-version-file: .nvmrc
+ node-version: '22'
cache: npm
+ cache-dependency-path: apps/docs-mcp/package.json
- name: Setup Biome CLI
uses: biomejs/setup-biome@29711cbb52afee00eb13aeb30636592f9edc0088 # v2.7.0
- name: Install dependencies
- run: npm ci
+ run: npm install
- name: Build
run: npm run build
diff --git a/.github/workflows/ci-sumup-mcp.yaml b/.github/workflows/ci-sumup-mcp.yaml
new file mode 100644
index 0000000..af295b6
--- /dev/null
+++ b/.github/workflows/ci-sumup-mcp.yaml
@@ -0,0 +1,51 @@
+name: CI SumUp MCP
+
+on:
+ push:
+ branches:
+ - main
+ - stage
+ - dev
+ paths:
+ - 'apps/sumup-mcp/**'
+ - '.github/workflows/ci-sumup-mcp.yaml'
+ pull_request:
+ branches:
+ - main
+ paths:
+ - 'apps/sumup-mcp/**'
+ - '.github/workflows/ci-sumup-mcp.yaml'
+
+permissions:
+ contents: read
+
+defaults:
+ run:
+ working-directory: ./apps/sumup-mcp
+
+jobs:
+ lint:
+ name: Lint and Typecheck
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
+
+ - name: Setup Node.js
+ uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
+ with:
+ node-version: '22'
+ cache: npm
+ cache-dependency-path: apps/sumup-mcp/package.json
+
+ - name: Setup Biome CLI
+ uses: biomejs/setup-biome@29711cbb52afee00eb13aeb30636592f9edc0088 # v2.7.0
+
+ - name: Install dependencies
+ run: npm install
+
+ - name: Build
+ run: npm run build
+
+ - name: Lint code
+ run: biome ci --diagnostic-level=error --reporter=github
diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy-docs-mcp.yaml
similarity index 69%
rename from .github/workflows/deploy.yaml
rename to .github/workflows/deploy-docs-mcp.yaml
index 208e491..7813081 100644
--- a/.github/workflows/deploy.yaml
+++ b/.github/workflows/deploy-docs-mcp.yaml
@@ -1,4 +1,4 @@
-name: Deploy
+name: Deploy Docs MCP
on:
push:
@@ -6,15 +6,22 @@ on:
- main
- stage
- dev
+ paths:
+ - 'apps/docs-mcp/**'
+ - '.github/workflows/deploy-docs-mcp.yaml'
permissions:
contents: read
deployments: write
concurrency:
- group: deploy-${{ github.ref }}
+ group: deploy-docs-mcp-${{ github.ref }}
cancel-in-progress: true
+defaults:
+ run:
+ working-directory: ./apps/docs-mcp
+
jobs:
deploy-live:
name: Deploy live
@@ -27,14 +34,15 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
- node-version-file: .nvmrc
+ node-version: '22'
cache: npm
+ cache-dependency-path: apps/docs-mcp/package.json
- name: Install dependencies
- run: npm ci
+ run: npm install
- name: Deploy Worker
- run: npx wrangler deploy --env live
+ run: npx wrangler deploy -c wrangler.jsonc --env live
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
@@ -49,14 +57,15 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
- node-version-file: .nvmrc
+ node-version: '22'
cache: npm
+ cache-dependency-path: apps/docs-mcp/package.json
- name: Install dependencies
- run: npm ci
+ run: npm install
- name: Deploy Worker
- run: npx wrangler deploy --env stage
+ run: npx wrangler deploy -c wrangler.jsonc --env stage
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
@@ -71,13 +80,14 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
- node-version-file: .nvmrc
+ node-version: '22'
cache: npm
+ cache-dependency-path: apps/docs-mcp/package.json
- name: Install dependencies
- run: npm ci
+ run: npm install
- name: Deploy Worker
- run: npx wrangler deploy --env dev
+ run: npx wrangler deploy -c wrangler.jsonc --env dev
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
diff --git a/.github/workflows/deploy-sumup-mcp.yaml b/.github/workflows/deploy-sumup-mcp.yaml
new file mode 100644
index 0000000..6a47664
--- /dev/null
+++ b/.github/workflows/deploy-sumup-mcp.yaml
@@ -0,0 +1,93 @@
+name: Deploy SumUp MCP
+
+on:
+ push:
+ branches:
+ - main
+ - stage
+ - dev
+ paths:
+ - 'apps/sumup-mcp/**'
+ - '.github/workflows/deploy-sumup-mcp.yaml'
+
+permissions:
+ contents: read
+ deployments: write
+
+concurrency:
+ group: deploy-sumup-mcp-${{ github.ref }}
+ cancel-in-progress: true
+
+defaults:
+ run:
+ working-directory: ./apps/sumup-mcp
+
+jobs:
+ deploy-live:
+ name: Deploy live
+ if: github.ref == 'refs/heads/main'
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
+
+ - name: Setup Node.js
+ uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
+ with:
+ node-version: '22'
+ cache: npm
+ cache-dependency-path: apps/sumup-mcp/package.json
+
+ - name: Install dependencies
+ run: npm install
+
+ - name: Deploy Worker
+ run: npx wrangler deploy -c wrangler.jsonc --env live
+ env:
+ CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
+
+ deploy-stage:
+ name: Deploy stage
+ if: github.ref == 'refs/heads/stage'
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
+
+ - name: Setup Node.js
+ uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
+ with:
+ node-version: '22'
+ cache: npm
+ cache-dependency-path: apps/sumup-mcp/package.json
+
+ - name: Install dependencies
+ run: npm install
+
+ - name: Deploy Worker
+ run: npx wrangler deploy -c wrangler.jsonc --env stage
+ env:
+ CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
+
+ deploy-dev:
+ name: Deploy dev
+ if: github.ref == 'refs/heads/dev'
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
+
+ - name: Setup Node.js
+ uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
+ with:
+ node-version: '22'
+ cache: npm
+ cache-dependency-path: apps/sumup-mcp/package.json
+
+ - name: Install dependencies
+ run: npm install
+
+ - name: Deploy Worker
+ run: npx wrangler deploy -c wrangler.jsonc --env dev
+ env:
+ CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
diff --git a/.github/workflows/publish-mcp.yaml b/.github/workflows/publish-mcp.yaml
index b45f879..3ac475e 100644
--- a/.github/workflows/publish-mcp.yaml
+++ b/.github/workflows/publish-mcp.yaml
@@ -27,14 +27,17 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@6044e13b5dc448c55e2357c09f80417699197238 # v6.2.0
with:
- node-version-file: .nvmrc
+ node-version: '22'
cache: npm
+ cache-dependency-path: apps/sumup-mcp/package.json
- name: Install dependencies
- run: npm ci
+ run: npm install
+ working-directory: ./apps/sumup-mcp
- name: Build package
run: npm run build
+ working-directory: ./apps/sumup-mcp
- name: Install MCP Publisher
if: steps.publish.outputs.published == 'true'
diff --git a/README.md b/README.md
index 3a36c75..8e10cb4 100644
--- a/README.md
+++ b/README.md
@@ -1,24 +1,31 @@
-# SumUp MCP Server
+# SumUp MCP Servers
[![Documentation][docs-badge]](https://developer.sumup.com)
[](./LICENSE)
-SumUp's [Model Context Protocol (MCP)](https://modelcontextprotocol.io/introduction) server for interactions between large language models (LLMs) and SumUp APIs. The MCP server allows you to connect to SumUp's services from an MCP client (e.g. Cursor, Claude) and use natural language to work with your SumUp account.
+SumUp's [Model Context Protocol (MCP)](https://modelcontextprotocol.io/introduction) servers for interactions between large language models (LLMs) and SumUp APIs/documentation.
+
+## Apps layout
+
+- `apps/sumup-mcp`: MCP server for SumUp API tools (`mcp.sumup.com`).
+- `apps/docs-mcp`: MCP server for developer docs search via AutoRAG (`docs.mcp.sumup.com`).
+- `server.json` (root): registry descriptor listing all MCP remotes.
## Getting started
+From each app folder, install dependencies and run scripts:
+
```bash
-npm install
-npm run dev
+cd apps/sumup-mcp && npm install && npm run dev
+cd apps/docs-mcp && npm install && npm run dev
```
-Every MCP request must include a SumUp API key through the `Authorization: Bearer ` header. We currently don't support other authentication methods. The worker listens on `/mcp` for the Streamable HTTP transport and `/sse` for the legacy SSE transport.
-
-You can get your API key from the [developer settings](https://me.sumup.com/settings/api-keys) in the SumUp Dashboard.
+`mcp.sumup.com` requires a SumUp API key via `Authorization: Bearer `.
+`docs.mcp.sumup.com` exposes `search_developer_docs` backed by Cloudflare AutoRAG.
## Using from an MCP client
diff --git a/apps/docs-mcp/biome.json b/apps/docs-mcp/biome.json
new file mode 100644
index 0000000..60af8cb
--- /dev/null
+++ b/apps/docs-mcp/biome.json
@@ -0,0 +1,34 @@
+{
+ "$schema": "https://biomejs.dev/schemas/2.3.14/schema.json",
+ "vcs": {
+ "enabled": true,
+ "clientKind": "git",
+ "useIgnoreFile": false
+ },
+ "files": {
+ "ignoreUnknown": false
+ },
+ "formatter": {
+ "enabled": true,
+ "indentStyle": "tab"
+ },
+ "linter": {
+ "enabled": true,
+ "rules": {
+ "recommended": true
+ }
+ },
+ "javascript": {
+ "formatter": {
+ "quoteStyle": "double"
+ }
+ },
+ "assist": {
+ "enabled": true,
+ "actions": {
+ "source": {
+ "organizeImports": "on"
+ }
+ }
+ }
+}
diff --git a/apps/docs-mcp/package.json b/apps/docs-mcp/package.json
new file mode 100644
index 0000000..d3d0fb8
--- /dev/null
+++ b/apps/docs-mcp/package.json
@@ -0,0 +1,49 @@
+{
+ "name": "@sumup/docs-mcp",
+ "version": "0.1.0",
+ "description": "MCP server for searching SumUp developer documentation.",
+ "homepage": "https://github.com/sumup/sumup-mcp",
+ "license": "Apache-2.0",
+ "author": "SumUp (https://sumup.com/)",
+ "scripts": {
+ "generate-types": "wrangler types -c wrangler.jsonc",
+ "build": "tsc --noEmit -p tsconfig.json",
+ "dev": "wrangler dev --local -c wrangler.jsonc",
+ "deploy": "wrangler deploy -c wrangler.jsonc",
+ "typecheck": "tsc --noEmit -p tsconfig.json",
+ "lint": "biome check",
+ "lint:fix": "biome check --write"
+ },
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/sumup/sumup-mcp.git"
+ },
+ "bugs": {
+ "url": "https://github.com/sumup/sumup-mcp/issues"
+ },
+ "keywords": [
+ "sumup",
+ "docs",
+ "mcp",
+ "mcp-server",
+ "modelcontextprotocol"
+ ],
+ "type": "module",
+ "engines": {
+ "node": ">=22"
+ },
+ "dependencies": {
+ "@modelcontextprotocol/sdk": "^1.26.0",
+ "agents": "^0.2.32",
+ "zod": "^3.25.76"
+ },
+ "devDependencies": {
+ "@biomejs/biome": "^2.3.14",
+ "@types/node": "^24.10.1",
+ "typescript": "^5.5.4",
+ "wrangler": "^4.64.0"
+ },
+ "optionalDependencies": {
+ "@biomejs/cli-darwin-arm64": "^2.3.14"
+ }
+}
diff --git a/apps/docs-mcp/src/agent.ts b/apps/docs-mcp/src/agent.ts
new file mode 100644
index 0000000..4130a65
--- /dev/null
+++ b/apps/docs-mcp/src/agent.ts
@@ -0,0 +1,176 @@
+import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
+import { McpAgent } from "agents/mcp";
+import * as z from "zod/v4";
+
+type AutoRAGSearchResult = {
+ content?: string;
+ text?: string;
+ source?: string;
+ url?: string;
+ score?: number;
+ attributes?: Record;
+};
+
+type AutoRAGSearchResponse = {
+ data?: AutoRAGSearchResult[];
+};
+
+type AIBinding = {
+ autorag: (name: string) => {
+ search: (params: {
+ query: string;
+ max_num_results?: number;
+ }) => Promise;
+ };
+};
+
+export interface DocsEnv {
+ AI: AIBinding;
+ SUMUP_DEVELOPER_DOCS_AUTORAG: string;
+ SUMUP_DOCS_MCP_AGENT: DurableObjectNamespace;
+}
+
+export class DocsMcpAgent extends McpAgent<
+ DocsEnv,
+ never,
+ Record
+> {
+ private _server: McpServer | undefined;
+
+ set server(server: McpServer) {
+ this._server = server;
+ }
+
+ get server(): McpServer {
+ if (!this._server) {
+ throw new Error("Tried to access MCP server before it was initialized");
+ }
+ return this._server;
+ }
+
+ async init() {
+ const server = new McpServer(
+ {
+ name: "SumUp Developer Docs",
+ version: "1.0.0",
+ },
+ {
+ capabilities: {
+ resources: {},
+ tools: {},
+ },
+ },
+ );
+
+ server.registerResource(
+ "SumUp developer documentation",
+ "https://developer.sumup.com/llms.txt",
+ {
+ mimeType: "text/plain",
+ },
+ async (uri) => {
+ const content = await fetch("https://developer.sumup.com/llms.txt");
+ return {
+ contents: [
+ {
+ uri: uri.toString(),
+ mimeType: "text/plain",
+ text: await content.text(),
+ },
+ ],
+ };
+ },
+ );
+
+ server.registerTool(
+ "search_developer_docs",
+ {
+ title: "Search SumUp developer docs",
+ description:
+ "Search SumUp developer documentation using Cloudflare AutoRAG.",
+ inputSchema: {
+ query: z
+ .string()
+ .min(1)
+ .describe(
+ "Natural-language query used to search developer documentation.",
+ ),
+ maxNumResults: z
+ .number()
+ .int()
+ .min(1)
+ .max(20)
+ .optional()
+ .describe("Optional limit on the number of returned results."),
+ },
+ outputSchema: {
+ query: z.string(),
+ results: z.array(
+ z.object({
+ content: z.string(),
+ source: z.string().optional(),
+ sourceUrl: z.string().optional(),
+ score: z.number().optional(),
+ }),
+ ),
+ },
+ annotations: {
+ title: "Search SumUp developer docs",
+ readOnlyHint: true,
+ destructiveHint: false,
+ idempotentHint: true,
+ },
+ },
+ async ({
+ query,
+ maxNumResults,
+ }: {
+ query: string;
+ maxNumResults?: number;
+ }) => {
+ const searchResult = await this.env.AI.autorag(
+ this.env.SUMUP_DEVELOPER_DOCS_AUTORAG,
+ ).search({
+ query,
+ max_num_results: maxNumResults,
+ });
+
+ const results = (searchResult.data ?? [])
+ .map((entry) => {
+ const sourceAttr = entry.attributes?.source;
+ const urlAttr = entry.attributes?.url;
+ const source =
+ typeof sourceAttr === "string" ? sourceAttr : entry.source;
+ const sourceUrl = typeof urlAttr === "string" ? urlAttr : entry.url;
+ const content = entry.content ?? entry.text ?? "";
+
+ if (!content) {
+ return null;
+ }
+
+ return {
+ content,
+ source,
+ sourceUrl,
+ score: entry.score,
+ };
+ })
+ .filter(
+ (entry): entry is NonNullable => entry !== null,
+ );
+
+ const structuredContent = {
+ query,
+ results,
+ };
+
+ return {
+ structuredContent,
+ content: [{ type: "text", text: JSON.stringify(structuredContent) }],
+ };
+ },
+ );
+
+ this.server = server;
+ }
+}
diff --git a/apps/docs-mcp/src/worker.ts b/apps/docs-mcp/src/worker.ts
new file mode 100644
index 0000000..008b5c3
--- /dev/null
+++ b/apps/docs-mcp/src/worker.ts
@@ -0,0 +1,47 @@
+import { type DocsEnv, DocsMcpAgent } from "./agent";
+
+const MCP_ROUTE = "/mcp";
+const SSE_ROUTE = "/sse";
+
+const mcpHandler = DocsMcpAgent.serve(MCP_ROUTE, {
+ binding: "SUMUP_DOCS_MCP_AGENT",
+});
+
+const sseHandler = DocsMcpAgent.serveSSE(SSE_ROUTE, {
+ binding: "SUMUP_DOCS_MCP_AGENT",
+});
+
+const CORS_HEADERS = {
+ "Access-Control-Allow-Origin": "*",
+ "Access-Control-Allow-Methods": "GET, POST, DELETE, OPTIONS",
+ "Access-Control-Allow-Headers":
+ "Content-Type, Accept, Authorization, mcp-session-id, MCP-Protocol-Version",
+ "Access-Control-Max-Age": "86400",
+};
+
+export default {
+ async fetch(
+ request: Request,
+ env: DocsEnv,
+ ctx: ExecutionContext,
+ ): Promise {
+ if (request.method === "OPTIONS") {
+ return new Response(null, {
+ headers: CORS_HEADERS,
+ });
+ }
+
+ const url = new URL(request.url);
+
+ if (url.pathname !== MCP_ROUTE && url.pathname !== SSE_ROUTE) {
+ return new Response("Not Found", { status: 404 });
+ }
+
+ if (url.pathname.startsWith(SSE_ROUTE)) {
+ return sseHandler.fetch(request, env, ctx);
+ }
+ return mcpHandler.fetch(request, env, ctx);
+ },
+};
+
+export { DocsMcpAgent };
diff --git a/apps/docs-mcp/tsconfig.json b/apps/docs-mcp/tsconfig.json
new file mode 100644
index 0000000..df085c6
--- /dev/null
+++ b/apps/docs-mcp/tsconfig.json
@@ -0,0 +1,21 @@
+{
+ "$schema": "https://json.schemastore.org/tsconfig",
+ "compilerOptions": {
+ "target": "ES2022",
+ "module": "ESNext",
+ "moduleResolution": "bundler",
+ "lib": ["ES2022"],
+ "types": ["./worker-configuration.d.ts", "@types/node"],
+ "resolveJsonModule": true,
+ "allowJs": true,
+ "checkJs": false,
+ "noEmit": true,
+ "isolatedModules": true,
+ "allowSyntheticDefaultImports": true,
+ "forceConsistentCasingInFileNames": true,
+ "strict": true,
+ "skipLibCheck": true
+ },
+ "include": ["**/*.ts"],
+ "exclude": ["node_modules", "dist"]
+}
diff --git a/apps/docs-mcp/worker-configuration.d.ts b/apps/docs-mcp/worker-configuration.d.ts
new file mode 100644
index 0000000..2e3d84e
--- /dev/null
+++ b/apps/docs-mcp/worker-configuration.d.ts
@@ -0,0 +1,10935 @@
+/* eslint-disable */
+// Generated by Wrangler by running `wrangler types -c wrangler.jsonc` (hash: ae8e836455aebaee5dfb1730f36edde3)
+// Runtime types generated with workerd@1.20260210.0 2025-08-15 nodejs_compat
+declare namespace Cloudflare {
+ interface DevEnv {
+ SUMUP_DEVELOPER_DOCS_AUTORAG: "sumup-developer-docs";
+ SUMUP_DOCS_MCP_AGENT: DurableObjectNamespace /* DocsMcpAgent */;
+ }
+ interface StageEnv {
+ SUMUP_DEVELOPER_DOCS_AUTORAG: "sumup-developer-docs";
+ SUMUP_DOCS_MCP_AGENT: DurableObjectNamespace /* DocsMcpAgent */;
+ }
+ interface LiveEnv {
+ SUMUP_DEVELOPER_DOCS_AUTORAG: "sumup-developer-docs";
+ SUMUP_DOCS_MCP_AGENT: DurableObjectNamespace /* DocsMcpAgent */;
+ }
+ interface Env {
+ SUMUP_DEVELOPER_DOCS_AUTORAG?: "sumup-developer-docs";
+ SUMUP_DOCS_MCP_AGENT: DurableObjectNamespace /* DocsMcpAgent */;
+ AI?: Ai;
+ }
+}
+interface Env extends Cloudflare.Env {}
+type StringifyValues> = {
+ [Binding in keyof EnvType]: EnvType[Binding] extends string ? EnvType[Binding] : string;
+};
+declare namespace NodeJS {
+ interface ProcessEnv extends StringifyValues> {}
+}
+
+// Begin runtime types
+/*! *****************************************************************************
+Copyright (c) Cloudflare. All rights reserved.
+Copyright (c) Microsoft Corporation. All rights reserved.
+
+Licensed under the Apache License, Version 2.0 (the "License"); you may not use
+this file except in compliance with the License. You may obtain a copy of the
+License at http://www.apache.org/licenses/LICENSE-2.0
+THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
+WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
+MERCHANTABLITY OR NON-INFRINGEMENT.
+See the Apache Version 2.0 License for specific language governing permissions
+and limitations under the License.
+***************************************************************************** */
+/* eslint-disable */
+// noinspection JSUnusedGlobalSymbols
+declare var onmessage: never;
+/**
+ * The **`DOMException`** interface represents an abnormal event (called an **exception**) that occurs as a result of calling a method or accessing a property of a web API.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException)
+ */
+declare class DOMException extends Error {
+ constructor(message?: string, name?: string);
+ /**
+ * The **`message`** read-only property of the a message or description associated with the given error name.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/message)
+ */
+ readonly message: string;
+ /**
+ * The **`name`** read-only property of the one of the strings associated with an error name.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/name)
+ */
+ readonly name: string;
+ /**
+ * The **`code`** read-only property of the DOMException interface returns one of the legacy error code constants, or `0` if none match.
+ * @deprecated
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/code)
+ */
+ readonly code: number;
+ static readonly INDEX_SIZE_ERR: number;
+ static readonly DOMSTRING_SIZE_ERR: number;
+ static readonly HIERARCHY_REQUEST_ERR: number;
+ static readonly WRONG_DOCUMENT_ERR: number;
+ static readonly INVALID_CHARACTER_ERR: number;
+ static readonly NO_DATA_ALLOWED_ERR: number;
+ static readonly NO_MODIFICATION_ALLOWED_ERR: number;
+ static readonly NOT_FOUND_ERR: number;
+ static readonly NOT_SUPPORTED_ERR: number;
+ static readonly INUSE_ATTRIBUTE_ERR: number;
+ static readonly INVALID_STATE_ERR: number;
+ static readonly SYNTAX_ERR: number;
+ static readonly INVALID_MODIFICATION_ERR: number;
+ static readonly NAMESPACE_ERR: number;
+ static readonly INVALID_ACCESS_ERR: number;
+ static readonly VALIDATION_ERR: number;
+ static readonly TYPE_MISMATCH_ERR: number;
+ static readonly SECURITY_ERR: number;
+ static readonly NETWORK_ERR: number;
+ static readonly ABORT_ERR: number;
+ static readonly URL_MISMATCH_ERR: number;
+ static readonly QUOTA_EXCEEDED_ERR: number;
+ static readonly TIMEOUT_ERR: number;
+ static readonly INVALID_NODE_TYPE_ERR: number;
+ static readonly DATA_CLONE_ERR: number;
+ get stack(): any;
+ set stack(value: any);
+}
+type WorkerGlobalScopeEventMap = {
+ fetch: FetchEvent;
+ scheduled: ScheduledEvent;
+ queue: QueueEvent;
+ unhandledrejection: PromiseRejectionEvent;
+ rejectionhandled: PromiseRejectionEvent;
+};
+declare abstract class WorkerGlobalScope extends EventTarget {
+ EventTarget: typeof EventTarget;
+}
+/* The **`console`** object provides access to the debugging console (e.g., the Web console in Firefox). *
+ * The **`console`** object provides access to the debugging console (e.g., the Web console in Firefox).
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console)
+ */
+interface Console {
+ "assert"(condition?: boolean, ...data: any[]): void;
+ /**
+ * The **`console.clear()`** static method clears the console if possible.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/clear_static)
+ */
+ clear(): void;
+ /**
+ * The **`console.count()`** static method logs the number of times that this particular call to `count()` has been called.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/count_static)
+ */
+ count(label?: string): void;
+ /**
+ * The **`console.countReset()`** static method resets counter used with console/count_static.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/countReset_static)
+ */
+ countReset(label?: string): void;
+ /**
+ * The **`console.debug()`** static method outputs a message to the console at the 'debug' log level.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/debug_static)
+ */
+ debug(...data: any[]): void;
+ /**
+ * The **`console.dir()`** static method displays a list of the properties of the specified JavaScript object.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dir_static)
+ */
+ dir(item?: any, options?: any): void;
+ /**
+ * The **`console.dirxml()`** static method displays an interactive tree of the descendant elements of the specified XML/HTML element.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dirxml_static)
+ */
+ dirxml(...data: any[]): void;
+ /**
+ * The **`console.error()`** static method outputs a message to the console at the 'error' log level.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/error_static)
+ */
+ error(...data: any[]): void;
+ /**
+ * The **`console.group()`** static method creates a new inline group in the Web console log, causing any subsequent console messages to be indented by an additional level, until console/groupEnd_static is called.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/group_static)
+ */
+ group(...data: any[]): void;
+ /**
+ * The **`console.groupCollapsed()`** static method creates a new inline group in the console.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupCollapsed_static)
+ */
+ groupCollapsed(...data: any[]): void;
+ /**
+ * The **`console.groupEnd()`** static method exits the current inline group in the console.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupEnd_static)
+ */
+ groupEnd(): void;
+ /**
+ * The **`console.info()`** static method outputs a message to the console at the 'info' log level.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/info_static)
+ */
+ info(...data: any[]): void;
+ /**
+ * The **`console.log()`** static method outputs a message to the console.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/log_static)
+ */
+ log(...data: any[]): void;
+ /**
+ * The **`console.table()`** static method displays tabular data as a table.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/table_static)
+ */
+ table(tabularData?: any, properties?: string[]): void;
+ /**
+ * The **`console.time()`** static method starts a timer you can use to track how long an operation takes.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/time_static)
+ */
+ time(label?: string): void;
+ /**
+ * The **`console.timeEnd()`** static method stops a timer that was previously started by calling console/time_static.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeEnd_static)
+ */
+ timeEnd(label?: string): void;
+ /**
+ * The **`console.timeLog()`** static method logs the current value of a timer that was previously started by calling console/time_static.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeLog_static)
+ */
+ timeLog(label?: string, ...data: any[]): void;
+ timeStamp(label?: string): void;
+ /**
+ * The **`console.trace()`** static method outputs a stack trace to the console.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/trace_static)
+ */
+ trace(...data: any[]): void;
+ /**
+ * The **`console.warn()`** static method outputs a warning message to the console at the 'warning' log level.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/warn_static)
+ */
+ warn(...data: any[]): void;
+}
+declare const console: Console;
+type BufferSource = ArrayBufferView | ArrayBuffer;
+type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array | BigInt64Array | BigUint64Array;
+declare namespace WebAssembly {
+ class CompileError extends Error {
+ constructor(message?: string);
+ }
+ class RuntimeError extends Error {
+ constructor(message?: string);
+ }
+ type ValueType = "anyfunc" | "externref" | "f32" | "f64" | "i32" | "i64" | "v128";
+ interface GlobalDescriptor {
+ value: ValueType;
+ mutable?: boolean;
+ }
+ class Global {
+ constructor(descriptor: GlobalDescriptor, value?: any);
+ value: any;
+ valueOf(): any;
+ }
+ type ImportValue = ExportValue | number;
+ type ModuleImports = Record;
+ type Imports = Record;
+ type ExportValue = Function | Global | Memory | Table;
+ type Exports = Record;
+ class Instance {
+ constructor(module: Module, imports?: Imports);
+ readonly exports: Exports;
+ }
+ interface MemoryDescriptor {
+ initial: number;
+ maximum?: number;
+ shared?: boolean;
+ }
+ class Memory {
+ constructor(descriptor: MemoryDescriptor);
+ readonly buffer: ArrayBuffer;
+ grow(delta: number): number;
+ }
+ type ImportExportKind = "function" | "global" | "memory" | "table";
+ interface ModuleExportDescriptor {
+ kind: ImportExportKind;
+ name: string;
+ }
+ interface ModuleImportDescriptor {
+ kind: ImportExportKind;
+ module: string;
+ name: string;
+ }
+ abstract class Module {
+ static customSections(module: Module, sectionName: string): ArrayBuffer[];
+ static exports(module: Module): ModuleExportDescriptor[];
+ static imports(module: Module): ModuleImportDescriptor[];
+ }
+ type TableKind = "anyfunc" | "externref";
+ interface TableDescriptor {
+ element: TableKind;
+ initial: number;
+ maximum?: number;
+ }
+ class Table {
+ constructor(descriptor: TableDescriptor, value?: any);
+ readonly length: number;
+ get(index: number): any;
+ grow(delta: number, value?: any): number;
+ set(index: number, value?: any): void;
+ }
+ function instantiate(module: Module, imports?: Imports): Promise;
+ function validate(bytes: BufferSource): boolean;
+}
+/**
+ * The **`ServiceWorkerGlobalScope`** interface of the Service Worker API represents the global execution context of a service worker.
+ * Available only in secure contexts.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/ServiceWorkerGlobalScope)
+ */
+interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
+ DOMException: typeof DOMException;
+ WorkerGlobalScope: typeof WorkerGlobalScope;
+ btoa(data: string): string;
+ atob(data: string): string;
+ setTimeout(callback: (...args: any[]) => void, msDelay?: number): number;
+ setTimeout(callback: (...args: Args) => void, msDelay?: number, ...args: Args): number;
+ clearTimeout(timeoutId: number | null): void;
+ setInterval(callback: (...args: any[]) => void, msDelay?: number): number;
+ setInterval(callback: (...args: Args) => void, msDelay?: number, ...args: Args): number;
+ clearInterval(timeoutId: number | null): void;
+ queueMicrotask(task: Function): void;
+ structuredClone(value: T, options?: StructuredSerializeOptions): T;
+ reportError(error: any): void;
+ fetch(input: RequestInfo | URL, init?: RequestInit): Promise;
+ self: ServiceWorkerGlobalScope;
+ crypto: Crypto;
+ caches: CacheStorage;
+ scheduler: Scheduler;
+ performance: Performance;
+ Cloudflare: Cloudflare;
+ readonly origin: string;
+ Event: typeof Event;
+ ExtendableEvent: typeof ExtendableEvent;
+ CustomEvent: typeof CustomEvent;
+ PromiseRejectionEvent: typeof PromiseRejectionEvent;
+ FetchEvent: typeof FetchEvent;
+ TailEvent: typeof TailEvent;
+ TraceEvent: typeof TailEvent;
+ ScheduledEvent: typeof ScheduledEvent;
+ MessageEvent: typeof MessageEvent;
+ CloseEvent: typeof CloseEvent;
+ ReadableStreamDefaultReader: typeof ReadableStreamDefaultReader;
+ ReadableStreamBYOBReader: typeof ReadableStreamBYOBReader;
+ ReadableStream: typeof ReadableStream;
+ WritableStream: typeof WritableStream;
+ WritableStreamDefaultWriter: typeof WritableStreamDefaultWriter;
+ TransformStream: typeof TransformStream;
+ ByteLengthQueuingStrategy: typeof ByteLengthQueuingStrategy;
+ CountQueuingStrategy: typeof CountQueuingStrategy;
+ ErrorEvent: typeof ErrorEvent;
+ MessageChannel: typeof MessageChannel;
+ MessagePort: typeof MessagePort;
+ EventSource: typeof EventSource;
+ ReadableStreamBYOBRequest: typeof ReadableStreamBYOBRequest;
+ ReadableStreamDefaultController: typeof ReadableStreamDefaultController;
+ ReadableByteStreamController: typeof ReadableByteStreamController;
+ WritableStreamDefaultController: typeof WritableStreamDefaultController;
+ TransformStreamDefaultController: typeof TransformStreamDefaultController;
+ CompressionStream: typeof CompressionStream;
+ DecompressionStream: typeof DecompressionStream;
+ TextEncoderStream: typeof TextEncoderStream;
+ TextDecoderStream: typeof TextDecoderStream;
+ Headers: typeof Headers;
+ Body: typeof Body;
+ Request: typeof Request;
+ Response: typeof Response;
+ WebSocket: typeof WebSocket;
+ WebSocketPair: typeof WebSocketPair;
+ WebSocketRequestResponsePair: typeof WebSocketRequestResponsePair;
+ AbortController: typeof AbortController;
+ AbortSignal: typeof AbortSignal;
+ TextDecoder: typeof TextDecoder;
+ TextEncoder: typeof TextEncoder;
+ navigator: Navigator;
+ Navigator: typeof Navigator;
+ URL: typeof URL;
+ URLSearchParams: typeof URLSearchParams;
+ URLPattern: typeof URLPattern;
+ Blob: typeof Blob;
+ File: typeof File;
+ FormData: typeof FormData;
+ Crypto: typeof Crypto;
+ SubtleCrypto: typeof SubtleCrypto;
+ CryptoKey: typeof CryptoKey;
+ CacheStorage: typeof CacheStorage;
+ Cache: typeof Cache;
+ FixedLengthStream: typeof FixedLengthStream;
+ IdentityTransformStream: typeof IdentityTransformStream;
+ HTMLRewriter: typeof HTMLRewriter;
+}
+declare function addEventListener(type: Type, handler: EventListenerOrEventListenerObject, options?: EventTargetAddEventListenerOptions | boolean): void;
+declare function removeEventListener(type: Type, handler: EventListenerOrEventListenerObject, options?: EventTargetEventListenerOptions | boolean): void;
+/**
+ * The **`dispatchEvent()`** method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order.
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
+ */
+declare function dispatchEvent(event: WorkerGlobalScopeEventMap[keyof WorkerGlobalScopeEventMap]): boolean;
+/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/btoa) */
+declare function btoa(data: string): string;
+/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/atob) */
+declare function atob(data: string): string;
+/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/setTimeout) */
+declare function setTimeout(callback: (...args: any[]) => void, msDelay?: number): number;
+/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/setTimeout) */
+declare function setTimeout(callback: (...args: Args) => void, msDelay?: number, ...args: Args): number;
+/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/clearTimeout) */
+declare function clearTimeout(timeoutId: number | null): void;
+/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/setInterval) */
+declare function setInterval(callback: (...args: any[]) => void, msDelay?: number): number;
+/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/setInterval) */
+declare function setInterval(callback: (...args: Args) => void, msDelay?: number, ...args: Args): number;
+/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/clearInterval) */
+declare function clearInterval(timeoutId: number | null): void;
+/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/queueMicrotask) */
+declare function queueMicrotask(task: Function): void;
+/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/structuredClone) */
+declare function structuredClone(value: T, options?: StructuredSerializeOptions): T;
+/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/reportError) */
+declare function reportError(error: any): void;
+/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/fetch) */
+declare function fetch(input: RequestInfo | URL, init?: RequestInit): Promise;
+declare const self: ServiceWorkerGlobalScope;
+/**
+* The Web Crypto API provides a set of low-level functions for common cryptographic tasks.
+* The Workers runtime implements the full surface of this API, but with some differences in
+* the [supported algorithms](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/#supported-algorithms)
+* compared to those implemented in most browsers.
+*
+* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/)
+*/
+declare const crypto: Crypto;
+/**
+* The Cache API allows fine grained control of reading and writing from the Cloudflare global network cache.
+*
+* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)
+*/
+declare const caches: CacheStorage;
+declare const scheduler: Scheduler;
+/**
+* The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
+* as well as timing of subrequests and other operations.
+*
+* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
+*/
+declare const performance: Performance;
+declare const Cloudflare: Cloudflare;
+declare const origin: string;
+declare const navigator: Navigator;
+interface TestController {
+}
+interface ExecutionContext {
+ waitUntil(promise: Promise): void;
+ passThroughOnException(): void;
+ readonly props: Props;
+}
+type ExportedHandlerFetchHandler = (request: Request>, env: Env, ctx: ExecutionContext) => Response | Promise;
+type ExportedHandlerTailHandler = (events: TraceItem[], env: Env, ctx: ExecutionContext) => void | Promise;
+type ExportedHandlerTraceHandler = (traces: TraceItem[], env: Env, ctx: ExecutionContext) => void | Promise;
+type ExportedHandlerTailStreamHandler = (event: TailStream.TailEvent, env: Env, ctx: ExecutionContext) => TailStream.TailEventHandlerType | Promise;
+type ExportedHandlerScheduledHandler = (controller: ScheduledController, env: Env, ctx: ExecutionContext) => void | Promise;
+type ExportedHandlerQueueHandler = (batch: MessageBatch, env: Env, ctx: ExecutionContext) => void | Promise;
+type ExportedHandlerTestHandler = (controller: TestController, env: Env, ctx: ExecutionContext) => void | Promise;
+interface ExportedHandler {
+ fetch?: ExportedHandlerFetchHandler;
+ tail?: ExportedHandlerTailHandler;
+ trace?: ExportedHandlerTraceHandler;
+ tailStream?: ExportedHandlerTailStreamHandler;
+ scheduled?: ExportedHandlerScheduledHandler;
+ test?: ExportedHandlerTestHandler;
+ email?: EmailExportedHandler;
+ queue?: ExportedHandlerQueueHandler;
+}
+interface StructuredSerializeOptions {
+ transfer?: any[];
+}
+declare abstract class Navigator {
+ sendBeacon(url: string, body?: BodyInit): boolean;
+ readonly userAgent: string;
+ readonly hardwareConcurrency: number;
+ readonly language: string;
+ readonly languages: string[];
+}
+interface AlarmInvocationInfo {
+ readonly isRetry: boolean;
+ readonly retryCount: number;
+}
+interface Cloudflare {
+ readonly compatibilityFlags: Record;
+}
+interface DurableObject {
+ fetch(request: Request): Response | Promise;
+ alarm?(alarmInfo?: AlarmInvocationInfo): void | Promise;
+ webSocketMessage?(ws: WebSocket, message: string | ArrayBuffer): void | Promise;
+ webSocketClose?(ws: WebSocket, code: number, reason: string, wasClean: boolean): void | Promise;
+ webSocketError?(ws: WebSocket, error: unknown): void | Promise;
+}
+type DurableObjectStub = Fetcher & {
+ readonly id: DurableObjectId;
+ readonly name?: string;
+};
+interface DurableObjectId {
+ toString(): string;
+ equals(other: DurableObjectId): boolean;
+ readonly name?: string;
+}
+declare abstract class DurableObjectNamespace {
+ newUniqueId(options?: DurableObjectNamespaceNewUniqueIdOptions): DurableObjectId;
+ idFromName(name: string): DurableObjectId;
+ idFromString(id: string): DurableObjectId;
+ get(id: DurableObjectId, options?: DurableObjectNamespaceGetDurableObjectOptions): DurableObjectStub;
+ getByName(name: string, options?: DurableObjectNamespaceGetDurableObjectOptions): DurableObjectStub;
+ jurisdiction(jurisdiction: DurableObjectJurisdiction): DurableObjectNamespace;
+}
+type DurableObjectJurisdiction = "eu" | "fedramp" | "fedramp-high";
+interface DurableObjectNamespaceNewUniqueIdOptions {
+ jurisdiction?: DurableObjectJurisdiction;
+}
+type DurableObjectLocationHint = "wnam" | "enam" | "sam" | "weur" | "eeur" | "apac" | "oc" | "afr" | "me";
+type DurableObjectRoutingMode = "primary-only";
+interface DurableObjectNamespaceGetDurableObjectOptions {
+ locationHint?: DurableObjectLocationHint;
+ routingMode?: DurableObjectRoutingMode;
+}
+interface DurableObjectClass<_T extends Rpc.DurableObjectBranded | undefined = undefined> {
+}
+interface DurableObjectState {
+ waitUntil(promise: Promise): void;
+ readonly props: Props;
+ readonly id: DurableObjectId;
+ readonly storage: DurableObjectStorage;
+ container?: Container;
+ blockConcurrencyWhile(callback: () => Promise): Promise;
+ acceptWebSocket(ws: WebSocket, tags?: string[]): void;
+ getWebSockets(tag?: string): WebSocket[];
+ setWebSocketAutoResponse(maybeReqResp?: WebSocketRequestResponsePair): void;
+ getWebSocketAutoResponse(): WebSocketRequestResponsePair | null;
+ getWebSocketAutoResponseTimestamp(ws: WebSocket): Date | null;
+ setHibernatableWebSocketEventTimeout(timeoutMs?: number): void;
+ getHibernatableWebSocketEventTimeout(): number | null;
+ getTags(ws: WebSocket): string[];
+ abort(reason?: string): void;
+}
+interface DurableObjectTransaction {
+ get(key: string, options?: DurableObjectGetOptions): Promise;
+ get(keys: string[], options?: DurableObjectGetOptions): Promise