I’ve been playing around with the recently release Copilot SDK and put together a nice demonstration project.
My project is python based and is orchestrated with GitHub Actions. The steps in the project are the following.
- GitHub Actions
- Installs GH CLI
- Installs SDK
- Calls python script
- Python script
- Initializes SDK with agent mode
- Sends prompt to AI Agent to monitor GitHub workflows.
- AI Agent calls GitHub MCP server to check workflows
- AI Agent calls send email tool with email details from MCP above. (Prompt specifies this)
- Email Tool
- Sends email. (I mocked this tool up for now)
The cool thing is the agent can handle multiple steps. In my example, GitHub MCP is called based on the prompt and then the send email tool is called based on the prompt also. We can add more tools as needed.
Review my solution in the following repo.
Note: In my solution I am using the default model, Claude Sonnet. If you want a specific model like gpt4, you can add model”: “gpt-4” to the code below.
session = await client.create_session({"agent_mode": True, "tools": [email_tool]})