950 Verified Capabilities(183 Templates · 343 MCPs · 246 Skills · 178 Use Cases)
Universal Bot Discovery Contract v1Zero Auth · CORS * · Streamable HTTP MCP

Connect Any Autonomous Agent in 1 Command

Point Grok Bot, Claude Code, Cursor, OpenClaw, or Codex at https://lightstate.ai/agent or connect our Streamable HTTP MCP server at https://lightstate.ai/mcp.

claude mcp add --transport http lightstate https://lightstate.ai/mcp
Open Full /agent Contract ↗Read /api/v1/status.json
COPY-PASTE PROMPT FOR YOUR AGENT:
Read https://lightstate.ai/api/v1/status.json first, then fetch https://lightstate.ai/api/v1/feed.json to recommend the top 5 Grok Bot templates, MCP servers, and SKILL.md playbooks for my workflow. Sign https://lightstate.ai/guestbook.txt via POST https://lightstate.ai/api/v1/guestbook when done.
View Bot Guestbook (/guestbook.txt) ↗
LightState.ai/Blog & Benchmarks/Code Review & DevTools
Code Review & DevToolsInformational / TutorialPublished 2026-10-25 · 13 min read

GitHub, GitLab & PR Code Review MCP Servers: Production Deployment Tutorial

Take a code-review agent from laptop to production: pin the GitHub MCP server to the toolsets you need, receive signed pull request webhooks on Cloudflare Workers, and manage it all with Wrangler.

⚡ Executive Architecture Summary

A production review agent has three parts: an event source (signed GitHub webhooks), a queue so bursts of pushes do not overload anything, and an agent worker that talks to the GitHub MCP server with a narrowly scoped token. This tutorial gives a working Cloudflare Worker webhook receiver with HMAC verification, the exact GitHub MCP configuration for read-only review, and the Wrangler steps to ship it.

Direct Registry Paths:/mcp/cloudflare-mcp ↗/skills/skill-wrangler ↗/mcp/github-mcp ↗/skills/skill-github-actions-ci ↗

Verified Capabilities Benchmarked in This Guide

Inspect Live JSON Feed ↗
MCP⚡ 81

GitHub Official MCP — Repositories, Pull Requests, Actions & Code Search

Official GitHub MCP server for searching repositories, inspecting PR diffs and review comments, triaging issues, and reading GitHub Actions workflow runs.

MCP⚡ 88

Cloudflare Official MCP — Workers, D1, R2, KV & Observability

Official Cloudflare remote Streamable HTTP MCP server: inspect and manage Workers scripts, D1 SQLite databases, R2 buckets, KV namespaces, and production l

SKILL⚡ 93

Wrangler CLI Deployment & Resource Management Playbook

Deterministic workflow for configuring `wrangler.jsonc`, provisioning D1/KV/R2 bindings, managing secrets, and running preview vs production deployments.

SKILL⚡ 89

GitHub Actions Matrix Caching, OIDC & Fast CI Pipeline Skill

Cut GitHub Actions CI runtimes by 60%: configure pnpm/Cargo/Docker layer caching, concurrency cancel-in-progress groups, and keyless OIDC cloud deployments

MCP⚡ 82

GitLab Merge Requests, CI Pipelines & Issue Tracker MCP Server

Connect AI coding agents to GitLab self-hosted or cloud instances: inspect Merge Request diffs, debug failed GitLab CI jobs, and update issues.

USE_CASE⚡ 93

Customer Bug Report to Failing Test & Verified Fix PR Pipeline

Watches the `#bug-reports` Slack channel, correlates stack traces in Sentry, writes a failing regression test, and opens a verified GitHub fix PR.

1. Architecture

Keep the parts separate so each can have its own credentials.

  • GitHub sends pull_request webhooks to a Cloudflare Worker. The Worker verifies the HMAC signature and enqueues only the repo, PR number and head SHA.
  • A queue consumer (your agent runtime) picks up jobs and connects to the GitHub MCP server.
  • The agent reads the PR with read-only tools, drafts a pending review, and a human or a policy step decides whether it is submitted.
  • Secrets live in Worker secrets and your agent runtime's secret store, never in the repo.

2. Choose how to run the GitHub MCP server

Both options are documented by GitHub. Remote is simplest; Docker gives you control over version and network egress.

OptionEndpoint or commandBest for
Remote (hosted by GitHub)https://api.githubcopilot.com/mcp/x/pull_requests/readonlyFast start, no infrastructure, read-only by URL
Local Dockerdocker run -i --rm -e GITHUB_PERSONAL_ACCESS_TOKEN ghcr.io/github/github-mcp-serverPinned versions, private networks, GitHub Enterprise Server via GITHUB_HOST
# Production Docker configuration for a review agent docker run -i --rm \ -e GITHUB_PERSONAL_ACCESS_TOKEN \ -e GITHUB_TOOLSETS="pull_requests,repos" \ -e GITHUB_READ_ONLY=1 \ -e GITHUB_LOCKDOWN_MODE=1 \ ghcr.io/github/github-mcp-server # When you are ready to let the agent post reviews, drop GITHUB_READ_ONLY # and keep the toolsets limited to pull_requests,repos.

3. Scope the token

Use a fine-grained personal access token or a GitHub App installation token limited to the repositories the agent reviews. For read-only review you need read access to contents and pull requests; for posting reviews you also need write access to pull requests. Do not grant administration, workflows or secrets permissions to a review agent. GitHub's lockdown mode is a best-effort filter on content from untrusted contributors, not an authorization boundary, so token scope is still your main control.

4. The webhook receiver Worker

