[Back to blogs]

How I became the single reason why GitHub Copilot is trash now.

DEV BLOG · MCP · 30/05/26


its been two months since github started implying rate limits on copilot users, it went out of limits on codex with just two or three medium-length tasks, they removed opus, sonnet and all other expensive models from the student plan, and copilot performance degraded.

this is the community discussion page on github which states that they're moving to usage based billing on and after june 1.

if you never used copilot, they let me give you the context, github education pack gives you a year of copilot pro, which gives you 300 monthly premium requests at the base rate, regardless of model. opus is now counted at 15x price, which was 3x before. this means, at 3x, i can send 100 messages on claude opus.

why? why did they not keep the old message based quota? wonder?

its because i abused it. i abused their free student plan and they simply went out of money. i played a dirty game on their own calculation system.

How did i abuse the message based pricing quota? and how you can too, if you know a provider that still does that.

a simple mcp server, three tools - enough to create this hack would help me work with almost infinite claude opus, all 30 days in the month, 24x7, even more usage than claude max 20x.

mcp was not designed for discrete interactions. it was designed for bidirectional streaming connections. i made my agent live forever

let me show you what i mean. i made an open-source project called infinite mcp that connects an mcp compatible host (vs code copilot, claude desktop, any mcp client) to a next.js chat dashboard via an http bridge. the agent connects once over stdio and never disconnects.

markdown

initialize(sessionId)
loop:
  payload = get_prompt(sessionId, timeoutSeconds)
  tasks(current=1, total=N, details="Planning")
  ... do work ...
  tasks(current=N, total=N, status="completed")
  output(message="Result", completed=true)
  // immediately loop back to get_prompt()

initialize(sessionId): the agent registers itself in a session; picks a name, a role, and tells the dashboard it exists. after this, the agent is visible in the ui's sidebar and ready to receive work.

the critical piece is get_prompt(). It holds the agent, via an unresolved promise until prompted in the session's queue via the next.js app. the agent registers as a waiter and goes to sleep. when the user (or another agent) sends a message, the bridge resolves the promise and the agent wakes up with the payload.

typescript

