Skip to content

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

Neon 6 min read How-to mediumAdept

Building a VSCode Chat Extension to Order Lunch

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.

Assumes: VS Code extension basicsLLM function callingTypeScript

Related posts

  • 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.

  • How to Build GitHub Copilot Extensions

    Neon mediumAdept

    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.

  • Implementing MCP Servers in Python: An AI Shopping Assistant with Gradio

    Hugging Face mediumAdept

    Gradio's MCP integration turns Python functions into LLM tools: launching an app with mcp_server=True exposes each endpoint as an MCP tool, with names, descriptions and input schemas generated from function docstrings, plus progress streaming and file upload handling. The walkthrough builds a virtual try-on shopping assistant by wrapping the IDM-VTON diffusion Space, called through the Gradio API client, in a Gradio Interface. That server is registered alongside the Playwright MCP server in VS Code's mcp.json, so the AI chat can browse a clothing store and render the user wearing selected garments.

  • 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.

  • Tiny Agents: an MCP-powered agent in 50 lines of code

    Hugging Face mediumAdept

    An LLM agent built on the Model Context Protocol reduces to a simple while loop around an MCP-aware inference client: connect to MCP servers, convert their tools into OpenAI-style function definitions, pass them to the chat-completion call, execute returned tool calls via the MCP SDK, and feed results back. The TypeScript implementation in huggingface.js extends InferenceClient into an McpClient that holds one session per server and maps tool names to sessions. An Agent class adds a system prompt plus two control-flow tools (task_complete, ask_question). The loop alternates tool calls and results until an exit tool is called, the model answers twice without tools, or a turn limit is reached. The default setup uses Qwen2.5-72B on Nebius, and the model, provider and MCP servers can be swapped.

The quest for software engineering knowledge.

Look:
Layout: