Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

Neon 5 min read How-to mediumAdept

How to Build GitHub Copilot Extensions

GitHub Copilot extensions are plain HTTP servers that GitHub calls whenever a user mentions the extension in Copilot Chat, so they can be written in any language. The walkthrough builds a Python FastAPI server whose POST /completion endpoint injects a system prompt, forwards the conversation to the Copilot chat completions API using the x-github-token header, and streams the response back as server-sent events. Registration means creating a GitHub App with read-only Copilot Chat and Editor Context permissions, setting its Copilot app type to Agent, and exposing the local server through an ngrok tunnel. Production extensions such as Neon's also need RAG, function calling and analytics, which the post pitches Layer's platform to handle.

Assumes: Python web serversHTTP APIsGitHub Apps

Related posts

  • Building a VSCode Chat Extension to Order Lunch

    Neon mediumAdept

    A VS Code Copilot chat participant can order Grubhub food by exposing reverse-engineered Grubhub endpoints as language model tools. Intercepting a real checkout with Chrome DevTools and Postman Interceptor showed that an order takes five calls: create cart, add line, set delivery info, attach payment, and checkout. Each endpoint becomes a JSON-schema tool declared in package.json and implemented with vscode.LanguageModelTool. The main lesson is that raw APIs make poor agent interfaces because they expose sessions and IDs that need extra calls, so they should be wrapped in simplified workflows.

  • Using the GitHub Copilot SDK for Java

    GitHub Engineering mediumAdept

    GitHub Copilot SDK for Java lets server-side Java code create agent sessions, register tools, send prompts and stream events without depending on Langchain4j or Spring AI, and with BYOK it can target OpenAI, Azure, Anthropic or compatible endpoints. A Jakarta EE 11 real-estate lead pipeline on Open Liberty demonstrates the core APIs: annotation-based tools via @CopilotTool (experimental, needs an annotation processor and compiler flag), inline lambda tools, section-level system message overrides, a one-line sendAndWait agentic loop, and session.on event streaming pushed over WebSocket. The key integration point is passing a ManagedThreadFactory-backed virtual-thread Executor so tool callbacks keep CDI, JNDI and transaction context, while ToolSet restricts which built-in tools each session can use in production.

  • Copilot x Zed

    Zed mediumAdept

    GitHub Copilot is now available in Zed v0.82, integrated by reusing the undocumented, minified Copilot LSP server shipped in the Neovim plugin, which Zed's built-in LSP support could drive directly. Supporting it required a new modal UI for Copilot's device-code OAuth flow and a 'suggestions' layer in Zed's DisplayMap that splices styled multi-line text into the buffer alongside folding and wrapping, covered by randomized testing. To keep it from being intrusive, Zed added per-language disable settings and a 75ms debounce, and gives the language's real LSP autocomplete priority over Copilot on conflicts.

  • Reusable Prompts: The Future of Starter Templates

    Neon mediumAdept

    Starter templates can be complemented by reusable, atomic setup "recipes": Markdown prompts that AI coding agents apply to existing codebases, modeled on shadcn/ui's copy-the-code philosophy. Recipes declare prerequisites, which lets them compose, and cookbooks bundle them into ordered sequences. They also encode stack-specific decisions agents would otherwise get wrong, such as using node-postgres instead of Neon's serverless driver on Vercel Fluid Compute with connection pooling. Recipes are served as MCP resources with slash-command prompts. Long-lived skills ship as small per-cookbook Claude Code plugins whose skill files are one-line pointers, which keeps them from bloating the agent's context.

  • Building with the OpenAI Apps SDK: A Field Guide

    Render mediumAdept

    OpenAI's Apps SDK extends the Model Context Protocol with a widget layer: tools that return structuredContent with `_meta.openai/outputTemplate` metadata get rendered as inline React components in ChatGPT. Lessons from building a movie recommendation app (Express, TypeScript, Postgres, Valkey, Vite-bundled widgets) include keeping MCP tools portable across clients, iterating via an ngrok tunnel, and building a local widget harness with fixtures and a stubbed `window.openai.callTool()`. Opaque `424 Unhandled errors in TaskGroup` failures almost always come from response-shape mismatches, so log payloads and keep reference fixtures. The full chat loop has no built-in telemetry, so add timing instrumentation yourself.

The quest for software engineering knowledge.

Look:
Layout: