Rebasely Beta: data may be purged

examplesMCP-tools Public

Concepts

How this repository is built and why: its architecture and its notes, from the .rebasely folder, for people and agents.

Architecture

From .rebasely/architecture/system.yaml at fcaf000: 3 components, 2 connections in this view.

What runs on Cloudflare and the storage it touches, without the libraries.

Select a component to see what it talks to.

Markdown in .rebasely/kb/. Add a folder or a file there to add a note.

mcp-tools knowledge base

mcp-tools is a small MCP server on Cloudflare Workers. Three read-only tools (convert_units, time_in_zone, text_stats) answer from their input alone; the Worker serves them over Streamable HTTP at /mcp and counts calls in KV.

How it works

  • Tool design: what every tool has (name, description for the model, schemas, structured output) and how failures reach the model.
  • The HTTP transport: how a POST to /mcp becomes an MCP response, and what the Worker does around it.
  • Usage counts: what /stats counts, where, and how far to trust it.

Why it is this way

How to

Components

  • mcp-server Worker

    The Worker. Serves MCP over Streamable HTTP at /mcp, statelessly: each POST gets a fresh McpServer with every tool registered. Also counts tool calls and serves them at /stats.

    Owns
    src/index.ts, src/worker.ts, src/server.ts, src/usage.ts
    Talks to
    tools (import), usage (kv)
  • tools Library

    The tools themselves: a name, a description written for models, zod input and output schemas and a pure run function each. No MCP, HTTP or bindings in here.

    Owns
    src/tools/**
    Used by
    mcp-server (import)
  • usage KV namespace

    Calls and errors per tool per UTC day, kept 90 days. Approximate by design.

    Binding
    USAGE
    Used by
    mcp-server (kv)