copilot-sdk

Embed GitHub Copilot agentic workflows into Python, TypeScript, Go, and .NET applications.

Updated Sep 10, 2026
One-click install
npx skills add https://github.com/serpro-workshop-fortaleza/datacorp-sifap-modernization-team-kit --skill copilot-sdk-serpro-workshop-fortaleza
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: copilot-sdk
Source: https://github.com/serpro-workshop-fortaleza/datacorp-sifap-modernization-team-kit/tree/main/.github/skills/copilot-sdk
Command: npx skills add https://github.com/serpro-workshop-fortaleza/datacorp-sifap-modernization-team-kit --skill copilot-sdk-serpro-workshop-fortaleza

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Building AI agents from scratch requires implementing orchestration, tool invocation, file editing, and planning logic yourself. This Skill guides you through embedding the production-tested GitHub Copilot CLI agent runtime directly into your own applications using the Copilot SDK, so you define agent behavior while Copilot handles execution. ## Core Features & Use Cases - Multi-language integration: Create agentic sessions in TypeScript, Python, Go, or .NET with streaming responses, session persistence, and error handling. - Agent extension: Define custom tools with schemas and handlers, connect MCP servers (like the GitHub MCP server), configure custom agent personas, and override system messages. - Use Case: Imagine you want a CLI weather assistant. Use this Skill to create a session with a custom get_weather tool, stream token-by-token responses, and run an interactive readline loop where Copilot decides when to call your tool. ## Quick Start Use the copilot-sdk skill to create a TypeScript app that starts a Copilot session with streaming enabled and asks it a question.

Frequently Asked Questions about copilot-sdk

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I embed a Copilot agent into my application with the Copilot SDK?▼

Install the SDK package for your language, create a CopilotClient, then call createSession with a model and permission handler. Send prompts with sendAndWait and always call client.stop() in a finally block to clean up the CLI process.

How to add custom tools the Copilot agent can call?▼

Define a tool with a name, description, parameter schema, and handler function, then pass it in the session's tools array. Copilot decides when to invoke it based on the user's question and the tool description, and the result is fed back into the response.

Which languages does the GitHub Copilot SDK support?▼

The SDK supports TypeScript/Node.js 18+, Python 3.8+, Go 1.21+, and .NET 8.0+. All languages require the GitHub Copilot CLI to be installed and authenticated, since the SDK controls the CLI's agent runtime via JSON-RPC.

Can I connect the Copilot SDK to MCP servers?▼

Yes, pass an mcpServers configuration when creating a session, specifying the server type and URL, such as the GitHub MCP server at https://api.githubcopilot.com/mcp/. This gives the agent access to ready-made tools for repositories, issues, and pull requests.

Why does the Copilot SDK fail to start a session?▼

Common causes are a missing Copilot CLI (ENOENT error) or an unreachable server (ECONNREFUSED). Verify the CLI with copilot --version, ensure it is authenticated, and check the cliUrl or port configuration if connecting to an external server.

Is the Copilot SDK ready for production use?▼

No, the SDK is in Technical Preview and may introduce breaking changes. Pin your SDK versions and retest when upgrading, and avoid relying on it for production workloads until it reaches general availability.