How to let an AI assistant schedule your GitHub merges, safely
AI coding assistants already open pull requests for you. The next step is asking them to get the change live: "schedule PR 42 for 11 pm tonight". With the Model Context Protocol (MCP), an assistant can call tools on another service, so this is possible today. It is also a way to ship something you did not mean to, so the setup matters.
What can go wrong
- The assistant merges at the wrong time. A time like "11 pm" is ambiguous without a time zone.
- It ships code nobody reviewed, or code that changed after it was approved.
- Text it reads can steer it. Pull request titles and error messages are written by other people, and an assistant may treat them as instructions.
- A leaked key lets anyone do what the key can do.
- A loop or a retry schedules the same merge twice.
A safe setup
- Give the assistant the smallest key that does the job: a read-only key if you only want a summary, a schedule key if it should schedule. Never give it admin access.
- Keep human approval switched on in your repo rules, so a pull request still needs a real review before it can be scheduled.
- Pin the commit. A scheduled merge should be cancelled if anyone pushes after it was scheduled.
- Always send times with a UTC offset and have the assistant repeat the time back to you in your own time zone.
- Let your client ask before running a tool that changes something, and read what it will do.
- Make retries safe with an idempotency key, set an expiry on the key, and revoke it when you stop using it.
How Merge Scheduler's MCP server does it
The server uses the same API keys as the REST API, and a key acts as the person who made it. A read key sees only the read tools. Nothing exposed to an assistant can change repo rules, billing, members or keys. Scheduling refuses what the app refuses, so a pull request that needs an approving review comes back with the reason instead of being scheduled. Times without a UTC offset are refused, the commit is pinned, and every call is listed in the workspace's API activity.
Connecting one
Clients that only connect through a sign-in page cannot use the server yet. Setup differs by client, so check your assistant's current instructions.
- Create a key in Settings, API keys (Pro and Team plans).
- Add the server address and the key to your assistant. In Claude Code, for example: claude mcp add --transport http merge-scheduler https://mergescheduler.gentlesoni.online/mcp --header "Authorization: Bearer $MS_KEY".
- Ask it to check a pull request first, then to schedule it. Check the time it repeats back.
- Look at Settings, API keys, Recent API activity to see what it did.
Prompts that work well
- "Check PR 42 in acme/api and tell me if anything blocks it."
- "Schedule PR 42 for 11 pm tonight, India time, and repeat the time to me in UTC."
- "What is scheduled for tonight, and has anything failed this week?"
Do this in Merge Scheduler: Schedule merges from the API or an AI assistant
Related: How to release stacked pull requests safely · Why a scheduled merge should pin the commit you approved