Repository navigation
Conversation
…ementation Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
… Go embedding Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…, and working test workflow Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
pelikhan
left a comment
There was a problem hiding this comment.
@copilot the server relies on the MCP typescript sdk which needs to be installed in the temp folder
- create a package.json that only contains the MCP server dependencies, run install to compute the package.lock file
- package the package.json and lock file as go embed resources
- save the package.json and package.lock in the temp MCP server folder and run "npm ci"
- run the MCP server starting from the temp folder so that the packages are correctly resolved.
| yaml.WriteString(" \"command\": \"node\",\n") | ||
| yaml.WriteString(" \"args\": [\"/tmp/safe-outputs-mcp/safe_outputs_mcp_server.js\"],\n") | ||
| yaml.WriteString(" \"env\": {\n") | ||
| yaml.WriteString(" \"GITHUB_AW_SAFE_OUTPUTS\": \"$GITHUB_AW_SAFE_OUTPUTS\",\n") |
There was a problem hiding this comment.
@copilot use the ${{ env.VAR_NAME }} syntax to set the variable value
There was a problem hiding this comment.
Fixed the environment variable syntax to use ${{ env.VAR_NAME }} format in all three engine files (claude_engine.go, codex_engine.go, custom_engine.go) as requested.
Changes made in commit a0a1ac3.
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
I've implemented the npm dependency management as requested. The MCP server now:
Changes made in commit a0a1ac3. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot add a task in the makefile for running "npm install" for new package. Make sure that the lock file is added to the repo |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Added Usage: Changes made in commit b37895e. |
|
@copilot move safe output server sources to a separate folder (pkg/workflow/mcp-safe-outputs) |
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Moved all MCP safe outputs server sources to the separate folder
All tests pass and the build works correctly with the new organization. Changes made in commit 7055257. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
…endency resolution Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
${{ env.VAR_NAME }}format in all three engine filesKey Changes
1. TypeScript MCP Server Implementation
safe_outputs_mcp_server.tsimplementing all 10 safe output types as MCP toolsGITHUB_AW_SAFE_OUTPUTS_CONFIGenvironment variable2. Go Embedding and Compilation Pipeline
npm run compilego:embedSafeOutputsMCPServerScript()function to access embedded content3. NPM Dependency Management
mcp_package.jsonwith only@modelcontextprotocol/sdkdependencymcp_package-lock.jsonfor reproducible buildsWriteSafeOutputsMCPServerToTemp()to automatically install npm dependencies usingnpm ciin temp directorymake mcp-installtask for updating MCP server dependencies4. MCP SDK Upgrade and Integration
github.com/modelcontextprotocol/go-sdkfrom v0.2.0 to v0.4.0CommandTransportandStreamableClientTransport5. Workflow Engine Integration
renderSafeOutputsClaudeMCPConfig(),renderSafeOutputsCodexMCPConfig(), andrenderSafeOutputsMCPConfig()methodsmcp: trueis set in safe-outputs configuration${{ env.VAR_NAME }}format for proper GitHub Actions expansioncwdparameter to all MCP server configurations to ensure Node.js dependencies are resolved from the correct temp directory6. Schema and Configuration Updates
mcpfield toSafeOutputsConfigstruct with proper YAML marshalingmain_workflow_schema.jsonto allow themcpboolean fieldextractSafeOutputsConfig()to parse the MCP flag from frontmatter7. Organized Project Structure
pkg/workflow/mcp-safe-outputs/directory8. Backward Compatibility
mcp: trueflagUsage Example
Workflows can now use MCP-based safe outputs:
Testing
safe_outputs_mcp_test.gotest-mcp-safe-outputs.mddemonstrating the functionalityThis implementation provides a more structured and protocol-compliant approach to safe outputs while maintaining full backward compatibility with existing workflows. The MCP server is fully self-contained with automatic dependency management, organized project structure, and proper working directory configuration, ensuring reliable execution in GitHub Actions environments.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.