v0.1 alpha · Open source · AGPL-3.0

Tiny functions, composed by anyone , including the agents in your stack

hostfunc is a TypeScript function platform built for the post-LLM era. Deploy from your editor, your CLI, or directly from a Claude conversation. Compose functions into systems. Watch the lineage graph fill in live.

Cloudflare Workers runtime·MCP-native·AGPL-3.0·TypeScript-first·Self-hostable
weather-digest.ts
1
Agent-native

The first function platform built for agents.

Connect Claude (or any MCP client) to your hostfunc org. The LLM can list, read, write, run, and debug functions as tools. It can even create scratch functions that auto-delete after a TTL — perfect for one-off computations that shouldn't pollute your namespace.

claude · connected to hostfunc
/dashboard/lineagelive
Lineage diagramclaudescratch-9k2xhn-topai-summarize

MCP server, not bolt-on

The same handlers the dashboard uses. No glue layer, no impedance mismatch.

Ephemeral scratch functions

create_scratch_function returns a result and self-destructs on a TTL. The feature nobody else has.

Live lineage tracking

Every fn.executeFunction call is recorded. Watch agents compose your graph in real time.

Triggers

Four ways in. All unified.

HTTP for webhooks, cron for schedules, email for inbound mail, MCP for agents. Every trigger flows through the same dispatch path — same secrets, same observability, same egress control.

HTTP

Every deployed function gets a stable run URL. Call it with curl, wire it to a webhook, route it through your CDN.

curl -X POST https://hostfunc.io/run/you/process \
  -H "content-type: application/json" \
  -d '{"event":"order.created"}'
Composition

Functions calling functions, with lineage you can see.

fn.executeFunction is a first-class primitive — depth-tracked, cycle-detected, and recorded in the execution graph. The lineage view reads parent_execution_id and renders edges weighted by call volume, colored by error rate.

share-link.ts
1
/dashboard/lineagelive
Lineage diagramshare-linkurl-metadataai-summarizeslack-notifyurl-fetch
Terminal-first

Deploy from where you already work.

The `hostfunc` CLI is an MCP client. Same auth, same rate limits, same audit trail. Init a project, deploy, run, tail logs — all from your shell.

$npm i -g @hostfunc/cli
~/projects/weather-digest
Built for scale

One control plane. Six edge workers. Zero ops.

Your dashboard, MCP server, and metadata live in a Next.js control plane. User functions run as isolated V8 scripts inside a Cloudflare Workers for Platforms dispatch namespace. Every fetch from user code passes through an outbound worker that filters SSRF and counts egress. Logs ship via tail worker to Postgres in <2s.

01

Request

POST /run/you/fn arrives at the edge.

02

Dispatch

Lookup cached in KV; signed exec token issued.

03

User script

Runs in isolated V8 with per-script CPU + memory caps.

04

Outbound

Every fetch SSRF-filtered and byte-counted.

05

Tail

Logs and metrics shipped to Postgres in real time.

Connectors

One-click OAuth. Tokens stored, secrets shared.

Click 'Connect GitHub'. Token is stored as an org secret. Any function — or any agent acting on your behalf — can call the API. More providers shipping weekly.

GitHub
live
Gmail
soon
Slack
soon
Linear
soon
Notion
soon
Stripe
soon
Templates

Don't start from blank. Fork it.

A curated gallery of starting points with secrets and triggers pre-wired. One click, you're in your editor with working code.

👋Utilities

Hello world

The minimal starter — typed input, structured logging, JSON out.

typescript
import fn from "@hostfunc/sdk";

// HTTP endpoint. POST { "name": "Ada" } — or GET ?name=Ada
export async function main(input: { name?: string }) {
  const name = input.name?.trim() || "world";
  fn.log("info", "hello.invoked", { name });

  return {
    message: `hello, ${name}`,
    invokedAt: new Date().toISOString(),
  };
}
🤖Ai

AI text summarizer

Condense long text into a few sentences with the built-in AI.

typescript
import fn from "@hostfunc/sdk";
import { askAi } from "@hostfunc/sdk/ai";

// HTTP endpoint. POST { "text": "...", "sentences": 3 }
export async function main(input: { text?: string; sentences?: number }) {
  const text = input.text?.trim();
  if (!text) {
    return { summary: "", note: "Provide 'text' to summarize." };
  }

  const sentences = Math.min(Math.max(input.sentences ?? 3, 1), 8);
  const answer = await askAi(text, {
    system: `Summarize the user's text in at most ${sentences} sentences. Be factual and concise.`,
    maxTokens: 400,
  });

  fn.log("info", "summary.created", { inputChars: text.length });
  return { summary: answer.text, model: answer.model, usage: answer.usage };
}
💬Integrations

