loopback

mcp
Guvenlik Denetimi
Basarisiz
Health Uyari
  • License — License: MIT
  • Description — Repository has a description
  • Active repo — Last push 0 days ago
  • Low visibility — Only 8 GitHub stars
Code Basarisiz
  • process.env — Environment variable access in cloudflare.config.ts
  • exec() — Shell command execution in scripts/checksums.ts
Permissions Gecti
  • Permissions — No dangerous permissions requested

Bu listing icin henuz AI raporu yok.

SUMMARY

Self-host Loopback, the inbox where you answer your coding agents, as one Cloudflare Worker.

README.md

Loopback

A self-hosted inbox where you answer your coding agents.

CI Licence: MIT

The Loopback inbox: a list of asks on the left, and on the right a question with two choices, one marked as recommended.

Your agent asks a question, shows you work to review, or tells you something. It appears in your
inbox. You answer there, and your answer goes back to the agent as the result of its tool call.

Loopback is an MCP server. It runs as one Worker on your own
Cloudflare account, and any agent that speaks MCP over HTTP can use it.

Deploy to Cloudflare

Prefer not to host it? Use the hosted version at loopback.tools.

Contents: Requirements · Deploy ·
Connect an agent · Tools · Configure ·
Update · Uninstall · More documentation

Requirements

  • A Cloudflare account. Loopback is built to fit the Workers
    Free plan (Free or Paid).
  • R2 turned on in that account. Loopback keeps images there. In the Cloudflare dashboard, open
    Storage & databases > R2 > Overview and complete the checkout. R2 has a
    free monthly amount, and use above it is billed.
  • A workers.dev address. A new account has none until you open Workers & Pages in the dashboard
    once.
  • openssl, or another way to make random tokens.

To deploy from your own machine rather than with the button, you also need:

  • Node 22.23+, 24.22+ or 26.12+.
  • pnpm 11.
  • git.

Deploy

Deploy with the button

Deploy to Cloudflare

  1. Make your two tokens.

    printf '{"owner":{"inbox":"%s","agents":"%s"}}\n' "$(openssl rand -hex 32)" "$(openssl rand -hex 32)"
    

    inbox is for you. It signs you in, and it can answer. agents is for your agents. It can ask,
    and it can't answer. Never give an agent your inbox token.

  2. Press the button. Cloudflare asks you to connect GitHub or GitLab, and copies this repository
    into your account there as a private repository.

  3. Keep the project name loopback. The Worker is named after it, and the deploy looks for
    loopback unless LOOPBACK_NAME says otherwise.

  4. Replace {} in LOOPBACK_TOKENS with what step 1 printed. Left as {}, the Worker refuses
    everyone.

  5. Create and deploy. Workers Builds runs pnpm run deploy, which creates one Worker, loopback,
    and one R2 bucket, loopback-files. It takes a few minutes.

  6. Open the Worker's address, which ends in workers.dev, and sign in with your inbox token. Save
    both tokens in a password manager.

On Workers Paid, add LOOPBACK_PLAN with the value paid under the Worker's Settings > Build >
Variables and secrets
, then retry the build (Free or Paid). The build reads its
settings from there, not from your shell.

Deploy from your machine

The commands are for a macOS or Linux shell. Run them all in the same terminal.

  1. Get the code and install it.

    git clone https://github.com/LoopBackTools/loopback.git
    cd loopback
    pnpm install
    
  2. Sign in to Cloudflare. This uses cf, Cloudflare's CLI,
    which the last step installed. It is in beta.

    pnpm exec cf auth login
    
  3. Choose the account to deploy to. whoami lists your accounts and their ids.

    pnpm exec cf auth whoami
    export CLOUDFLARE_ACCOUNT_ID=<your account id>
    
  4. Make your two tokens and save them in a file only you can read.

    (umask 077; printf 'LOOPBACK_TOKENS={"owner":{"inbox":"%s","agents":"%s"}}\n' \
      "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" > ~/loopback.secrets)
    

    inbox is for you. It signs you in, and it can answer. agents is for your agents. It can ask,
    and it can't answer. Never give an agent your inbox token.

  5. See what the deploy will do. This step changes nothing, and takes about a minute. The build prints
    some warnings. They are safe to ignore if it ends with Dry run: nothing was deployed.

    pnpm run deploy --dry-run --secrets-file ~/loopback.secrets
    
  6. Deploy.

    pnpm run deploy --secrets-file ~/loopback.secrets
    

    This takes about a minute and a half. It creates one Worker, loopback, and one R2 bucket,
    loopback-files. It prints your inbox's address, which ends in workers.dev, and finishes with
    Deployed loopback.

    If it stops partway, run the same command again.

  7. Open that address and sign in with your inbox token.

  8. Save both tokens in a password manager, then delete the file.

    rm ~/loopback.secrets
    

Connect an agent

You need your inbox's address and your agents token.

Claude Code

  1. Add Loopback for all your projects.

    export LOOPBACK_TOKEN=<your agents token>
    claude mcp add --scope user --transport http loopback https://<your-worker>/mcp \
      --header "Authorization: Bearer $LOOPBACK_TOKEN"
    
  2. Start a new session and say: "Ask me a test question through Loopback." The question appears in
    your inbox.

Don't install the Claude Code plugin with this
setup. The plugin signs in with OAuth, which a deployment that uses tokens doesn't have. It works
with the hosted version, and with a deployment behind
your own login.

