Skip to content

Add /scout command workflow with Tavily MCP integration#1190

Merged
pelikhan merged 4 commits intomainfrom
copilot/add-scout-command-workflow
Oct 3, 2025
Merged

Add /scout command workflow with Tavily MCP integration#1190
pelikhan merged 4 commits intomainfrom
copilot/add-scout-command-workflow

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Oct 3, 2025

This PR adds a new agentic workflow that responds to the /scout command in GitHub issues, pull requests, and comments. The Scout agent performs deep research using the Tavily MCP server for web search capabilities.

Overview

When users comment /scout in an issue or pull request, or manually trigger the workflow via workflow_dispatch, the workflow triggers an AI research agent that:

  1. Analyzes the context - Reads the issue/PR content and triggering comment to understand the research request, or uses the provided research topic
  2. Conducts deep research - Uses Tavily search tools to gather comprehensive information from multiple sources
  3. Synthesizes findings - Cross-references sources and evaluates information quality, recency, and applicability
  4. Delivers actionable insights - Posts a structured research report with recommendations and citations

Implementation Details

AI Engine

The workflow uses GitHub Copilot CLI as the AI engine to process research requests and generate comprehensive reports.

Tavily MCP Integration

The workflow integrates Tavily as an HTTP MCP server:

mcp-servers:
  tavily:
    url: "https://mcp.tavily.com/mcp/?tavilyApiKey=${{ secrets.TAVILY_API_KEY }}"
    allowed: ["*"]

This provides the Copilot agent access to Tavily's search capabilities while maintaining security through GitHub Secrets.

Trigger Methods

The workflow supports two trigger methods:

  1. Command trigger: Comment /scout in any issue, PR, or comment
  2. Manual dispatch: Trigger via Actions tab with a custom topic input string

When triggered via workflow_dispatch, the topic input is inlined directly in the agent's prompt for focused research.

Security & Permissions

The workflow follows the safe-outputs pattern for security:

  • Main job permissions: contents: read, actions: read (minimal access)
  • Comment creation: Handled by separate job with issues: write and pull-requests: write
  • Context sanitization: Uses needs.activation.outputs.text for safe content handling

Research Report Format

The Scout agent generates comprehensive reports including:

  • Executive Summary - Quick overview of key findings
  • Research Findings - Detailed results organized by topic with source citations
  • Recommendations - Specific, actionable suggestions
  • Key Sources - Referenced documentation and articles with links
  • Suggested Next Steps - Concrete action items

Usage

To enable this workflow:

  1. Add the TAVILY_API_KEY secret to your repository (get your API key from Tavily)
  2. Use one of the following methods:
    • Via comment: Comment /scout followed by your research request in any issue or PR
    • Via workflow_dispatch: Manually trigger the workflow from the Actions tab with a research topic
  3. The Scout agent will respond with a comprehensive research report

Example comment:

/scout What are the best practices for implementing MCP servers with HTTP transport?

Example workflow_dispatch: Navigate to Actions → Scout Deep Research Agent → Run workflow, then enter your research topic.

Files Changed

  • .github/workflows/scout.md - Workflow definition with command trigger, workflow_dispatch support, and research prompt
  • .github/workflows/scout.lock.yml - Compiled GitHub Actions workflow (auto-generated)

All tests pass and the workflow compiles successfully.

Original prompt

Generate an agentic workflow that responds to the "/scout" command and responds with a comment.

It goes and does a deep research using the comment content and potentially the issue/pull request context.

Scout uses the Tavily MCP for search with the secrets.TAVILY_API_KEY secret.

Remote http MCP server: https://mcp.tavily.com/mcp/?tavilyApiKey=

https://github.com/tavily-ai/tavily-mcp


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add agentic workflow for scout command response Add /scout command workflow with Tavily MCP integration Oct 3, 2025
Copilot AI requested a review from pelikhan October 3, 2025 05:17
@pelikhan
Copy link
Copy Markdown
Collaborator

pelikhan commented Oct 3, 2025

@copilot

  • use copilot

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Oct 3, 2025

@copilot

  • use copilot

Changed the scout workflow to use the copilot engine in commit 8f647b1.

@@ -0,0 +1,128 @@
---
on:
command:
Copy link
Copy Markdown
Collaborator

@pelikhan pelikhan Oct 3, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot add support for a workflow_dispatch + input topic string way to launch the workflow. Make sure to inline the input in the prompt.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added workflow_dispatch support with a topic input string. The input is inlined in the agent's prompt as requested in commit baa9673.

Copy link
Copy Markdown
Collaborator

@pelikhan pelikhan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot add workflow_dispatch support

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copy link
Copy Markdown
Contributor Author

Copilot AI commented Oct 3, 2025

@copilot add workflow_dispatch support

Added workflow_dispatch trigger with topic input in commit baa9673. The workflow can now be triggered manually via the Actions tab with a research topic.

Copilot AI requested a review from pelikhan October 3, 2025 14:05
@pelikhan pelikhan marked this pull request as ready for review October 3, 2025 14:13
@pelikhan pelikhan merged commit a9c6a36 into main Oct 3, 2025
@pelikhan pelikhan deleted the copilot/add-scout-command-workflow branch October 3, 2025 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants