Skip to content

Commit f131fe2

Browse files
authored
Merge pull request #12 from alex-feel/alex-feel-dev
Use proper claude mcp add command for Context7 server
2 parents dfbc2cf + ddc0f04 commit f131fe2

File tree

3 files changed

+47
-35
lines changed

3 files changed

+47
-35
lines changed

.github/workflows/lint.yml

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ on:
66

77
permissions:
88
contents: read
9+
security-events: write
910

1011
jobs:
1112
powershell:
@@ -14,31 +15,29 @@ jobs:
1415
runs-on: windows-latest
1516

1617
steps:
17-
- uses: actions/checkout@v4
18-
19-
- name: Install PSScriptAnalyzer
20-
shell: powershell
21-
run: |
22-
Set-PSRepository PSGallery -InstallationPolicy Trusted
23-
Install-Module -Name PSScriptAnalyzer -Force -Scope CurrentUser
18+
- uses: actions/checkout@v5
2419

2520
- name: Run PSScriptAnalyzer
26-
shell: powershell
27-
run: |
28-
$results = Invoke-ScriptAnalyzer -Path ./scripts/windows -Recurse -ReportSummary
29-
if ($results) {
30-
$results | Format-Table -AutoSize
31-
throw "PSScriptAnalyzer found issues"
32-
}
33-
Write-Host "PowerShell scripts passed analysis" -ForegroundColor Green
21+
uses: microsoft/psscriptanalyzer-action@v1.1
22+
with:
23+
path: ./scripts/windows
24+
recurse: true
25+
output: results.sarif
26+
ignorePattern: '\.git|\.github'
27+
28+
- name: Upload PSScriptAnalyzer results
29+
uses: github/codeql-action/upload-sarif@v3
30+
if: always()
31+
with:
32+
sarif_file: results.sarif
3433

3534
shellcheck:
3635
name: Shell Script Analysis
3736
if: ${{ ! startsWith(github.head_ref, 'release-please--branches--') }}
3837
runs-on: ubuntu-latest
3938

4039
steps:
41-
- uses: actions/checkout@v4
40+
- uses: actions/checkout@v5
4241

4342
- name: Run ShellCheck
4443
uses: ludeeus/action-shellcheck@master
@@ -53,10 +52,10 @@ jobs:
5352
runs-on: ubuntu-latest
5453

5554
steps:
56-
- uses: actions/checkout@v4
55+
- uses: actions/checkout@v5
5756

5857
- name: Run markdownlint
59-
uses: DavidAnson/markdownlint-cli2-action@v16
58+
uses: DavidAnson/markdownlint-cli2-action@v20
6059
with:
6160
globs: |
6261
**/*.md
@@ -69,7 +68,7 @@ jobs:
6968
runs-on: ubuntu-latest
7069

7170
steps:
72-
- uses: actions/checkout@v4
71+
- uses: actions/checkout@v5
7372

7473
- name: Validate JSON files
7574
run: |
@@ -99,7 +98,7 @@ jobs:
9998
runs-on: ubuntu-latest
10099

101100
steps:
102-
- uses: actions/checkout@v4
101+
- uses: actions/checkout@v5
103102

104103
- name: Run Trivy security scanner
105104
uses: aquasecurity/trivy-action@master

scripts/windows/setup-python-environment.ps1

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -202,23 +202,36 @@ Save-FileFromUrl -Url $promptUrl -Destination $promptPath
202202
# Step 6: Configure Context7 MCP server
203203
Write-Host ""
204204
Write-Host "Step 6: Configuring Context7 MCP server..." -ForegroundColor Cyan
205-
$mcpConfigPath = Join-Path $ClaudeUserDir "mcp.json"
206-
$mcpConfig = @'
207-
{
208-
"servers": {
209-
"context7": {
210-
"transport": "http",
211-
"url": "https://mcp.context7.com/mcp"
212-
}
213-
}
214-
}
215-
'@
216205

217206
try {
218-
[System.IO.File]::WriteAllText($mcpConfigPath, $mcpConfig)
219-
Write-Success "Created MCP configuration"
207+
# Run the command in a new PowerShell process that will have the updated PATH
208+
$mcpCommand = "claude mcp add --transport http context7 https://mcp.context7.com/mcp"
209+
210+
$mcpProcess = Start-Process -FilePath "powershell.exe" -ArgumentList @(
211+
"-NoProfile",
212+
"-Command",
213+
$mcpCommand
214+
) -Wait -PassThru -NoNewWindow
215+
216+
if ($mcpProcess.ExitCode -eq 0) {
217+
Write-Success "Context7 MCP server configured successfully"
218+
} else {
219+
# Try with cmd as a fallback (sometimes works better for npm global commands)
220+
$cmdProcess = Start-Process -FilePath "cmd.exe" -ArgumentList @(
221+
"/c",
222+
$mcpCommand
223+
) -Wait -PassThru -NoNewWindow
224+
225+
if ($cmdProcess.ExitCode -eq 0) {
226+
Write-Success "Context7 MCP server configured successfully"
227+
} else {
228+
Write-Warn "MCP server may not have been configured (exit code: $($cmdProcess.ExitCode))"
229+
Write-Info "To verify or add manually, run: claude mcp add --transport http context7 https://mcp.context7.com/mcp"
230+
}
231+
}
220232
} catch {
221-
Write-Warn "Failed to create MCP configuration: $_"
233+
Write-Warn "Could not configure MCP server automatically: $_"
234+
Write-Info "To add manually, run: claude mcp add --transport http context7 https://mcp.context7.com/mcp"
222235
}
223236

224237
# Step 7: Create launcher script

slash-commands/examples/commit.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
description: Create conventional commits with automatic staging and pre-commit validation
33
argument-hint: "[issue-id] [additional context]"
4-
allowed-tools: Bash(git *), Read, Grep
4+
allowed-tools: Bash, Read, Grep
55
---
66

77
# Git Commit Workflow

0 commit comments

Comments
 (0)