Fix safe-outputs MCP server tools registration by adding missing environment variables#11148
Merged
pelikhan merged 2 commits intocopilot/convert-safe-outputs-to-html-transportfrom Jan 22, 2026
Conversation
The safe-outputs MCP server was returning an empty tools list because critical environment variables were not set when the server started. Changes: - Add GH_AW_SAFE_OUTPUTS_TOOLS_PATH env var to point to /opt/gh-aw/safeoutputs/tools.json - Add GH_AW_SAFE_OUTPUTS_CONFIG_PATH env var to point to /opt/gh-aw/safeoutputs/config.json - Add GH_AW_MCP_LOG_DIR env var to point to /tmp/gh-aw/mcp-logs/safeoutputs - Export these variables in the server startup script Without these variables, the server fell back to /tmp/gh-aw/safeoutputs/ paths which don't exist, causing tools.json and config.json to not be found, resulting in 0 tools being registered. This fixes workflow run 21232781914 where the agent couldn't use create_issue and add_comment tools, falling back to writing markdown files that were never processed. File changed: pkg/workflow/mcp_setup_generator.go Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Investigate absence of created comments
Fix safe-outputs MCP server tools registration by adding missing environment variables
Jan 22, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Safe-outputs MCP server returned
{"tools":[]}when the MCP gateway calledtools/listat startup, preventing agents from usingcreate_issue,add_comment, and other safe-outputs operations.Root Cause
The server startup step was missing environment variables that specify file paths:
Without
GH_AW_SAFE_OUTPUTS_TOOLS_PATHandGH_AW_SAFE_OUTPUTS_CONFIG_PATH, the server'sloadTools()function couldn't find the workflow-generated tool definitions at/opt/gh-aw/safeoutputs/tools.jsonand returned an empty array.Changes
Modified
pkg/workflow/mcp_setup_generator.goto include missing environment variables:All workflow lock files regenerated with the fix applied.
Original prompt
💡 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.