explaingit

estruyf/copilot-mock-server

Analysis updated 2026-05-18

1TypeScriptAudience · developerComplexity · 2/5Setup · easy

TLDR

A local proxy that intercepts GitHub Copilot Chat requests and returns scripted, deterministic responses for demos, recordings, and testing Copilot-integrated tools without hitting the real API.

Mindmap

mindmap
  root((copilot-mock-server))
    Core Purpose
      Intercept Copilot requests
      Return scripted responses
      Deterministic demos
    Transport Support
      WebSocket
      SSE HTTP POST
      HTTPS proxy mode
    Rule Features
      Keyword matching
      Multi-step sequences
      Tool call output
      Timing delays
    Modes
      Mock default
      Learning record mode
      Forward unmatched
    Setup
      npx no install
      VS Code settings inject
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Script exactly what Copilot says during a live demo so responses are always on point and load instantly.

USE CASE 2

Record a screencast of an AI coding session where Copilot performs specific file edits, using mock tool-call responses that VS Code renders as real.

USE CASE 3

Test a VS Code extension that reacts to Copilot Chat responses without spending API credits or hitting rate limits.

What is it built with?

TypeScriptNode.jsWebSocketSSEHTTPS proxy

How does it compare?

estruyf/copilot-mock-serverabidoo22/pixelorama-mcpaditya-pandey/slate
Stars111
LanguageTypeScriptTypeScriptTypeScript
Setup difficultyeasymoderateeasy
Complexity2/53/52/5
Audiencedevelopervibe codergeneral

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

Run via npx with no install, requires writing a JSON rules file and injecting proxy settings into VS Code.

No license information was found in the README.

In plain English

copilot-mock-server is a local proxy tool for developers who want to give demos or test tooling that uses GitHub Copilot Chat, without making live calls to the real Copilot API. When started and pointed at this server, the Copilot client intercepts the requests and returns scripted, pre-written answers instead of generating real AI responses. The core use case is deterministic demos: you write rules in a JSON file pairing keywords with responses. When a message contains those keywords, the mock server replies with your scripted text, streamed token by token just as Copilot would. This means screencasts or live presentations where Copilot always says exactly what you planned, with no risk of a surprise or slow response. The server handles both communication styles Copilot uses: WebSockets and HTTP server-sent events. It also works as an HTTPS interception proxy for command-line tools that respect the HTTPS_PROXY environment variable, so you can mock Copilot traffic beyond VS Code without changing code. Beyond simple scripted responses, the rules format supports multi-step sequences where Copilot appears to narrate, call tools like file creation, then narrate again, faking the look of an AI agent working through a task. Rules can include delays to simulate a thinking pause. Tool-call outputs are included, which VS Code renders as the AI actually executing file edits. A learning mode lets you record real Copilot responses while using the product normally, building up a library of actual responses to replay later. A list command prints all loaded rules before a demo so you can verify everything is correct. An option to forward unmatched prompts to the real Copilot API is also available. Setup is quick: run npx copilot-mock-server with no install required, write a rule file, and tell VS Code to proxy Copilot traffic to localhost. A helper command injects the needed VS Code settings automatically.

Copy-paste prompts

Prompt 1
Help me write a copilot-mock-server rules file that makes Copilot respond to the word 'test' with a multi-step sequence that creates a file and then explains what it did.
Prompt 2
I want to use copilot-mock-server for a demo where Copilot explains Kubernetes YAML. Walk me through writing the rule and setting a token delay so it looks natural on screen.
Prompt 3
Show me how to configure copilot-mock-server to forward unmatched prompts to the real Copilot API while still intercepting my scripted demo prompts.
Prompt 4
I want to use learning mode in copilot-mock-server to capture real Copilot responses and replay them offline. Walk me through the workflow step by step.

Frequently asked questions

What is copilot-mock-server?

A local proxy that intercepts GitHub Copilot Chat requests and returns scripted, deterministic responses for demos, recordings, and testing Copilot-integrated tools without hitting the real API.

What language is copilot-mock-server written in?

Mainly TypeScript. The stack also includes TypeScript, Node.js, WebSocket.

What license does copilot-mock-server use?

No license information was found in the README.

How hard is copilot-mock-server to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is copilot-mock-server for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Scan in gitsafehub Deploy in gitdeployhub estruyf on gitmyhub

Verify against the repo before relying on details.