Guide · Agent skill
How to use the GitHub Copilot SDK agent skill (copilot-sdk)
Updated · written with AI from the project's own documentation and checked against our catalogue data
The copilot-sdk skill teaches your AI agent how to write application code that uses the GitHub Copilot SDK, a programmatic interface to the same agent engine behind Copilot CLI. It is for developers who want to embed an agent inside their own software rather than chat with Copilot directly. After following this guide you will know what the skill does, how to install it, how to ask for it in plain language, and what to check before running the generated code.
Quick start
- 1Confirm access. Make sure you have GitHub Copilot access and an authenticated environment before you start. The examples will not run without them.
- 2Install the skill. Download the ZIP, unzip it into ~/.claude/skills/ or a project's .claude/skills/ folder, or upload it under Settings → Capabilities → Skills in the Claude apps.
- 3Pick a language and install the SDK. Use npm for TypeScript, pip for Python, go get for Go, or dotnet add package for .NET. For Go, install GitHub Copilot CLI first.
- 4Ask for the feature in plain words. Describe the app or feature you want and include a trigger phrase such as Copilot SDK or custom tool.
- 5Run the generated example. Run the program with the command the agent gives you, for example npx tsx index.ts for TypeScript or dotnet run for .NET.
- 6Review permission handling. Check the onPermissionRequest setting before you use the code beyond testing, because the examples approve every permission request automatically.
What the copilot-sdk skill makes the agent do
An agent skill is a set of instructions that an AI agent loads when a task matches it. The copilot-sdk skill covers writing application code against the GitHub Copilot SDK. Once it is installed, the agent can scaffold a project in TypeScript, Python, Go or .NET, create a session, stream responses as they arrive, define custom tools with a schema and a handler, and connect to MCP servers.
The SDK handles the agent work for you. You define the behaviour you want, and Copilot handles planning, tool invocation and file edits. You do not need to build your own orchestration loop.
- Scaffold a project and install the SDK package for your language
- Create sessions and send prompts with a single call
- Stream responses to the user in real time
- Define custom tools Copilot can call during reasoning
- Connect to MCP servers and create custom agents
How to install the copilot-sdk skill
Download the ZIP file from this skill's page on our site. Unzip it so that the folder containing SKILL.md ends up in one of these locations: ~/.claude/skills/ to make it available across your projects, or .claude/skills/ inside a single project to scope it to that project.
If you use the Claude apps instead, open Settings, go to Capabilities, then Skills, and upload the skill there.
- Personal install: place the unzipped folder in ~/.claude/skills/
- Project install: place it in .claude/skills/ at the root of your project
- Claude apps: Settings → Capabilities → Skills, then upload the skill
How to trigger the skill with natural requests
You do not need to name the skill. The skill description lists the phrases that should load it, including Copilot SDK, GitHub SDK, agentic app, embed Copilot, programmable agent, MCP server and custom agent. Describe the job in plain terms and include one of those phrases.
Be specific about the language and the feature. The skill covers four languages and several features, so a request that names both gives the agent what it needs to write the right code.
- "Use the Copilot SDK to build a small TypeScript script that answers a question."
- "Embed Copilot in my internal Python tool and stream the answer to the terminal."
- "Add a custom tool to my Copilot SDK app that looks up order status from my database."
- "Create a Go program with the GitHub Copilot SDK that connects to an MCP server."
Set up and run a first Copilot SDK program
Before you start, you need GitHub Copilot access and an authenticated environment. The examples will not run without them. The TypeScript, Python and .NET packages bundle a Copilot runtime by default, so they do not need a separate CLI. Go requires GitHub Copilot CLI to be installed and authenticated.
The skill's installation steps use the standard package tools for each language. For TypeScript, the example below creates a project folder and installs the SDK along with tsx.
- Python: the optional command python -m copilot download-runtime caches the bundled runtime; if you skip it, the SDK downloads it on first use
- Go: install GitHub Copilot CLI first, using the installation guide linked from the skill
mkdir copilot-demo && cd copilot-demo
npm init -y --init-type module
npm install @github/copilot-sdk tsxStream responses and define a custom tool
Streaming lets your app show text while the model is still writing it. Set streaming to true when creating the session, then listen for assistant.message_delta events and write each delta to the output. A session.idle event marks the end of the response.
Custom tools let Copilot call your code. Each tool needs three things: a description of what it does, a parameter schema, and a handler that runs the code. The TypeScript example in the skill defines a get_weather tool with a city parameter. Its handler is a placeholder, and the skill notes that a real app would call a weather API at that point.
- Description: tells Copilot when the tool is useful
- Schema: lists the parameters and their types, as JSON Schema in TypeScript
- Handler: the function that runs when Copilot calls the tool
const session = await client.createSession({
onPermissionRequest: approveAll,
model: "gpt-4.1",
streaming: true,
tools: [getWeather],
});What people use it for
- Embedding a Copilot-powered assistant inside an internal tool your team already uses
- Adding custom tools so Copilot can look up data from your own systems during a conversation
- Streaming answers into a web or terminal interface for a better user experience
- Connecting Copilot to MCP servers from a TypeScript, Python, Go or .NET app
- Comparing how the same SDK pattern is written across the four supported languages
Frequently asked questions
How do I install the copilot-sdk skill?
Download the ZIP from this skill's page and unzip it into ~/.claude/skills/ for personal use, or into .claude/skills/ inside a project. In the Claude apps, open Settings, go to Capabilities, then Skills, and upload it there.
Is the copilot-sdk skill free?
The skill is released under the MIT licence. The examples need GitHub Copilot access and an authenticated environment, so you need a Copilot account that gives you that access. The skill itself does not add any cost.
What do I need to run the copilot-sdk examples?
You need GitHub Copilot access, an authenticated environment, and a supported runtime for your language: Node.js, Python, Go or .NET. Go also needs GitHub Copilot CLI installed and authenticated, while the TypeScript, Python and .NET packages bundle a runtime.
Does the skill run scripts or use the network?
The skill does not run scripts on its own. It does use the network, because the SDK connects to Copilot and the package installers fetch the SDK. Check the generated code before you run it.
Is it safe to use the approveAll examples in production?
Not without review. approveAll automatically approves every permission request the agent makes, so the agent can edit files or run tools without asking. Replace it with your own permission handling before you rely on the code in production.
How is this different from using Copilot CLI or chat?
Copilot CLI and chat are tools for you to use directly. The copilot-sdk skill helps you write your own application that calls the same agent engine programmatically. If you only want to chat with Copilot, you do not need this skill.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
Use this skill if you are a developer building an app or internal tool that embeds a Copilot agent, adds custom tools, or connects to MCP servers, and you want the agent to write the starter code in your language. Pick something else if you only want to chat with Copilot, or if you need a production-ready app without first reviewing the permission handling in the examples.
Download the skill