Skip to main content

Asking GitHub Copilot to create a pull request

You can ask Copilot to create a pull request from many places, including GitHub Issues, the agents panel, Bate-Papo Copilot, the GitHub CLI, and agentic coding tools and IDEs with Model Context Protocol (MCP) support.

Quem pode usar esse recurso?

Copilot cloud agent is available with the Copilot Pro do GitHub, GitHub Copilot Pro+, GitHub Copilot Business and GitHub Copilot Enterprise plans. The agent is available in all repositories stored on GitHub, except repositories owned by contas de usuário gerenciadas and where it has been explicitly disabled.
Sign up for Copilot

Observação

For an overview of Copilot cloud agent, see About GitHub Copilot cloud agent.

Introduction

You can ask Copilot to create a new pull request from:

Copilot will start working on the task, raise a pull request, then request a review from you when it's finished working. For more information, see About GitHub Copilot cloud agent.

Assigning an issue to Copilot

You can ask Copilot to start working on an issue by assigning the issue to Copilot.

You can assign an issue to Copilot:

Assigning an issue to Copilot on GitHub.com

Observação

This feature is in versão prévia pública and subject to change.

  1. Em GitHub, acesse a página principal do repositório.

  2. No nome do seu repositório, clique em Issues.

    Captura de tela da página principal de um repositório. Na barra de navegação horizontal, uma guia, rotulada como "Problemas", é destacada em laranja escuro.

  3. Open the issue that you want to assign to Copilot.

  4. In the right side menu, click Assignees.

    Screenshot of the right sidebar of an issue. A header, labeled "Assignees", is outlined in dark orange.

  5. Click Copilot from assignees list.

    Screenshot of "Assignees" window on an issue. Copilot is available in the list.

    Additional options are displayed.

    Screenshot of "Assign to Copilot" dialog showing options for target repository, starting branch, agente personalizado, and additional instructions.

  6. In the Optional prompt field you can add specific guidance for Copilot. Add any context, constraints, or specific requirements that will help Copilot to understand and complete the task.

    For example, you might include instructions about specific coding patterns or frameworks to use, testing requirements, code style preferences, files or directories that should or shouldn't be modified.

    In addition to the details you supply here, Copilot will use any custom instructions that have been configured for the target repository. See Adicionando instruções personalizadas do repositório para GitHub Copilot.

  7. You can use the dropdown menus in the dialog to change the repository that Copilot will work in and the branch that it will branch off from.

    All repositories where you have at least read access will be displayed in the repository dropdown menu. However, you can only select a repository if you have write access to it, and if Copilot cloud agent is enabled for that repository.

    If you select a repository in a different organization than the issue's source organization, or if you select a public repository when the issue is in a private repository, a warning will be displayed.

    If you don't specify a repository, Copilot will work in the same repository as the issue. If you don't specify a branch, Copilot will work from the default branch of the selected repository.

    Dica

    When you assign an issue to Copilot, it gets sent the issue title, description, any comments that currently exist, and any additional instructions you provide. After assigning the issue, Copilot will not be aware of, and therefore won't react to, any further comments that are added to the issue. If you have more information, or changes to the original requirement, add this as a comment in the pull request that Copilot raises.

  8. Opcionalmente, você pode clicar para abrir o menu suspenso do agente, se quiser atribuir um agente ou um agente personalizado com ferramentas e comportamento especializados. Você pode selecionar um existente agente personalizado do seu repositório, organização ou empresa. Você também pode clicar em Criar um agente para criar um novo perfil do agente em seu repositório e branch selecionados. Para saber mais, confira Creating custom agents for Copilot cloud agent.

    Observação

    Agentes de codificação de terceiros estão disponíveis nos planos GitHub Copilot Pro+ e Copilot Enterprise.

  9. Optionally, if you are a Copilot Pro do GitHub or GitHub Copilot Pro+ user, you can use the dropdown menu to select the model that Copilot will use. For more information, see Changing the AI model for GitHub Copilot cloud agent.

You can also assign issues to Copilot from other places on GitHub.com:

  • From the list of issues on a repository's Issues page.
  • When viewing an issue in GitHub Projetos.

Assigning an issue to Copilot on GitHub Mobile

  1. In GitHub Mobile, navigate to the repository that contains the issue you want to assign to Copilot.
  2. Click Issues.
  3. Open the issue that you want to assign to Copilot.
  4. Tap the icon.
  5. Beside "Assignees", tap Edit.
  6. Beside "Copilot", click the plus sign.
  7. Click Done.

Assigning an issue to Copilot via the GitHub API

Observação

This feature is in versão prévia pública and subject to change.

You can assign issues to Copilot using either the GraphQL API or the REST API. Both APIs support an optional Agent Assignment input to customize the task:

GraphQL parameterREST parameterDescription
targetRepositoryIdtarget_repoThe repository where Copilot will work
baseRefbase_branchThe branch that Copilot will branch from
customInstructionscustom_instructionsAdditional instructions for Copilot
customAgentcustom_agentA agente personalizado to use for the task
modelmodelThe model for Copilot to use

Using the GraphQL API

Observação

You must include the GraphQL-Features header with the values issues_copilot_assignment_api_support and coding_agent_model_selection.

You can use the following GraphQL mutations to assign issues to Copilot:

Creating and assigning a new issue
  1. Make sure you're authenticating with the API using a user token, for example a personal access token or a GitHub App user-to-server token.

    Observação

    If using a fine-grained personal access token, it needs the following permissions to assign Copilot to an issue:

    • Read access to metadata
    • Read and write access to actions, contents, issues and pull requests

    If using a personal access token (classic), it needs the repo scope to assign Copilot to an issue.

  2. Verify that Copilot cloud agent is enabled in the repository by checking if the repository's suggestedActors in the GraphQL API includes Copilot. Replace octo-org with the repository owner, and octo-repo with the repository name.

    GraphQL
    query {
      repository(owner: "octo-org", name: "octo-repo") {
        suggestedActors(capabilities: [CAN_BE_ASSIGNED], first: 100) {
          nodes {
            login
            __typename
    
            ... on Bot {
              id
            }
    
            ... on User {
              id
            }
          }
        }
      }
    }
    

    If Copilot cloud agent is enabled for the user and in the repository, the first node returned from the query will have the login value copilot-swe-agent.

  3. Make a note of the id value of this login.

  4. Fetch the GraphQL global ID of the repository you want to create the issue in, replacing octo-org with the repository owner, and octo-repo with the repository name.

    GraphQL
    query {
      repository(owner: "octo-org", name: "octo-repo") {
        id
      }
    }
    
  5. Create the issue with the createIssue mutation. Replace REPOSITORY_ID with the ID returned from the previous step, and BOT_ID with the ID returned from the step before that. You can optionally include the agentAssignment input to customize the task.

    Shell
    gh api graphql -f query='mutation {
      createIssue(input: {
        repositoryId: "REPOSITORY_ID",
        title: "Implement comprehensive unit tests",
        body: "DETAILS",
        assigneeIds: ["BOT_ID"],
        agentAssignment: {
          targetRepositoryId: "REPOSITORY_ID",
          baseRef: "main",
          customInstructions: "Add comprehensive test coverage",
          customAgent: "",
          model: ""
        }
      }) {
        issue {
          id
          title
          assignees(first: 10) {
            nodes {
              login
            }
          }
        }
      }
    }' -H 'GraphQL-Features: issues_copilot_assignment_api_support,coding_agent_model_selection'
    
