copilot-sdk
Build AI Apps with GitHub Copilot SDK
Developers need programmatic access to GitHub Copilot for custom AI workflows. This SDK provides session management, custom tools, hooks, and MCP integration across Node.js, Python, Go, and .NET.
スキルZIPをダウンロード
Claudeでアップロード
設定 → 機能 → スキル → スキルをアップロードへ移動
オンにして利用開始
テストする
「copilot-sdk」を使用しています。 Create a session and ask Copilot to explain a Python function
期待される結果:
Session created with gpt-4.1 model. Copilot analyzes the function and provides a detailed explanation of its purpose, parameters, return value, and potential improvements.
「copilot-sdk」を使用しています。 Define a weather tool and ask Copilot about conditions in a city
期待される結果:
Custom tool registered. When asked about weather, Copilot calls the tool and returns structured data including city, temperature, and conditions.
「copilot-sdk」を使用しています。 Enable streaming and request a code review
期待される結果:
Response streams token-by-token in real-time. Code review feedback appears progressively with syntax highlighting and inline suggestions.
セキュリティ監査
安全All 192 static analysis findings are false positives. The scanner misinterpreted markdown code block delimiters (```) as shell backtick execution. The file contains documentation examples only, not executable code. URLs are reference links, environment variable mentions document authentication patterns. No actual security risks detected.
品質スコア
作れるもの
AI-Powered Development Tools
Build IDE extensions or CLI tools that leverage Copilot for code generation, review, and refactoring with custom tool integrations.
Automated Code Review Systems
Create custom agents for pull request analysis, security scanning, and best practices validation with automated feedback.
Multi-Agent Workflows
Orchestrate specialized AI agents for different tasks like documentation, testing, and deployment using MCP server integration.
これらのプロンプトを試す
Create a CopilotClient, start a session with the gpt-4.1 model, and send a message asking for code explanation.
Define a custom tool that retrieves file contents from the filesystem, then create a session that can use this tool to answer questions about project files.
Set up a streaming session that displays real-time responses, handles assistant message deltas, and logs session idle events.
Configure a session with an MCP server for GitHub API access, add hooks to control shell command permissions, and implement custom error handling.
ベストプラクティス
- Use hooks to implement permission controls for sensitive operations like shell commands and file access
- Enable debug logging during development to troubleshoot connection and authentication issues
- Use session persistence with custom IDs for long-running workflows that may exceed context limits
回避
- Hardcoding GitHub tokens in source code instead of using environment variables
- Creating new sessions for every request instead of reusing sessions for related tasks
- Ignoring permission requests and auto-approving all tool calls without validation