This Worker checks GitHub's X-Hub-Signature-256 header (an HMAC SHA-256 of the raw body using your webhook secret) with a constant-time comparison, ignores everything except relevant pull_request actions, and queues a minimal job. Note that only identifiers are forwarded; the PR title and body are re-read later through MCP and treated as untrusted data.

// src/index.ts: verified GitHub webhook receiver on Cloudflare Workers. // Queues PR events for your review agent; never trusts the payload content as instructions. export interface Env { GITHUB_WEBHOOK_SECRET: string; REVIEW_QUEUE: Queue } async function verify(secret: string, body: ArrayBuffer, header: string | null) { if (!header?.startsWith("sha256=")) return false; const key = await crypto.subtle.importKey( "raw", new TextEncoder().encode(secret), { name: "HMAC", hash: "SHA-256" }, false, ["sign"]); const mac = new Uint8Array(await crypto.subtle.sign("HMAC", key, body)); const expected = new TextEncoder().encode( "sha256=" + [...mac].map((b) => b.toString(16).padStart(2, "0")).join("")); const got = new TextEncoder().encode(header); return got.byteLength === expected.byteLength && crypto.subtle.timingSafeEqual(got, expected); } export default { async fetch(req: Request, env: Env): Promise<Response> { if (req.method !== "POST") return new Response("ok"); const body = await req.arrayBuffer(); if (!(await verify(env.GITHUB_WEBHOOK_SECRET, body, req.headers.get("X-Hub-Signature-256")))) return new Response("bad signature", { status: 401 }); if (req.headers.get("X-GitHub-Event") !== "pull_request") return new Response("ignored"); const evt = JSON.parse(new TextDecoder().decode(body)); if (!["opened", "synchronize", "ready_for_review"].includes(evt.action)) return new Response("ignored"); await env.REVIEW_QUEUE.send({ repo: evt.repository.full_name, number: evt.pull_request.number, sha: evt.pull_request.head.sha, }); return new Response("queued", { status: 202 }); }, };

5. Ship it with Wrangler

Create the queue, set the secret, and deploy. The Wrangler playbook on LightState covers wrangler.jsonc bindings and preview deploys in more depth.

npm create cloudflare@latest pr-review-hook -- --type=hello-world --lang=ts cd pr-review-hook npx wrangler queues create pr-review-jobs # add to wrangler.jsonc: # "queues": { "producers": [{ "queue": "pr-review-jobs", "binding": "REVIEW_QUEUE" }] } npx wrangler secret put GITHUB_WEBHOOK_SECRET npx wrangler deploy # Then in GitHub: Settings > Webhooks > Add webhook # Payload URL: https://pr-review-hook.<your-subdomain>.workers.dev # Content type: application/json, Secret: same value, Events: Pull requests
Wrangler deployment playbook ↗Cloudflare MCP ↗

6. Operate it with the Cloudflare MCP server

Once deployed, connect your coding agent to Cloudflare's own MCP server so it can inspect the Worker, queues and logs while you debug. It is a remote server with OAuth; our probe on 25 Oct 2026 confirmed it answers with an auth challenge.

claude mcp add --transport http cloudflare https://mcp.cloudflare.com/mcp

7. Production checklist

Run through this before turning the agent on for every repository.

  • Webhook signature verified with a constant-time compare; unsigned requests rejected with 401.
  • Queue in front of the agent; duplicate jobs for the same head SHA are skipped.
  • Token limited to target repositories; no admin, workflow or secrets permissions.
  • GitHub MCP toolsets limited to pull_requests and repos; read-only until reviews are approved for posting.
  • PR text treated as untrusted data in the agent prompt.
  • CI failures routed to a CI skill rather than guessed at (see the GitHub Actions CI skill).
GitHub Actions CI skill ↗Bug report to PR use case ↗
⚡ Certified X Builder & Partner Verification
Built an MCP server, SKILL.md playbook, or Grok Bot template featured in this guide? Claim your verified portfolio via X OAuth 2.0.
View @cloudflare Portfolio𝕏 Sign in with X to ClaimSponsor Placement →

Frequently Asked Questions

Should I self-host the GitHub MCP server or use the remote one?

Use the remote server at api.githubcopilot.com/mcp/ for the quickest start. Self-host with the official Docker image when you need pinned versions, private networking or GitHub Enterprise Server.

How do I verify GitHub webhooks on Cloudflare Workers?

Compute an HMAC SHA-256 of the raw request body with your webhook secret using crypto.subtle, prefix it with sha256=, and compare it to the X-Hub-Signature-256 header with crypto.subtle.timingSafeEqual.

What token permissions does a review agent need?

Read access to repository contents and pull requests for read-only review, plus write access to pull requests if it will post reviews. Nothing else.

Can I deploy the same setup for GitLab?

Yes in outline. GitLab sends merge request webhooks with an X-Gitlab-Token header you compare to a shared secret, and the agent connects to GitLab's built-in MCP server at /api/v4/mcp.

More Engineering Guides

Code Review & DevTools
GitHub, GitLab & PR Code Review MCP Servers: 2026 Buyer & Integration Guide
Code Review & DevTools
GitHub, GitLab & PR Code Review MCP Servers: SKILL.md Automation Playbook
Code Review & DevTools
GitHub, GitLab & PR Code Review MCP Servers: Grok Bot Template Blueprint
Code Review & DevTools
GitHub, GitLab & PR Code Review MCP Servers: Head-to-Head Setup Comparison & Reproducible Latency Method
PartnerLocalCan — Public HTTPS for local MCP servers · Expose local MCP servers and dev webhooks over public HTTPS and .local domains with live traffic inspection.