copilot-sdk

copilot-sdk is a skill for Claude Code from skillmds/skillmd. It costs 55 tokens per session (3,712 once invoked), scanned B, original, MIT.

A software development kit for building applications that communicate with GitHub Copilot programmatically. It provides session handling, custom tools, hooks, MCP server integration, and streaming through Node.js, Python, Go, and .NET.

In plain words
What is it for?
Use it to create applications that start Copilot sessions, send requests, receive streamed responses, and connect custom tools or MCP servers.
Why use it?
It removes the need to integrate with the Copilot command-line program directly over its low-level communication interface.

Skill for Claude Code

Written for Claude Code: shipped in a Claude Code plugin. Also seen: mentions Codex.

Part of the agents-mcp plugin — 34 skills shipped together

Good fit Use it to create applications that start Copilot sessions, send requests, receive streamed responses, and connect custom tools or MCP servers.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/skillmds/skillmd/copilot-sdk
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add skillmds/skillmd --skill copilot-sdk
Clone the repo
git clone --depth 1 https://github.com/skillmds/skillmd

Made for: Claude Code.

Or install agents-mcp, the plugin that ships this one along with the rest of its 34 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for copilot-sdk

README.md
[![agentmods](https://agentmods.dev/badge/skills/skillmds/skillmd/copilot-sdk/github.svg)](https://agentmods.dev/skills/skillmds/skillmd/copilot-sdk)
Your own site
<a href="https://agentmods.dev/skills/skillmds/skillmd/copilot-sdk"><img src="https://agentmods.dev/badge/skills/skillmds/skillmd/copilot-sdk/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for copilot-sdk

Your own site · 80×15
<a href="https://agentmods.dev/skills/skillmds/skillmd/copilot-sdk"><img src="https://agentmods.dev/badge/skills/skillmds/skillmd/copilot-sdk.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 55 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,712 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00055 $0.03712
Opus 5.5 $0.00022 $0.01485
Sonnet 5 $0.00011 $0.00742
Haiku 4.5 $0.00006 $0.00371

Measured 4d ago against content hash 3e9430a038a7, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-23, from the pricing page.

Security

Grade B, and why

copilot-sdk scanned grade B with 1 finding against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Unrestricted tool accessmediumExcessive agency

A wildcard tool grant or "run any command" leaves no least-privilege boundary at all.

tools: ["*"],
plugins/agents-mcp/skills/copilot-sdk/SKILL.md · 522 lines

How it starts

The opening of the file, as written. The whole thing — 522 lines — stays where its author put it; the contents beside it link to each section on GitHub.

GitHub Copilot SDK

Build applications that programmatically interact with GitHub Copilot. The SDK wraps the Copilot CLI via JSON-RPC, providing session management, custom tools, hooks, MCP server integration, and streaming across Node.js, Python, Go, and .NET.

Prerequisites

  • GitHub Copilot CLI installed and authenticated (copilot --version to verify)
  • GitHub Copilot subscription (Individual, Business, or Enterprise) — not required for BYOK
  • Runtime: Node.js 18+ / Python 3.8+ / Go 1.21+ / .NET 8.0+

Installation

Language Package Install
Node.js @github/copilot-sdk npm install @github/copilot-sdk
Python github-copilot-sdk pip install github-copilot-sdk
Go github.com/github/copilot-sdk/go go get github.com/github/copilot-sdk/go
.NET GitHub.Copilot.SDK dotnet add package GitHub.Copilot.SDK

Core Pattern: Client → Session → Message

All SDK usage follows this pattern: create a client, create a session, send messages.

Node.js / TypeScript

import { CopilotClient } from "@github/copilot-sdk";

const client = new CopilotClient();
const session = await client.createSession({ model: "gpt-4.1" });

const response = await session.sendAndWait({ prompt: "What is 2 + 2?" });
console.log(response?.data.content);

await client.stop();

Python

import asyncio
from copilot import CopilotClient

async def main():
    client = CopilotClient()
    await client.start()
    session = await client.create_session({"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

client := copilot.NewClient(nil)
if err := client.Start(ctx); err != nil { log.Fatal(err) }
defer client.Stop()

session, _ := client.CreateSession(ctx, &copilot.SessionConfig{Model: "gpt-4.1"})
response, _ := session.SendAndWait(ctx, copilot.MessageOptions{Prompt: "What is 2 + 2?"})
fmt.Println(*response.Data.Content)

Read the full file on GitHub · 522 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 522 lines · 55 tokens per session scan B 3e9430a038a7

Subscribe to this mod's changes

copilot-sdk is a skill published in the GitHub repository skillmds/skillmd (1 stars, last pushed yesterday), licensed MIT. It adds 55 tokens to every session and 3,712 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it B with 1 finding (unrestricted tool access). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-19.