Skip to content

Add docs tool to MCP server that returns instructions.md sources#1046

Closed
Copilot wants to merge 5 commits intomainfrom
copilot/fix-e5fcab61-2702-4ed5-ae87-c2b2c60edba6
Closed

Add docs tool to MCP server that returns instructions.md sources#1046
Copilot wants to merge 5 commits intomainfrom
copilot/fix-e5fcab61-2702-4ed5-ae87-c2b2c60edba6

Conversation

Copy link
Contributor

Copilot AI commented Sep 26, 2025

This PR adds a new "docs" tool to the GitHub Agentic Workflows MCP server that provides direct access to the embedded instructions.md template content.

Problem

AI assistants and MCP clients working with GitHub Agentic Workflows needed easy access to the complete documentation and instructions. Previously, there was no programmatic way to retrieve the comprehensive workflow documentation through the MCP interface.

Solution

Added a new docs tool to the MCP server that returns the full instructions.md template content (~34KB of documentation covering workflow syntax, tools, examples, and best practices).

Implementation Details

New GetInstructionsTemplate() function

Added a clean accessor function in pkg/cli/commands.go that provides access to the embedded instructions template, following the same pattern as GetVersion().

Docs tool in MCP server

The new tool in pkg/cli/mcp_server.go:

  • Returns the complete GitHub Agentic Workflows documentation
  • Supports verbose logging consistent with other tools
  • Uses minimal arguments (optional verbose flag only)
  • Follows the established MCP tool implementation pattern

Updated help and tooling

  • Added docs tool to gh aw mcp serve --help output
  • Updated --allowed-tools flag description to include the new tool
  • Maintained consistent formatting with existing tool descriptions

Usage

# Start MCP server with all tools (including docs)
gh aw mcp serve

# Start with only the docs tool
gh aw mcp serve --allowed-tools docs

# Use with other tools
gh aw mcp serve --allowed-tools compile,docs

The tool returns the complete 969-line instructions template, enabling AI assistants to reference workflow syntax, tool configurations, security considerations, and usage examples directly through the MCP interface.

Testing

  • Added unit tests for the new GetInstructionsTemplate() function
  • Updated integration tests to account for the additional tool (10 instead of 9)
  • Verified manual functionality with various tool filtering combinations
  • All existing tests continue to pass
Original prompt

Add a "documentation" tool in the MCP server that returns the instructions.md sources.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits September 26, 2025 14:15
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
enable - Enable workflows
disable - Disable workflows
status - Show status of natural language action files and workflows
documentation - Get GitHub Agentic Workflows documentation and instructions
Copy link
Contributor

Choose a reason for hiding this comment

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

@copilot rename documentation to docs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Renamed "documentation" to "docs" throughout the codebase. Changes include tool name, argument struct, help text, tests, and allowed-tools flag description. (commit 82a6ed4)

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add a "documentation" tool in the MCP server that returns the instructions.md sources. Add documentation tool to MCP server that returns instructions.md sources Sep 26, 2025
Copilot AI requested a review from pelikhan September 26, 2025 14:29
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title Add documentation tool to MCP server that returns instructions.md sources Add docs tool to MCP server that returns instructions.md sources Sep 26, 2025
@pelikhan pelikhan closed this Sep 26, 2025
@pelikhan pelikhan deleted the copilot/fix-e5fcab61-2702-4ed5-ae87-c2b2c60edba6 branch September 30, 2025 15:24
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