Assigning an existing issue
  1. Make sure you're authenticating with the API using a user token, for example a personal access token or a GitHub App user-to-server token.

  2. Verify that Copilot cloud agent is enabled in the repository by checking if the repository's suggestedActors in the GraphQL API includes Copilot. Replace octo-org with the repository owner, and octo-repo with the repository name.

    GraphQL
    query {
      repository(owner: "monalisa", name: "octocat") {
        suggestedActors(capabilities: [CAN_BE_ASSIGNED], first: 100) {
          nodes {
            login
            __typename
    
            ... on Bot {
              id
            }
    
            ... on User {
              id
            }
          }
        }
      }
    }
    

    If Copilot cloud agent is enabled for the user and in the repository, the first node returned from the query will have the login value copilot-swe-agent.

  3. Fetch the GraphQL global ID of the issue you want to assign to Copilot, replacing monalisa with the repository owner, octocat with the name and 9000 with the issue number.

    GraphQL
    query {
      repository(owner: "monalisa", name: "octocat") {
        issue(number: 9000) {
          id
          title
        }
      }
    }
    
  4. Assign the existing issue to Copilot using the replaceActorsForAssignable mutation. Replace ISSUE_ID with the ID returned from the previous step, BOT_ID with the ID returned from the step before that, and REPOSITORY_ID with the repository ID. You can optionally include the agentAssignment input to customize the task.

    Shell
    gh api graphql -f query='mutation {
      replaceActorsForAssignable(input: {
        assignableId: "ISSUE_ID",
        actorIds: ["BOT_ID"],
        agentAssignment: {
          targetRepositoryId: "REPOSITORY_ID",
          baseRef: "main",
          customInstructions: "Fix the reported bug",
          customAgent: "",
          model: ""
        }
      }) {
        assignable {
          ... on Issue {
            id
            title
            assignees(first: 10) {
              nodes {
                login
              }
            }
          }
        }
      }
    }' -H 'GraphQL-Features: issues_copilot_assignment_api_support,coding_agent_model_selection'
    
  5. Alternatively, you can use the updateIssue mutation to update an existing issue and assign it to Copilot. Replace ISSUE_ID with the issue ID and BOT_ID with the bot ID.

    Shell
    gh api graphql -f query='mutation {
      updateIssue(input: {
        id: "ISSUE_ID",
        assigneeIds: ["BOT_ID"],
        agentAssignment: {
          targetRepositoryId: "REPOSITORY_ID",
          baseRef: "main",
          customInstructions: "Update feature implementation",
          customAgent: "",
          model: ""
        }
      }) {
        issue {
          id
          title
          assignees(first: 10) {
            nodes {
              login
            }
          }
        }
      }
    }' -H 'GraphQL-Features: issues_copilot_assignment_api_support,coding_agent_model_selection'
    
  6. You can also use the addAssigneesToAssignable mutation to add Copilot to an existing issue while keeping other assignees. Replace ISSUE_ID with the issue ID and BOT_ID with the bot ID.

    Shell
    gh api graphql -f query='mutation {
      addAssigneesToAssignable(input: {
        assignableId: "ISSUE_ID",
        assigneeIds: ["BOT_ID"],
        agentAssignment: {
          targetRepositoryId: "REPOSITORY_ID",
          baseRef: "main",
          customInstructions: "Collaborate on this task",
          customAgent: "",
          model: ""
        }
      }) {
        assignable {
          ... on Issue {
            id
            title
            assignees(first: 10) {
              nodes {
                login
              }
            }
          }
        }
      }
    }' -H 'GraphQL-Features: issues_copilot_assignment_api_support,coding_agent_model_selection'
    

Using the REST API

You can use the following REST API endpoints to assign issues to Copilot:

Adding assignees to an existing issue
Shell
gh api \
  --method POST \
  -H "Accept: application/vnd.github+json" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  /repos/OWNER/REPO/issues/ISSUE_NUMBER/assignees \
  --input - <<< '{
  "assignees": ["copilot-swe-agent[bot]"],
  "agent_assignment": {
    "target_repo": "OWNER/REPO",
    "base_branch": "main",
    "custom_instructions": "",
    "custom_agent": "",
    "model": ""
  }
}'
Creating a new issue
Shell
gh api \
  --method POST \
  -H "Accept: application/vnd.github+json" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  /repos/OWNER/REPO/issues \
  --input - <<< '{
  "title": "Issue title",
  "body": "Issue description.",
  "assignees": ["copilot-swe-agent[bot]"],
  "agent_assignment": {
    "target_repo": "OWNER/REPO",
    "base_branch": "main",
    "custom_instructions": "",
    "custom_agent": "",
    "model": ""
  }
}'
Updating an existing issue
Shell
gh api \
  --method PATCH \
  -H "Accept: application/vnd.github+json" \
  -H "X-GitHub-Api-Version: 2022-11-28" \
  /repos/OWNER/REPO/issues/ISSUE_NUMBER \
  --input - <<< '{
  "assignees": ["copilot-swe-agent[bot]"],
  "agent_assignment": {
    "target_repo": "OWNER/REPO",
    "base_branch": "main",
    "custom_instructions": "",
    "custom_agent": "",
    "model": ""
  }
}'

Assigning an issue to Copilot from Raycast

Raycast is an extensible launcher for Windows and macOS. With the GitHub Copilot extension for Raycast, you can start and track Copilot cloud agent tasks and watch session logs live wherever you are on your computer.

  1. Install Raycast from the Raycast website.

  2. Install the GitHub Copilot extension for Raycast by clicking the Install Extension button on the extension's page.

  3. Open Raycast, search for "Copilot," find the Assign Issues to Copilot command, then press Enter.

  4. Click Sign in with GitHub, then complete the authentication flow. Raycast will re-open.

  5. Select the repository you want Copilot to work in.

  6. Select the issue you want to assign to Copilot.

  7. Optionally, select a base branch for Copilot's pull request. Copilot will create a new branch based on this branch, then push the changes to a pull request targeting that branch.

  8. Opcionalmente, selecione um agente personalizado com comportamento especializado e ferramentas no menu de opções. Para saber mais, confira Creating custom agents for Copilot cloud agent.

  9. Optionally, if you are a Copilot Pro do GitHub or GitHub Copilot Pro+ user, you can use the dropdown menu to select the model that Copilot will use. For more information, see Changing the AI model for GitHub Copilot cloud agent.

  10. Optionally, provide additional instructions. These will be passed to Copilot alongside your issue contents.

  11. Press Command+Enter (macOS) or Ctrl+Enter (Windows) to assign the issue.

    Copilot will start a new session. Copilot will work on the task and push changes to its pull request, then add you as a reviewer when it has finished, triggering a notification.

Observação

If you are unable to select a specific repository when starting a task, the organization that owns the repository may have enabled OAuth app access restrictions. To learn how to request approval for the "GitHub Copilot for Raycast" OAuth app, see Solicitar aprovação da organização para aplicativos OAuth.

Asking Copilot to create a pull request from the agents tab or panel

You can ask Copilot to open a pull request from either the agents tab or the agents panel. The only difference is the entry point - once you see the "New agent task" form, the steps are the same.

  1. Abra o painel ou a guia de agentes:

    • No repositório, abra a aba Agentes.
    •           **Navegue até a página de agentes**: acesse [github.com/copilot/agents](https://github.com/copilot/agents?ref_product=copilot&ref_type=engagement&ref_style=text). Você também pode chegar aqui abrindo o painel de agentes e clicando em **Exibir tudo**.
      
    •      **Abra o painel de agentes**: clique em <svg version="1.1" width="16" height="16" viewBox="0 0 16 16" class="octicon octicon-agent" aria-label="The Agents icon" role="img"><path d="M14.5 8.9v-.052A2.956 2.956 0 0 0 11.542 5.9a.815.815 0 0 1-.751-.501l-.145-.348A3.496 3.496 0 0 0 7.421 2.9h-.206a3.754 3.754 0 0 0-3.736 4.118l.011.121a.822.822 0 0 1-.619.879A1.81 1.81 0 0 0 1.5 9.773v.14c0 1.097.89 1.987 1.987 1.987H4.5a.75.75 0 0 1 0 1.5H3.487A3.487 3.487 0 0 1 0 9.913v-.14C0 8.449.785 7.274 1.963 6.75A5.253 5.253 0 0 1 7.215 1.4h.206a4.992 4.992 0 0 1 4.586 3.024A4.455 4.455 0 0 1 16 8.848V8.9a.75.75 0 0 1-1.5 0Z"></path><path d="m8.38 7.67 2.25 2.25a.749.749 0 0 1 0 1.061L8.38 13.23a.749.749 0 1 1-1.06-1.06l1.719-1.72L7.32 8.731A.75.75 0 0 1 8.38 7.67ZM15 13.45h-3a.75.75 0 0 1 0-1.5h3a.75.75 0 0 1 0 1.5Z"></path></svg> na barra de navegação no canto superior direito de GitHub.
      
  2. Using the dropdown menu in the prompt field, select the repository you want Copilot to work in.

  3. Type a prompt describing your request. You can also add visual inputs like screenshots or UI mockups by pasting, dragging, or uploading an image. Files supported: image/png, image/jpeg, image/gif, image/webp.

    For example, Create a pull request to implement a user friendly message for common errors.

  4. Optionally, select a base branch for Copilot's pull request. Copilot will create a new branch based on this branch, then push the changes to a pull request targeting that branch.

  5. Opcionalmente, você pode clicar para abrir o menu suspenso do agente, se quiser atribuir um agente ou um agente personalizado com ferramentas e comportamento especializados. Você pode selecionar um existente agente personalizado do seu repositório, organização ou empresa. Você também pode clicar em Criar um agente para criar um novo perfil do agente em seu repositório e branch selecionados. Para saber mais, confira Creating custom agents for Copilot cloud agent.

    Observação

    Agentes de codificação de terceiros estão disponíveis nos planos GitHub Copilot Pro+ e Copilot Enterprise.

  6. Optionally, if you are a Copilot Pro do GitHub or GitHub Copilot Pro+ user, you can use the dropdown menu to select the model that Copilot will use. For more information, see Changing the AI model for GitHub Copilot cloud agent.

  7. Click or press Enter.

    Copilot will start a new session, which will appear in the list below the prompt box. Copilot will work on the task and push changes to its pull request, then add you as a reviewer when it has finished, triggering a notification.

Asking Copilot to create a pull request from the dashboard

You can ask Copilot to open a pull request from the Copilot prompt box in the dashboard. The dashboard is your personalized overview of your activity on GitHub, seen when you visit https://github.com while logged in.

  1. Navigate to the dashboard at https://github.com.

  2. Click the Task button.

  3. Using the dropdown menu in the prompt field, select the repository you want Copilot to work in.

  4. Type a prompt describing your request.

    For example, Create a pull request to implement a user friendly message for common errors.

  5. Optionally, select a base branch for Copilot's pull request. Copilot will create a new branch based on this branch, then push the changes to a pull request.

  6. Opcionalmente, você pode clicar para abrir o menu suspenso do agente, se quiser atribuir um agente ou um agente personalizado com ferramentas e comportamento especializados. Você pode selecionar um existente agente personalizado do seu repositório, organização ou empresa. Você também pode clicar em Criar um agente para criar um novo perfil do agente em seu repositório e branch selecionados. Para saber mais, confira Creating custom agents for Copilot cloud agent.

    Observação

    Agentes de codificação de terceiros estão disponíveis nos planos GitHub Copilot Pro+ e Copilot Enterprise.

  7. Click Send now or press Return.

    You will be taken to the agents tab, and Copilot will start a new session, which will appear in the "Recent sessions" list below the prompt box. Copilot will work on the task and push changes to its pull request, then add you as a reviewer when it has finished, triggering a notification.

    Observação

    If you have enabled the New Dashboard Experience in feature preview, the new session will appear in "Agent sessions" under the prompt box in your dashboard. For more information, see Painel Pessoal.

Asking Copilot to create a pull request from Bate-Papo Copilot in Visual Studio Code

  1. Install the GitHub Pull Requests extension for Visual Studio Code.

  2. Open Copilot Chat do GitHub in Visual Studio Code.

  3. Type a prompt explaining what you want Copilot to do.

    For example, Put backticks around file names and variables in output

    Dica

    To help Copilot, you can select the relevant line(s) of code before submitting your prompt.

  4. Submit your prompt by clicking the Delegate this task to the GitHub Copilot cloud agent button, next to the Send button

  5. If you have local changes, a dialog will be displayed asking if you want to push those changes so Copilot can start from your current state. Click Include changes to push your changes, or Ignore changes to ask Copilot to start its work from your repository's default branch.

    Copilot will start a new session and respond with a link to the pull request it creates. It will work on the task and push changes to the pull request, and then add you as a reviewer when it has finished, triggering a notification.

Asking Copilot to create a pull request from Bate-Papo Copilot in JetBrains IDEs

Observação

Copilot cloud agent in JetBrains IDEs is in versão prévia pública, and subject to change.

  1. Open Copilot Chat do GitHub in your JetBrains IDE.

  2. Type a prompt explaining what you want Copilot to do

    For example, Put backticks around file names and variables in output

  3. Click the Delegate to Cloud Agent button next to the Send button.

    Copilot will start a new session and respond with a link to the pull request it creates. It will work on the task and push changes to the pull request, and then add you as a reviewer when it has finished, triggering a notification from GitHub and in the IDE.

Asking Copilot to create a pull request from Bate-Papo Copilot in Eclipse

Observação

Copilot cloud agent in Eclipse is in versão prévia pública, and subject to change.

  1. Open Copilot Chat do GitHub in Eclipse.

  2. Type a prompt explaining what you want Copilot to do.

    For example, Put backticks around file names and variables in output

  3. Click next to the Send button.

  4. In the dialog box that opens, select the repository you want Copilot to work in, then click Continue.

    Copilot will start a new session and respond with a link to the pull request it creates. It will work on the task and push changes to the pull request, and then add you as a reviewer when it has finished, triggering a notification from GitHub and in the IDE.

Asking Copilot to create a pull request from Bate-Papo Copilot in Visual Studio 2026

Observação

To use Copilot cloud agent in Visual Studio, you'll need to be running at least December Update 18.1.0 of Visual Studio 2026.

  1. Enable Copilot cloud agent support in Visual Studio.

    1. Open the Tools menu, then click Options.
    2. In the sidebar, select GitHub.
    3. Check the Enable Copilot Cloud agent (preview) box.
    4. Restart Visual Studio.
  2. Open Copilot Chat do GitHub in Visual Studio.

  3. Enter a prompt, giving details of what you want Copilot to change.

    For example, Put backticks around file names and variables in log output.

  4. Submit your prompt by clicking the Delegate this task to the GitHub Copilot cloud agent button, next to the Send button.

    Copilot asks you to confirm that you want to use the cloud agent to create a pull request.

  5. Click Confirm.

    Copilot will start a new session and respond with a link to the pull request it creates. It will work on the task and push changes to the pull request, and then add you as a reviewer when it has finished, triggering a notification.

Asking Copilot to create a pull request from Bate-Papo Copilot in GitHub.com

  1. Open Copilot Chat do GitHub on GitHub.com.

  2. Type /task to ask Copilot to create a pull request, and give details of what you want Copilot to change.

    For example, /task Create a pull request to put backticks around file names and variables in output.

  3. Optionally, select a base branch for Copilot's pull request. Copilot will create a new branch based on this branch, then push the changes to a pull request targeting that branch.

  4. Opcionalmente, você pode clicar para abrir o menu suspenso do agente, se quiser atribuir um agente ou um agente personalizado com ferramentas e comportamento especializados. Você pode selecionar um existente agente personalizado do seu repositório, organização ou empresa. Você também pode clicar em Criar um agente para criar um novo perfil do agente em seu repositório e branch selecionados. Para saber mais, confira Creating custom agents for Copilot cloud agent.

    Observação

    Agentes de codificação de terceiros estão disponíveis nos planos GitHub Copilot Pro+ e Copilot Enterprise.

  5. Click or press Enter.

    Copilot will start a new session, which will appear in the list below the prompt box. Copilot will work on the task and push changes to its pull request, then add you as a reviewer when it has finished, triggering a notification.

Asking Copilot to create a pull request from GitHub Mobile

  1. In GitHub Mobile, navigate to the repository where you want to create a pull request.

  2. Tap the icon in the bottom right corner of the screen.

  3. Enter a prompt to ask Copilot to create a pull request.

    For example: Create a pull request to ....

    Copilot responds with a brief summary of the task it will perform, asking for your confirmation before it proceeds.

  4. Check that Copilot has interpreted your prompt correctly, then tap Accept or Dismiss.

    Copilot creates a pull request and gives you a link to it. It will work on the task and push changes to the pull request, and then add you as a reviewer when it has finished, triggering a notification.

Asking Copilot to create a pull request from the GitHub CLI

Observação

The agent-task command set is only available in v2.80.0 or later of the GitHub CLI. This command set is a versão prévia pública and is subject to change.

You can start a new Copilot cloud agent session with the gh agent-task create command in the GitHub CLI.

When you run the command without any arguments, you are asked to enter a prompt. Copilot cloud agent acts on the prompt and opens a pull request in the current repository.

You can use command line options to:

  • Provide the prompt (gh agent-task create "Example prompt")
  • Choose a base branch, instead of using the repository's default branch (--base)
  • Select a repository, instead of targeting the current repository (--repo)
  • Follow the session log in real time (--follow)

To see all of the available options, run gh agent-task create --help.

Asking Copilot to create a pull request from the GitHub MCP server

Observação

  • This capability is only available on the remote GitHub MCP server and host applications where remote MCP servers are supported.
  1. Install the GitHub MCP server in your preferred IDE or agentic coding tool. See Usando o servidor MCP GitHub.

  2. Ensure the create_pull_request_with_copilot tool is enabled.

  3. Open chat.

  4. Type a prompt asking Copilot to create a pull request, with the details of what you want to change.

    For example, Open a PR in my repository to expand unit test coverage.

    Dica

    • You can ask Copilot to open a pull request using a specific branch as the base branch by including it in your prompt.
  5. Submit your prompt.

    Copilot will start a new session, open a draft pull request and work on the task in the background. As it works, it will push changes to the pull request, and once it has finished, it will add you as a reviewer. In most cases, the MCP host will show you the URL of the created pull request.

Asking Copilot to create a pull request from Raycast

Raycast is an extensible launcher for Windows and macOS. With the GitHub Copilot extension for Raycast, you can start and track Copilot cloud agent tasks and watch session logs live wherever you are on your computer.

  1. Install Raycast from the Raycast website.

  2. Install the GitHub Copilot extension for Raycast by clicking the Install Extension button on the extension's page.

  3. Open Raycast, search for "Copilot," find the Create Task command, then press Enter.

  4. Click Sign in with GitHub, then complete the authentication flow. Raycast will re-open.

  5. Type a prompt describing what you want Copilot to do.

    For example, Implement a user friendly message for common errors.

  6. Select the repository you want Copilot to work in.

  7. Optionally, select a base branch for Copilot's pull request. Copilot will create a new branch based on this branch, then push the changes to a pull request targeting that branch.

  8. Opcionalmente, selecione um agente personalizado com comportamento especializado e ferramentas no menu de opções. Para saber mais, confira Creating custom agents for Copilot cloud agent.

  9. Optionally, if you are a Copilot Pro do GitHub or GitHub Copilot Pro+ user, you can use the dropdown menu to select the model that Copilot will use. For more information, see Changing the AI model for GitHub Copilot cloud agent.

  10. Press Command+Enter (macOS) or Ctrl+Enter (Windows) to start the task.

    Copilot will start a new session. Copilot will work on the task and push changes to its pull request, then add you as a reviewer when it has finished, triggering a notification.

Observação

If you are unable to select a specific repository when starting a task, the organization that owns the repository may have enabled OAuth app access restrictions. To learn how to request approval for the "GitHub Copilot for Raycast" OAuth app, see Solicitar aprovação da organização para aplicativos OAuth.

Asking Copilot to create a pull request from the "New repository" page

When creating a new repository, you can ask Copilot to seed the new repository by entering a prompt.

  1. No canto superior direito de qualquer página, selecione e clique em Novo repositório.

    Captura de tela de um menu suspenso GitHub mostrando as opções para criar novos itens. Há um item de menu "Novo repositório" com o contorno em laranja escuro.

  2. Use o menu suspenso Proprietário para selecionar a conta que deseja atribuir como proprietário do repositório.

    Captura de tela do menu Proprietário de um novo repositório do GitHub. O menu mostra duas opções, octocat e github.

  3. In the Prompt field, enter a prompt describing what you want Copilot to build.

    For example, Create a Rust CLI for converting CSV spreadsheets to Markdown

  4. Clique em Criar repositório.

    Copilot will immediately open a draft pull request. Copilot will work on the task and push changes to its pull request, then add you as a reviewer when it has finished, triggering a notification.

Monitoring progress

You can view your current and past Copilot sessions from the agents panel, agents page, Visual Studio Code, and more. See Tracking GitHub Copilot's sessions.

Further reading