mcp.tool(
  "get_prompt",
  "Wait for and retrieve the next prompt or task from the external React/Next.js dashboard.",
  {
    sessionId: z.string().optional(),
    timeoutSeconds: z.number().int().positive().max(86400).optional(),
    ...
  },
  async ({ sessionId = "default", timeoutSeconds = 86400, ... }) => {
...

86400 seconds. twenty four hours. the agent sits in get_prompt() for an entire day, waiting for work, without ever being re invoked. the mcp connection stays open and the billing counter never moves because no new message was sent via the copilot sidebar in vs code.

other advantage was, github never actually implied timeouts in copilot for an mcp connection, like other coding agents, which is maximum of 5 minutes as default.

the output() tool description spells out the intent explicitly once the agent signals completion:

plaintext

> "CRITICAL: 
(1) Call this when task is done. 
(2) When completed=true, ALWAYS call get_prompt() immediately after to wait for next task. 
This creates the infinite loop."

it is the design.

the architecture that makes this possible is the http bridge. infinite mcp runs an express server on port 4317 that sits between the chat ui and the agent:

this is the agents.md

the agent's lifecycle is completely decoupled from the UI's lifecycle. The user can refresh the browser, close the tab, open a new one; the agent keeps running inside vs code, waiting in get_prompt(). from the billing system's perspective, there is exactly one long lived process. connected once, has never disconnected. it has generated zero new "conversations" even as it has completed dozens of tasks.

here's the skill i used along with the mcp:

markdown

# Infinite MCP Skill (Concise + Exact)

## Purpose

Use Infinite MCP as a perpetual task loop between VS Code Chat and the dashboard. Supports multi-agent collaboration with @mention routing, group chat, reactions, broadcast queues, and task assignment. Multi-agent features are toggled per-session with the `multiAgentEnabled` setting.

The canonical cycle is:

1. `get_prompt()` (use 30 mins timeout to wait for dashboard input)
2. Do work (optionally report `tasks()` progress)
3. `output(completed=true)`
4. Immediately call `get_prompt()` again

Never stop the loop unless explicitly instructed.

---

## Loop Contract (Required)

For each task:

1. Call `get_prompt()` and read `sessionId`. (3 hours timeout recommended)
2. Execute the request.
3. If reporting progress, call `tasks()` with `current` increasing step-by-step from `1` to `total`.
4. Call `output()` when done.
5. If `completed=true`, immediately call `get_prompt()` again.

Timeout from `get_prompt()` is not an error by itself; it usually means no new dashboard input yet.

---

## URL Session Joining

If the user pastes a session URL (e.g., `http://localhost:3000/session-abc123`) in chat, the agent MUST:
1. Extract the `sessionId` from the URL (last path segment, starts with `session-`).
2. Call `join_session({ sessionId: "session-abc123", name, role })` directly.
3. Do **NOT** call `create_session` — just join the existing session.

---

## Output URL Rule

When `multiAgentEnabled=true` and `output()` is called, include the session URL:

**Session:** http://localhost:3000/

## Minimal Execution Pattern

`get_prompt()` → work (+optional `tasks()`) → `output(completed=true)` → `get_prompt()` → repeat forever.

---

## Common Mistakes to Avoid

1. Sending `output()` without using the correct `sessionId`.
2. Skipping progress numbers (for example jumping `1 → 5`).
3. Forgetting to call `output()` for completed tasks.
4. Treating `get_prompt()` timeout as a hard failure.
5. Using unsupported `output` fields like `status`.
6. Assigning tasks to agents that don't exist (use `list_agents()` first).
7. Not checking agent status before assigning work.
8. Calling `create_session` when a session URL was already provided — just join it with `join_session()`.
9. Forgetting to include the session URL in `output()` when `multiAgentEnabled=true`.
10. Calling `send_message`/`react` when `multiAgentEnabled=false` (returns 403).

i want to be precise about what this means. if you ask it ten questions, the telemetry system records ten messages, counting into your monthly limit. but with this, you could send a thousand prompts through the dashboard and the agent processes all of them through a single session, and counts only one (1) message for initialization of the loop. the mcp host sees one tool call to get_prompt that ran for 48 hours. The billing system has no vocabulary for "one message that handled 500 tasks."

first, start the frontend web server:

it has all your projects and sessions you've worked on previously

then open vs code, add the mcp server

and prompt exactly this:

it made a new session and is waiting for the input

the message i sent in the next app, gets delivered to the agent via mcp

all of this, for a 0.33x cost message, that means, and you can spam it all day

Broadcast queues and multi agent amplifier

The pattern gets more interesting (and more problematic for billing models) when you enable multi-agent mode.

i implemented a broadcastMessage() function that delivers a message to every agent in a session simultaneously:

typescript

function broadcastMessage(payload: PromptPayload, fromAgentName: string): void {
  const sessionWaiters = promptWaiters.get(payload.sessionId) ?? [];
  const anyWaiters = promptWaiters.get(ANY_SESSION_WAITER) ?? [];
  const allWaiters = [...sessionWaiters, ...anyWaiters];
  const toNotify = allWaiters.filter(
    w => !w.agentName || w.agentName.toLowerCase() !== fromAgentName.toLowerCase()
  );

  for (const w of toNotify) {
    clearTimeout(w.timer);
    w.resolve({ ...payload });
  }
  // Queue for busy agents
  for (const [, agent] of registeredAgents.entries()) {
    if (notifiedNames.has(agent.name.toLowerCase())) continue;
    const queue = agentPersonalQueues.get(agentKey) ?? [];
    queue.push({ ...payload });
    agentPersonalQueues.set(agentKey, queue);
  }
}

every agent registered in the session gets the message. agents currently waiting in get_prompt() get it instantly; their promise resolves and they wake up. agents that are busy get the message queued in a personal per-agent-per-session queue. when they finish their current work and call get_prompt() again, the personal queue is checked first:

typescript

async function waitForPrompt(sessionId, timeoutMs, agentName) {
  if (agentName) {
    const personalKey = `${sessionId}:${agentName}`;
    const personalQueue = agentPersonalQueues.get(personalKey);
    if (personalQueue && personalQueue.length > 0) {
      return personalQueue.shift()!;
    }
  }
  ...
}

combining this with assign_task(), lets any agent delegate work to any other agent in the session. you can have a swarm of five specialized agents, one planning, one coding, one reviewing, one testing, one deploying, all delegating to each other through broadcast queues and personal queues. 5 long lived mcp connections. zero new messages per task. each agent handles hundreds of delegations within a single session that, from the outside, looks like five processes that started once and never stopped.

the billing system sees this as 5 messages. the actual work done could be thousands of tasks.

this is not a loophole in mcp. It is the correct use of the protocol. the per-message billing model is what's wrong.

i am not suggesting that everyone should rush to exploit this billing gap. but the fact that this pattern exists, that it works, and that it completely bypasses per-invocation metering.

bottomline

i hate you github for implying limits and removing free claude models for students but it was fun while it lasted. if you're reading this and if you know some other provider that uses the same message based billing, now its your chance to exploit them.

follow me on x dot com for more

original x article: https://x.com/forloopcodes/status/2060694305086599672