Slack notifier

Post formatted alerts to a Slack channel via an incoming webhook.

typescript
import fn, { secret } from "@hostfunc/sdk";

// HTTP endpoint. POST { "text": "Deploy finished", "title": "CI", "level": "info" }
// Secret: SLACK_WEBHOOK_URL — a Slack incoming-webhook URL.
export async function main(input: { text?: string; title?: string; level?: string }) {
  if (!input.text) {
    throw new Error("Provide 'text' to send to Slack.");
  }

  const emoji =
    input.level === "error"
      ? ":red_circle:"
      : input.level === "warn"
        ? ":warning:"
        : ":white_check_mark:";

  const webhookUrl = await secret.getRequired("SLACK_WEBHOOK_URL");
  const res = await fetch(webhookUrl, {
    method: "POST",
    headers: { "content-type": "application/json" },
    body: JSON.stringify({
      text: `${emoji} *${input.title ?? "Notification"}*: ${input.text}`,
    }),
  });

  fn.log(res.ok ? "info" : "error", "slack.notified", { status: res.status });
  return { ok: res.ok, status: res.status };
}
📥Webhooks

Webhook inspector

Catch, log, and echo any inbound webhook to see exactly what it sends.

typescript
import fn from "@hostfunc/sdk";

// HTTP endpoint. Point any webhook here to inspect its payload.
export async function main(input: Record<string, unknown>) {
  const keys = Object.keys(input ?? {});
  fn.log("info", "webhook.received", { keyCount: keys.length, keys });

  return {
    ok: true,
    receivedAt: new Date().toISOString(),
    payloadKeys: keys,
    payload: input,
  };
}
Capabilities

Everything you need. Nothing you don't.

The bundle of capabilities you actually use to ship — without the kitchen-sink platform tax.

Web editor with live deploy

Monaco-based, full TypeScript support, deploy in ~3 seconds with one click.

VS Code extension

Browse, deploy, and run your functions without leaving your editor. Sign in from the browser, stream logs inline, switch workspaces in a click.

Host websites, not just APIs

Ship an index.html with your function — hostfunc serves it as a real web page at your URL, with CSS, JS, and images included.

Custom domains, auto SSL

Point your own domain at any website. Add a DNS record and hostfunc provisions and renews the certificate automatically.

Encrypted secrets

AES-256-GCM at rest. Fetched at execution time over a signed callback. Never in bindings.

Live log streaming

SSE-backed log panel that updates as your function runs. No refresh needed.

OAuth connectors

Click 'Connect GitHub'. Token stored as an org secret. Any function in the org can use it.

Cron + email triggers

5-field cron expressions. Cloudflare Email Routing for inbound mail. Both unified through one observability pipeline.

Lineage graph

Every fn-to-fn call recorded. React Flow visualization with edge weights and error coloring.

Template gallery

Curated starting points: HN digest, uptime monitor, AI summarizer, GitHub lookup, more.

Per-execution metrics

CPU, wall, memory, egress, subrequests — captured for every invocation.

Self-hostable

git clone && docker compose up. Bring your own Cloudflare account.

Pricing

Clear limits. Predictable scale.

Start free, grow into higher execution and runtime ceilings as your automations mature.

Free

$0/month

Great for personal projects and first workflows.

100 executions / day
1 workspace
1 team member
10s wall · 1s CPU · 128MB memory
Get started

Pro

$5/month
Popular

For production side projects and independent teams.

2,000,000 executions / day
Up to 3 workspaces
Up to 6 team members
120s wall · 20s CPU · 512MB memory
Get started

Team

$25/month

For high-volume workloads across many teams.

20,000,000 executions / day
Unlimited workspaces
Up to 50 team members
600s wall · 120s CPU · 2048MB memory
Get started
Open source

AGPL-3.0. Yours to fork.

If you're running it for yourself, AGPL asks nothing. If you're running a hosted version that competes with us, AGPL asks you to publish your changes. Fair trade.

License
AGPL-3.0
Status
Alpha
Stack
TypeScriptNext.js 16Cloudflare
Self-host
Docker Compose

Ship your first function in 90 seconds.

Sign in, drop in some TypeScript, hit deploy. The URL is live before you've finished reading this paragraph.