- Notifications
You must be signed in to change notification settings - Fork3.2k
Add initial support for multi-tool workflows#685
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
13 commits Select commitHold shift + click to select a range
f069f36 initial workflows
mattdholloway7b69e9e Merge branch 'main' into multi-tool-workflows
mattdhollowaya00aa4d fixing tabs
mattdholloway75bfae4 remove unused SecurityAlertWorkflowPrompt and RepositorySetupWorkflow…
mattdholloway0291916 Merge branch 'main' into multi-tool-workflows
mattdholloway8c38bf8 add workflow prompt for creating issue and assigning to copilot
mattdholloway5b65f78 Merge branch 'main' into multi-tool-workflows
mattdholloway7938497 Update pkg/github/workflow_prompts.go
mattdhollowayec6aa20 remove notif triage
mattdholloway485decb Merge branch 'main' into multi-tool-workflows
mattdholloway7234318 remove code inv workflow tool
mattdhollowaybcccfe0 Merge branch 'multi-tool-workflows' of https://github.com/github/gith…
mattdhollowayf1e5328 rm another
mattdhollowayFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,77 @@ | ||
| package github | ||
| import ( | ||
| "context" | ||
| "fmt" | ||
| "github.com/github/github-mcp-server/pkg/translations" | ||
| "github.com/mark3labs/mcp-go/mcp" | ||
| "github.com/mark3labs/mcp-go/server" | ||
| ) | ||
| // IssueToFixWorkflowPrompt provides a guided workflow for creating an issue and then generating a PR to fix it | ||
| funcIssueToFixWorkflowPrompt(t translations.TranslationHelperFunc) (tool mcp.Prompt,handler server.PromptHandlerFunc) { | ||
| returnmcp.NewPrompt("IssueToFixWorkflow", | ||
| mcp.WithPromptDescription(t("PROMPT_ISSUE_TO_FIX_WORKFLOW_DESCRIPTION","Create an issue for a problem and then generate a pull request to fix it")), | ||
| mcp.WithArgument("owner",mcp.ArgumentDescription("Repository owner"),mcp.RequiredArgument()), | ||
| mcp.WithArgument("repo",mcp.ArgumentDescription("Repository name"),mcp.RequiredArgument()), | ||
| mcp.WithArgument("title",mcp.ArgumentDescription("Issue title"),mcp.RequiredArgument()), | ||
| mcp.WithArgument("description",mcp.ArgumentDescription("Issue description"),mcp.RequiredArgument()), | ||
| mcp.WithArgument("labels",mcp.ArgumentDescription("Comma-separated list of labels to apply (optional)")), | ||
| mcp.WithArgument("assignees",mcp.ArgumentDescription("Comma-separated list of assignees (optional)")), | ||
| ),func(_ context.Context,request mcp.GetPromptRequest) (*mcp.GetPromptResult,error) { | ||
| owner:=request.Params.Arguments["owner"] | ||
| repo:=request.Params.Arguments["repo"] | ||
| title:=request.Params.Arguments["title"] | ||
| description:=request.Params.Arguments["description"] | ||
| labels:="" | ||
| ifl,exists:=request.Params.Arguments["labels"];exists { | ||
| labels=fmt.Sprintf("%v",l) | ||
| } | ||
| assignees:="" | ||
| ifa,exists:=request.Params.Arguments["assignees"];exists { | ||
| assignees=fmt.Sprintf("%v",a) | ||
| } | ||
| messages:= []mcp.PromptMessage{ | ||
| { | ||
| Role:"system", | ||
| Content:mcp.NewTextContent("You are a development workflow assistant helping to create GitHub issues and generate corresponding pull requests to fix them. You should: 1) Create a well-structured issue with clear problem description, 2) Assign it to Copilot coding agent to generate a solution, and 3) Monitor the PR creation process."), | ||
| }, | ||
| { | ||
| Role:"user", | ||
| Content:mcp.NewTextContent(fmt.Sprintf("I need to create an issue titled '%s' in %s/%s and then have a PR generated to fix it. The issue description is: %s%s%s", | ||
| title,owner,repo,description, | ||
| func()string { | ||
| iflabels!="" { | ||
| returnfmt.Sprintf("\n\nLabels to apply: %s",labels) | ||
| } | ||
| return"" | ||
| }(), | ||
| func()string { | ||
| ifassignees!="" { | ||
| returnfmt.Sprintf("\nAssignees: %s",assignees) | ||
| } | ||
| return"" | ||
| }())), | ||
| }, | ||
| { | ||
| Role:"assistant", | ||
| Content:mcp.NewTextContent(fmt.Sprintf("I'll help you create the issue '%s' in %s/%s and then coordinate with Copilot to generate a fix. Let me start by creating the issue with the provided details.",title,owner,repo)), | ||
| }, | ||
| { | ||
| Role:"user", | ||
| Content:mcp.NewTextContent("Perfect! Please:\n1. Create the issue with the title, description, labels, and assignees\n2. Once created, assign it to Copilot coding agent to generate a solution\n3. Monitor the process and let me know when the PR is ready for review"), | ||
| }, | ||
| { | ||
| Role:"assistant", | ||
| Content:mcp.NewTextContent("Excellent plan! Here's what I'll do:\n\n1. ✅ Create the issue with all specified details\n2. 🤖 Assign to Copilot coding agent for automated fix\n3. 📋 Monitor progress and notify when PR is created\n4. 🔍 Provide PR details for your review\n\nLet me start by creating the issue."), | ||
| }, | ||
| } | ||
| return&mcp.GetPromptResult{ | ||
| Messages:messages, | ||
| },nil | ||
| } | ||
| } |
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.