Skip to content

Commit 9a87d3a

Browse files
emcdclaude
andcommitted
Add MCP server integration and instructions download to Claude GitHub Actions workflow
- Add Node.js 22 setup for context7 MCP server - Add UV installation for librovore MCP server - Create custom .mcp.json with context7 and librovore configuration - Add instructions download step from docs-1 tag with proper error handling - Download architecture, practices, style guides and other documentation - Position MCP setup and instructions download before Claude Code execution 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 9af2941 commit 9a87d3a

3 files changed

Lines changed: 95 additions & 9 deletions

File tree

.auxiliary/notes/claude-gha-enhancements.md

Lines changed: 30 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,36 @@ Add to xrepo workflow:
9292
- Create new `gha-1.*` tag
9393
- Force-retarget `gha-1` floating tag with preserved message
9494

95-
## Validation Criteria
96-
97-
1. ✅ Claude Code action v1 functions correctly
98-
2. ✅ Manual workflow triggers work
99-
3. ✅ MCP servers are discoverable by workflow Claude
100-
4. ✅ Instructions are available at runtime
101-
5. ✅ Subagents function with downloaded instructions
102-
6. ✅ No regression in existing workflow functionality
95+
## Progress Status
96+
97+
### Completed ✅
98+
1. **Claude Code action v1 upgrade** - Fixed parameter conversion to `claude_args`
99+
2. **Manual workflow triggers** - `workflow_dispatch` with prompt parameter working
100+
3. **Parameter plumbing** - Prompt flows from dispatch to cross-repo workflow
101+
4. **Basic workflow functionality** - All setup steps and Claude execution working
102+
103+
### Current Phase: MCP Server Integration 🔄
104+
105+
#### Step 4A: Add MCP Configuration Generation
106+
- Add Node.js setup step for context7
107+
- Add UV installation step for librovore
108+
- Create custom `.mcp.json` with context7 and librovore servers
109+
- Position before "Execute Claude Code" step
110+
111+
#### Step 4B: Add Instructions Download
112+
- Add step to download/stage instructions to `.auxiliary/instructions`
113+
- Ensure instructions are available before Claude execution
114+
- Follow existing pattern from configure-clone.bash
115+
116+
#### Step 4C: Test MCP Integration
117+
- Test via workflow_dispatch with MCP validation prompt
118+
- Verify Claude can see context7 and librovore MCP servers
119+
- Verify subagent availability (depends on instructions)
120+
121+
### Remaining: Production Integration 📋
122+
1. Update `gha-1` tag with complete working configuration
123+
2. Revert claude.yaml to point back to `@gha-1`
124+
3. Final validation and documentation update
103125

104126
## Risk Mitigation
105127

.github/workflows/claude.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
pull-requests: read
3838
uses: emcd/python-project-common/.github/workflows/xrepo--claude.yaml@master
3939
with:
40-
allowed-tools: 'Bash(git add:*),Bash(git branch:*),Bash(git checkout:*),Bash(git diff:*),Bash(git log:*),Bash(git ls-files:*),Bash(git remote:*),Bash(git reset:*),Bash(git rev-parse:*),Bash(git rm:*),Bash(git status),Bash(hatch:*),Bash(pip:*),Bash(python:*),Edit,Write'
40+
allowed-tools: 'Bash(git add:*),Bash(git branch:*),Bash(git checkout:*),Bash(git diff:*),Bash(git log:*),Bash(git ls-files:*),Bash(git remote:*),Bash(git reset:*),Bash(git rev-parse:*),Bash(git rm:*),Bash(git status),Bash(hatch:*),Bash(pip:*),Bash(python:*),Edit,Write,mcp__context7__resolve-library-id,mcp__context7__get-library-docs,mcp__librovore__query_inventory,mcp__librovore__query_content'
4141
python-version: '${{ fromJSON(needs.initialize.outputs.python-versions)[0] }}'
4242
timeout-minutes: 20
4343
prompt: ${{ inputs.prompt }}

.github/workflows/xrepo--claude.yaml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,70 @@ jobs:
5252
fi
5353
shell: bash
5454

55+
- name: Setup Node.js
56+
uses: actions/setup-node@v4
57+
with:
58+
node-version: '22'
59+
60+
- name: Install UV
61+
run: pip install uv
62+
63+
- name: Create MCP Configuration
64+
run: |
65+
cat > .mcp.json << 'EOF'
66+
{
67+
"mcpServers": {
68+
"context7": {
69+
"command": "npx",
70+
"args": ["-y", "@upstash/context7-mcp"]
71+
},
72+
"librovore": {
73+
"command": "uvx",
74+
"args": ["librovore", "serve"]
75+
}
76+
}
77+
}
78+
EOF
79+
echo "::notice::Created custom MCP configuration with context7 and librovore"
80+
shell: bash
81+
82+
- name: Download Instructions
83+
run: |
84+
set -eu
85+
instructions_dir=".auxiliary/instructions"
86+
base_url="https://raw.githubusercontent.com/emcd/python-project-common/refs/tags/docs-1/documentation/common"
87+
files=("architecture.rst" "nomenclature.rst" "nomenclature-germanic.rst" "practices.rst" "requirements.rst" "style.rst" "tests.rst")
88+
89+
# Create instructions directory if it doesn't exist
90+
mkdir -p "$instructions_dir"
91+
92+
echo "Downloading project documentation guides to .auxiliary/instructions/"
93+
94+
success_count=0
95+
for file in "${files[@]}"; do
96+
url="$base_url/$file"
97+
output_path="$instructions_dir/$file"
98+
99+
if curl --fail --silent --location --output "$output_path" "$url"; then
100+
if [ -s "$output_path" ]; then
101+
echo "::notice::Downloaded $file ($(wc -c < "$output_path") bytes)"
102+
success_count=$((success_count + 1))
103+
else
104+
echo "::error::Downloaded $file but file is empty"
105+
rm -f "$output_path"
106+
fi
107+
else
108+
echo "::error::Failed to download $file"
109+
fi
110+
done
111+
112+
if [ $success_count -eq ${#files[@]} ]; then
113+
echo "::notice::Successfully downloaded all ${#files[@]} documentation guides"
114+
else
115+
echo "::warning::Only downloaded $success_count of ${#files[@]} documentation guides"
116+
fi
117+
shell: bash
118+
55119
- name: Execute Claude Code
56120
id: claude
57121
uses: anthropics/claude-code-action@v1

0 commit comments

Comments
 (0)