guildbridge CLAUDE.md

A project guide for GuildBridge, a server that lets AI tools perform controlled Discord actions. It documents the project structure, development commands, deployment, checks, authentication, and access rules.

In plain words
What is it for?
Use it when changing GuildBridge, especially its Discord tools, OAuth login, Cloudflare deployment, administration panel, or audit logging.
Why use it?
It gives coding agents the repository context they need to work consistently instead of guessing how the project is built or organized.

Instructions file

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/dend/guildbridge/claude-md
Clone the repo
git clone --depth 1 https://github.com/dend/guildbridge
Per session 1,065 This file is loaded in full into every session.
When invoked 1,065 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.01065 $0.01065
Opus 5 $0.00532 $0.00532
Sonnet 5 $0.00213 $0.00213
Haiku 4.5 $0.00106 $0.00106

Measured 2d ago against content hash a9dba39d9b65, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

guildbridge CLAUDE.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

CLAUDE.md · 71 lines

How it starts

The opening of the file, as written. The whole thing — 71 lines — stays where its author put it; the contents beside it link to each section on GitHub.

CLAUDE.md

Build & Check Commands

  • npm run dev — Start local dev server (port 8788)
  • npm run deploy — Deploy to Cloudflare Workers
  • npm run type-check — Run tsc --noEmit (no test suite exists)

Project Overview

GuildBridge is a remote MCP server deployed on Cloudflare Workers. It exposes Discord operations (read, search, post messages) as MCP tools. Authentication is via Discord OAuth; all Discord API calls use a bot token.

Architecture

  • src/index.ts — MCP server definition, tool handlers, access control logic (guild + channel)
  • src/discord-api.ts — Discord REST API wrappers, types, and permission computation
  • src/discord-handler.ts — Discord OAuth flow (Hono routes)
  • src/utils.ts — OAuth token exchange helpers, Props type (user identity stored in auth token)
  • src/workers-oauth-utils.ts — CSRF/session/state management
  • src/cf-access.ts — Cloudflare Access JWT validation middleware
  • src/admin.ts — Admin panel UI + API: Allowlist tab (KV), Activity tab (D1 audit log)
  • src/audit.ts — Tool-call audit: dual-write to D1 + Analytics Engine

Key Design Decisions

Access control is two-layered

  1. Guild membership — checked via the user's OAuth access token (listUserGuilds). Cached 60s.
  2. Channel visibility — computed using Discord's permission algorithm (computePermissions). Uses bot token to fetch guild roles, member roles, and channel permission overwrites. Cached 60s per guild.

Bot token vs user token

All Discord API calls use the bot token. The user's OAuth token is only used to verify guild membership (/users/@me/guilds with Bearer auth). This means the bot must be in any guild the user wants to access.

Permission computation follows Discord's algorithm

computePermissions in discord-api.ts implements the standard Discord permission resolution:

  1. Start with @everyone role permissions
  2. OR in member's role permissions
  3. Short-circuit if ADMINISTRATOR
  4. Apply channel-level overwrites: @everyone → roles → member-specific Guild owners bypass permission checks entirely.

Read the full file on GitHub · 71 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 71 lines · 1,065 tokens per session scan A a9dba39d9b65

Subscribe to this mod's changes

guildbridge CLAUDE.md is an instructions file published in the GitHub repository dend/guildbridge (16 stars, last pushed 4mo ago), licensed MIT. It adds 1,065 tokens to every session, about $0.0053 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other instructions, from other repositories

thalovant-mcp AGENTS.md

AGENTS.md instructions for thalovant/thalovant-mcp: This repository is a first-class consumer of the Thalovant control-plane and hub runtime APIs. Read the platform contracts in ../infra-manifests/docs/thalovant-platform/ when available.

thalovant/thalovant-mcp · 283 tokens

prism-mcp CLAUDE.md

Claude Code instructions for skyphusion-labs/prism-mcp, covering claude.md, what this is, relation to the stack, commands and deploy model.

skyphusion-labs/prism-mcp · 876 tokens

discord-mcp AGENTS.md

Instructions for cappyeo/discord-mcp, covering agents.md, 1. think before coding, 2. simplicity first, 3. surgical changes and 4. goal-driven execution.

cappyeo/discord-mcp · 521 tokens

mcp-agent-hub AGENTS.md

AGENTS.md instructions for avdiam/mcp-agent-hub, covering claude.md, what this is, current status: v1 feature-complete (2026-06-18), session continuity — read these first every session and layout (actual).

avdiam/mcp-agent-hub · 3,342 tokens

dataworkers-claw-community CLAUDE.md

Claude Code instructions for DataWorkersProject/dataworkers-claw-community, covering dataworkers — ai agent platform for data engineering, quick start, architecture, 10 mcp servers and seed data (demo tenant: cust-001).

DataWorkersProject/dataworkers-claw-community · 838 tokens

dataworkers-claw-community AGENTS.md

AGENTS.md instructions for DataWorkersProject/dataworkers-claw-community, covering data workers — agent instructions, what this repository is, the agents, working in this codebase and working with your data (as an agent using these tools).

DataWorkersProject/dataworkers-claw-community · 618 tokens