
Copilot Sdk
Embed GitHub Copilot’s production agent runtime in your app with custom tools, sessions, streaming, and MCP instead of building orchestration from scratch.
Overview
Copilot-sdk is an agent skill for the Build phase that guides embedding GitHub Copilot’s programmable agent runtime in applications with custom tools, MCP, streaming, and session management.
Install
npx skills add https://github.com/github/awesome-copilot --skill copilot-sdkWhat is this skill?
- Same agent runtime as Copilot CLI, invoked programmatically from Python, TypeScript, Go, or .NET
- Covers custom tools, streaming responses, session management, and MCP server connection
- Per-language install steps (npm, pip, go get, dotnet add package)
- Prerequisite gate: Copilot CLI installed, authenticated, and verified with copilot --version
- Triggers on programmable agent, embed Copilot, and MCP-oriented agentic apps
- Language runtimes: Node.js 18+, Python 3.8+, Go 1.21+, or .NET 8.0+
Adoption & trust: 9.1k installs on skills.sh; 34.6k GitHub stars; 2/3 security scanners passed (skills.sh audits).
What problem does it solve?
You want Copilot-style agentic workflows inside your own app but do not want to rebuild planning, tools, and edits on a custom orchestration stack.
Who is it for?
Solo builders shipping an app that must host a Copilot-powered agent with real tools and optional MCP extensions.
Skip if: Teams that only need Copilot in the IDE or CLI with no embedded runtime, or builders without an authenticated Copilot CLI setup.
When should I use this skill?
Embedding AI agents in apps, custom tools, streaming responses, sessions, MCP servers, or custom agents; triggers include Copilot SDK, GitHub SDK, agentic app, embed Copilot.
What do I get? / Deliverables
You install the Copilot SDK for your stack, satisfy CLI prerequisites, and implement agent sessions, tools, and MCP hooks using the documented quick-start patterns.
- SDK-installed project scaffold per language
- Agent session and tool wiring aligned with Copilot CLI runtime
Recommended Skills
Journey fit
How it compares
Use as an integration playbook for GitHub’s SDK—not as a generic Claude/Cursor skill template or a standalone MCP server listing.
Common Questions / FAQ
Who is copilot-sdk for?
Indie and solo developers building agentic features into web, API, or desktop apps who already use or plan to use GitHub Copilot CLI and want programmatic control.
When should I use copilot-sdk?
During Build when embedding Copilot in an app, defining custom tools, implementing streaming responses, managing sessions, or connecting to MCP servers—before you harden ship-time security review.
Is copilot-sdk safe to install?
Treat it like any third-party skill: review the Security Audits panel on this Prism page and limit agent permissions (network, shell, secrets) to what your embedded agent truly needs.
SKILL.md
READMESKILL.md - Copilot Sdk
# GitHub Copilot SDK Embed Copilot's agentic workflows in any application using Python, TypeScript, Go, or .NET. ## Overview The GitHub Copilot SDK exposes the same engine behind Copilot CLI: a production-tested agent runtime you can invoke programmatically. No need to build your own orchestration - you define agent behavior, Copilot handles planning, tool invocation, file edits, and more. ## Prerequisites 1. **GitHub Copilot CLI** installed and authenticated ([Installation guide](https://docs.github.com/en/copilot/how-tos/set-up/install-copilot-cli)) 2. **Language runtime**: Node.js 18+, Python 3.8+, Go 1.21+, or .NET 8.0+ Verify CLI: `copilot --version` ## Installation ### Node.js/TypeScript ```bash mkdir copilot-demo && cd copilot-demo npm init -y --init-type module npm install @github/copilot-sdk tsx ``` ### Python ```bash pip install github-copilot-sdk ``` ### Go ```bash mkdir copilot-demo && cd copilot-demo go mod init copilot-demo go get github.com/github/copilot-sdk/go ``` ### .NET ```bash dotnet new console -n CopilotDemo && cd CopilotDemo dotnet add package GitHub.Copilot.SDK ``` ## Quick Start ### TypeScript ```typescript import { CopilotClient, approveAll } from "@github/copilot-sdk"; const client = new CopilotClient(); const session = await client.createSession({ onPermissionRequest: approveAll, model: "gpt-4.1", }); const response = await session.sendAndWait({ prompt: "What is 2 + 2?" }); console.log(response?.data.content); await client.stop(); process.exit(0); ``` Run: `npx tsx index.ts` ### Python ```python import asyncio from copilot import CopilotClient, PermissionHandler async def main(): client = CopilotClient() await client.start() session = await client.create_session({ "on_permission_request": PermissionHandler.approve_all, "model": "gpt-4.1", }) response = await session.send_and_wait({"prompt": "What is 2 + 2?"}) print(response.data.content) await client.stop() asyncio.run(main()) ``` ### Go ```go package main import ( "fmt" "log" "os" copilot "github.com/github/copilot-sdk/go" ) func main() { client := copilot.NewClient(nil) if err := client.Start(); err != nil { log.Fatal(err) } defer client.Stop() session, err := client.CreateSession(&copilot.SessionConfig{ OnPermissionRequest: copilot.PermissionHandler.ApproveAll, Model: "gpt-4.1", }) if err != nil { log.Fatal(err) } response, err := session.SendAndWait(copilot.MessageOptions{Prompt: "What is 2 + 2?"}, 0) if err != nil { log.Fatal(err) } fmt.Println(*response.Data.Content) os.Exit(0) } ``` ### .NET (C#) ```csharp using GitHub.Copilot.SDK; await using var client = new CopilotClient(); await using var session = await client.CreateSessionAsync(new SessionConfig { OnPermissionRequest = PermissionHandler.ApproveAll, Model = "gpt-4.1", }); var response = await session.SendAndWaitAsync(new MessageOptions { Prompt = "What is 2 + 2?" }); Console.WriteLine(response?.Data.Content); ``` Run: `dotnet run` ## Streaming Responses Enable real-time output for better UX: ### TypeScript ```typescript import { CopilotClient, approveAll, SessionEvent } from "@github/copilot-sdk"; const client = new CopilotClient(); const session = await client.createSession({ onPermissionRequest: approveAll, model: "gpt-4.1", streaming: true, }); session.on((event: SessionEvent) => { if (event.type === "assistant.message_delta") { process.stdout.write(event.data.deltaContent); }