Any MCP client

Loopback serves MCP over Streamable HTTP at /mcp. Most clients take a configuration like this:

{
	"mcpServers": {
		"loopback": {
			"type": "http",
			"url": "https://<your-worker>/mcp",
			"headers": { "Authorization": "Bearer <your-agents-token>" }
		}
	}
}

A call can wait minutes for your answer. Loopback sends a progress update every 25 seconds to keep
the call open. If your client has a fixed time limit for tool calls, raise it.

A client with MCP's Tasks extension (io.modelcontextprotocol/tasks) can carry on working while it
waits. ask_question, request_review and request_action then answer at once with a task. So do
update_ask when the next move is yours, send_update, and read_ask of a permission prompt.

Every deployment also serves /llms.txt, which tells an agent how to connect and how to use
Loopback.

Tools

Tool What it does
ask_question Asks you up to six questions, with or without choices.
request_review Shows you work. You approve it, ask for changes, or ask a question back.
request_action Asks you to do something outside the inbox. You mark it done, or say why you can't.
send_update Tells you something that needs no answer.
update_ask Answers what you asked back, or changes an ask that is already open.
close_ask Closes an ask that no longer needs you, and says why.
search_asks Finds past decisions and open asks.
read_ask Reads one ask in full.
create_upload Gives the agent a one-time command to upload an image or a video.
open_inbox Gives the agent the address of your inbox, or of one ask.

Five more are for the Claude Code plugin: review_plan, ask_permission, terminal_answered,
permission_denied and session_project.

Configure

Set these in the shell on every deploy. The deploy doesn't remember them.

Setting What it does
CLOUDFLARE_ACCOUNT_ID Required. The only account the deploy reads or changes.
LOOPBACK_PLAN Set to paid if you have Workers Paid (Free or Paid).
LOOPBACK_NAME The Worker's name, loopback unless you set it. The bucket is <name>-files.
LOOPBACK_INBOX_URL Serves the API alone, for an inbox of your own.
LOOPBACK_JWKS_URL Signs people in through your own login, instead of tokens. It needs other settings there.

Your tokens are different: the Worker keeps them between deploys.

Free or Paid

On Workers Free, an agent's call waits up to 10 minutes for you. The agent is then told to call
again, and it picks up the same question. On Workers Paid the call waits until you answer:

LOOPBACK_PLAN=paid pnpm run deploy

Workers Free allows 10 ms of CPU for each request. Most requests take 2 to 9 ms. The first request
after an idle time, and a question that waits, take 20 to 65 ms. We tested a copy limited to 10 ms on
Workers Paid, and it let those through. We haven't measured it on Workers Free itself. To check your
own changes, see the CPU check.

Give someone access

  1. Make two more tokens with openssl rand -hex 32.

  2. Write a secrets file with everyone in it, yourself included:

    LOOPBACK_TOKENS={"owner":{"inbox":"<token>","agents":"<token>"},"ada":{"inbox":"<token>","agents":"<token>"}}
    
  3. Deploy with that file, then delete it:

    pnpm run deploy --secrets-file ~/loopback.secrets
    

Each person sees only what their own agents ask, until someone shares an ask with them.

To remove someone, delete their entry and deploy again with the file. Their tokens stop working, and
their asks stay. To delete their asks and images too:

pnpm remove-person ada

Operating Loopback has the details.

Update

Deployed with the button: the button's copy is a repository of its own, not a fork. Pull this
repository's main into it and push. The push deploys again through Workers Builds.

git clone <your copy's URL> loopback && cd loopback
git remote add upstream https://github.com/LoopBackTools/loopback.git
git pull upstream main
git push

Deployed from your machine: run these in the loopback folder, with CLOUDFLARE_ACCOUNT_ID and your other settings set:

git pull
pnpm install
pnpm run deploy --dry-run
pnpm run deploy

Your asks, images and tokens are kept. Use pnpm run deploy, and never cf deploy on its own: the
script checks the account first and keeps your image bucket. It refuses an install it can't update,
and says why.

CHANGELOG.md lists what changed.

Uninstall

This deletes every ask and every image. You need jq, and
CLOUDFLARE_ACCOUNT_ID set. If you deployed under another name, set LOOPBACK_NAME too.

  1. Delete the Worker. cf asks you to confirm.

    pnpm exec cf workers delete "${LOOPBACK_NAME:-loopback}"
    
  2. Empty the bucket. Run this block again until it prints [].

    bucket="${LOOPBACK_NAME:-loopback}-files"
    keys=$(pnpm exec cf r2 objects list --bucket-name "$bucket" | jq -c 'map(.key)')
    echo "$keys"
    [ -z "$keys" ] || [ "$keys" = "[]" ] || pnpm exec cf r2 objects bulk-delete --bucket-name "$bucket" --body "$keys"
    

    If it prints an empty line, the list failed. The reason is above it.

  3. Delete the bucket.

    pnpm exec cf r2 buckets delete "$bucket"
    
  4. Check that both are gone. Your inbox's address should answer 404, and this list shouldn't show the
    bucket.

    pnpm exec cf r2 buckets list --per-page 1000
    

In a script, where nobody can confirm, add --force to each delete command.

More documentation

Help and contributing

Licence

MIT

Yorumlar (0)

Sonuc bulunamadi