Command Palette

Search for a command to run...

UnylyUnyly
Весь каталог

Codemode Workers

БесплатноНе проверен

Expose any API to an LLM agent as two sandboxed MCP tools (search + execute) on Cloudflare Workers.

GitHubEmbed

Описание

Expose any API to an LLM agent as two sandboxed MCP tools (search + execute) on Cloudflare Workers.

README

Expose any API to an LLM agent as two sandboxed MCP tools (search + execute) on Cloudflare Workers.

CI coverage npm version types included docs license MIT

Instead of registering thousands of tool schemas, you register two tools (search + execute). The catalog stays on the server; the agent writes JavaScript that runs in a fresh, sandboxed isolate. Same pattern as cloudflare-mcp, packaged for any API.

Docs: codemode-workers.pages.dev

Why

One tool per endpoint dumps every schema into the model's context. Code mode keeps the spec server-side and sends two tools, so the context cost stays flat however big the API is. Against the Urantia Papers API (58 endpoints):

Approach Tools Tokens
One tool per endpoint, full 58 3,489
Code mode 2 184

Run bun run eval:tokens <specUrl> to measure it for your own API.

Install

npm install codemode-workers

Bring your own MCP server SDK (e.g. @modelcontextprotocol/server). The library only needs a registerTool(name, config, cb).

Usage

// wrangler.jsonc
{
  "worker_loaders": [{ "binding": "LOADER" }],
  "services": [
    {
      "binding": "GATE_SELF",
      "service": "<your-worker>",
      "entrypoint": "Gate",
    },
  ],
}
import { exports } from 'cloudflare:workers'
import {
  createGate,
  processSpec,
  registerCodemodeTools,
} from 'codemode-workers'

export const Gate = createGate({ allowedHosts: ['api.example.com'] })

registerCodemodeTools(server, {
  loader: env.LOADER,
  catalog: {
    get: async () => processSpec(await (await fetch(SPEC_URL)).json()),
  },
  api: {
    baseUrl: 'https://api.example.com/v1',
    outbound: () =>
      exports.Gate({
        props: { headers: { Authorization: `Bearer ${env.API_TOKEN}` } },
      }),
  },
})

search runs code over your catalog with no network. execute calls the API through the gate, which allowlists your host and injects the credential that the agent never sees. Full walkthrough and API reference in the docs.

Security

The credential lives in the gate, outside the sandbox, so agent code cannot read the token or reach any host but yours. search has no network. Every call is a fresh isolate. Details and residual risks: codemode-workers.pages.dev/security.

Develop

bun install
bun run check   # typecheck + tests (workerd via @cloudflare/vitest-pool-workers)

License

MIT. See LICENSE.

from github.com/ancs21/codemode-workers

Установка Codemode Workers

У этого сервера нет опубликованного пакета — он собирается из исходников. Открой репозиторий и следуй инструкции в README.

▸ github.com/ancs21/codemode-workers

FAQ

Codemode Workers MCP бесплатный?

Да, Codemode Workers MCP бесплатный — установка в пару кликов через Unyly без оплаты.

Нужен ли API-ключ для Codemode Workers?

Нет, Codemode Workers работает без API-ключей и переменных окружения.

Codemode Workers — hosted или self-hosted?

Доступен hosted-вариант: Unyly запускает сервер в облаке, локальная установка не обязательна.

Как установить Codemode Workers в Claude Desktop, Claude Code или Cursor?

Открой Codemode Workers на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.

Похожие MCP

Compare Codemode Workers with

Не уверен что выбрать?

Найди свой стек за 60 секунд

Автор?

Embed-бейдж для README

Похожее

Все в категории ai