-
Notifications
You must be signed in to change notification settings - Fork 9
feat(mcp): add MCP server for ralph-specum #75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
46285ca
0f78f57
e00dfc2
1f02573
fa88e45
fde4749
644f4c6
4b7395b
ae302a4
ff20fd6
fac6d19
f17c4c2
551e7f9
32b78fb
3e51a92
a3b691c
bff457e
5a14cb0
76dc2ad
c63613f
1f55978
d21ce1d
6bfa82d
ca46a43
e3c764a
d834d49
9fa11c5
e3ce5c4
fdca545
e215b2f
ce98a18
0e6f190
75fa1ef
5ae6796
528e306
d12738a
4d495a4
f4fd7ba
ba727df
f8ddc9d
19d8ebe
f14d7ec
67b6846
05921b5
ee56b32
af8b341
905258e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,111 @@ | ||
| name: MCP Server Release | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - 'v*' | ||
|
|
||
| permissions: | ||
| contents: write | ||
|
|
||
| jobs: | ||
| build: | ||
| name: Build binaries | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| matrix: | ||
| include: | ||
| - os: macos-latest | ||
| target: darwin-arm64 | ||
| artifact: ralph-specum-mcp-darwin-arm64 | ||
| - os: macos-13 | ||
| target: darwin-x64 | ||
| artifact: ralph-specum-mcp-darwin-x64 | ||
| - os: ubuntu-latest | ||
| target: linux-x64 | ||
| artifact: ralph-specum-mcp-linux-x64 | ||
| - os: windows-latest | ||
| target: windows-x64 | ||
| artifact: ralph-specum-mcp-windows-x64.exe | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Bun | ||
| uses: oven-sh/setup-bun@v2 | ||
| with: | ||
| bun-version: '1.2.0' | ||
|
|
||
| - name: Install dependencies | ||
| working-directory: mcp-server | ||
| run: bun install | ||
|
|
||
| - name: Build binary | ||
| working-directory: mcp-server | ||
| run: | | ||
| bun build src/index.ts --compile --target=bun-${{ matrix.target }} --outfile=dist/${{ matrix.artifact }} | ||
|
|
||
| - name: Upload artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: ${{ matrix.artifact }} | ||
| path: mcp-server/dist/${{ matrix.artifact }} | ||
|
|
||
| release: | ||
| name: Create GitHub Release | ||
| needs: build | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Download all artifacts | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| path: dist | ||
| merge-multiple: true | ||
|
|
||
| - name: List artifacts | ||
| run: ls -la dist/ | ||
|
|
||
| - name: Create Release | ||
| uses: softprops/action-gh-release@v2 | ||
| with: | ||
| files: | | ||
| dist/ralph-specum-mcp-darwin-arm64 | ||
| dist/ralph-specum-mcp-darwin-x64 | ||
| dist/ralph-specum-mcp-linux-x64 | ||
| dist/ralph-specum-mcp-windows-x64.exe | ||
| generate_release_notes: true | ||
| draft: false | ||
| prerelease: ${{ contains(github.ref, '-alpha') || contains(github.ref, '-beta') || contains(github.ref, '-rc') }} | ||
|
|
||
| publish-npm: | ||
| name: Publish to npm | ||
| needs: build | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Bun | ||
| uses: oven-sh/setup-bun@v2 | ||
| with: | ||
| bun-version: '1.2.0' | ||
|
|
||
| - name: Setup Node.js for npm publish | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '22' | ||
| registry-url: 'https://registry.npmjs.org' | ||
|
|
||
| - name: Install dependencies | ||
| working-directory: mcp-server | ||
| run: bun install | ||
|
|
||
| - name: Publish to npm | ||
| working-directory: mcp-server | ||
| run: npm publish --access public | ||
| env: | ||
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 22 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| registry=https://registry.npmmirror.com/ | ||
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| { | ||
| "name": "@smart-ralph/ralph-specum-mcp", | ||
| "version": "0.1.0", | ||
| "type": "module", | ||
| "description": "MCP server for Ralph Specum spec-driven development", | ||
| "main": "src/index.ts", | ||
| "bin": { | ||
| "ralph-specum-mcp": "src/index.ts" | ||
| }, | ||
| "scripts": { | ||
| "start": "bun run src/index.ts", | ||
| "build": "bun build src/index.ts --compile --outfile=dist/ralph-specum-mcp", | ||
| "build:all": "./scripts/build.sh", | ||
| "typecheck": "tsc --noEmit", | ||
| "test": "bun test" | ||
| }, | ||
| "dependencies": { | ||
| "@modelcontextprotocol/sdk": "^1.0.0", | ||
| "zod": "^3.25.0" | ||
| }, | ||
| "devDependencies": { | ||
| "@types/bun": "latest", | ||
| "typescript": "^5.7.0" | ||
| }, | ||
| "keywords": [ | ||
| "mcp", | ||
| "model-context-protocol", | ||
| "ralph", | ||
| "spec-driven-development" | ||
| ], | ||
| "author": "", | ||
| "license": "MIT" | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| #!/bin/bash | ||
| set -e | ||
|
|
||
| VERSION=$(jq -r '.version' package.json) | ||
| OUTDIR="dist" | ||
|
|
||
| mkdir -p "$OUTDIR" | ||
|
|
||
| platforms=( | ||
| "bun-darwin-arm64" | ||
| "bun-darwin-x64" | ||
| "bun-linux-x64" | ||
| "bun-windows-x64" | ||
| ) | ||
|
|
||
| built_count=0 | ||
| failed_count=0 | ||
|
|
||
| for platform in "${platforms[@]}"; do | ||
| echo "Building for $platform..." | ||
| outfile="$OUTDIR/ralph-specum-mcp-${platform#bun-}" | ||
| [[ "$platform" == *windows* ]] && outfile="${outfile}.exe" | ||
|
|
||
| if bun build --compile --target="$platform" ./src/index.ts --outfile "$outfile" 2>&1; then | ||
| built_count=$((built_count + 1)) | ||
| echo " Success: $outfile" | ||
| else | ||
| failed_count=$((failed_count + 1)) | ||
| echo " Failed: $platform (cross-compilation may require network access)" | ||
| fi | ||
| done | ||
|
|
||
| echo "" | ||
| echo "Build complete. $built_count succeeded, $failed_count failed." | ||
| echo "Binaries in $OUTDIR/:" | ||
| ls -la "$OUTDIR/" 2>/dev/null || echo "No binaries found" | ||
|
|
||
| # Exit with error if no binaries were built | ||
| if [ "$built_count" -eq 0 ]; then | ||
| echo "Error: No binaries were built" | ||
| exit 1 | ||
| fi |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,40 @@ | ||||||||||||||||||||||||||||||||||
| #!/bin/bash | ||||||||||||||||||||||||||||||||||
| set -e | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| REPO="tzachbon/smart-ralph-mcp-server" | ||||||||||||||||||||||||||||||||||
| BINARY_NAME="ralph-specum-mcp" | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| # Detect OS and architecture | ||||||||||||||||||||||||||||||||||
| OS=$(uname -s | tr '[:upper:]' '[:lower:]') | ||||||||||||||||||||||||||||||||||
| ARCH=$(uname -m) | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| case "$ARCH" in | ||||||||||||||||||||||||||||||||||
| x86_64) ARCH="x64" ;; | ||||||||||||||||||||||||||||||||||
| aarch64|arm64) ARCH="arm64" ;; | ||||||||||||||||||||||||||||||||||
| *) echo "Unsupported architecture: $ARCH"; exit 1 ;; | ||||||||||||||||||||||||||||||||||
| esac | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| case "$OS" in | ||||||||||||||||||||||||||||||||||
| darwin|linux) ;; | ||||||||||||||||||||||||||||||||||
| mingw*|msys*|cygwin*) OS="windows" ;; | ||||||||||||||||||||||||||||||||||
| *) echo "Unsupported OS: $OS"; exit 1 ;; | ||||||||||||||||||||||||||||||||||
| esac | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| # Get latest release | ||||||||||||||||||||||||||||||||||
| LATEST=$(curl -fsSL "https://api.github.com/repos/$REPO/releases/latest" | grep tag_name | cut -d'"' -f4) | ||||||||||||||||||||||||||||||||||
| ASSET="${BINARY_NAME}-${OS}-${ARCH}" | ||||||||||||||||||||||||||||||||||
| [[ "$OS" == "windows" ]] && ASSET="${ASSET}.exe" | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| # Download and install | ||||||||||||||||||||||||||||||||||
| INSTALL_DIR="${INSTALL_DIR:-/usr/local/bin}" | ||||||||||||||||||||||||||||||||||
| echo "Installing $BINARY_NAME $LATEST to $INSTALL_DIR..." | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| curl -fsSL "https://github.com/$REPO/releases/download/$LATEST/$ASSET" -o "/tmp/$BINARY_NAME" | ||||||||||||||||||||||||||||||||||
| chmod +x "/tmp/$BINARY_NAME" | ||||||||||||||||||||||||||||||||||
| sudo mv "/tmp/$BINARY_NAME" "$INSTALL_DIR/$BINARY_NAME" | ||||||||||||||||||||||||||||||||||
|
Comment on lines
+32
to
+34
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Security: No checksum verification for downloaded binary. Downloading and executing a binary without verifying its integrity poses a supply-chain attack risk. Consider publishing checksums with releases and verifying them before installation. Suggested approach
curl -fsSL "https://github.com/$REPO/releases/download/$LATEST/$ASSET" -o "/tmp/$BINARY_NAME"
+curl -fsSL "https://github.com/$REPO/releases/download/$LATEST/checksums.txt" -o "/tmp/checksums.txt"
+
+EXPECTED_HASH=$(grep "$ASSET" /tmp/checksums.txt | awk '{print $1}')
+ACTUAL_HASH=$(sha256sum "/tmp/$BINARY_NAME" | awk '{print $1}')
+if [[ "$EXPECTED_HASH" != "$ACTUAL_HASH" ]]; then
+ echo "Error: Checksum verification failed!"
+ rm -f "/tmp/$BINARY_NAME" "/tmp/checksums.txt"
+ exit 1
+fi
+
chmod +x "/tmp/$BINARY_NAME"📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| echo "Installed! Add to your MCP client config:" | ||||||||||||||||||||||||||||||||||
| echo "" | ||||||||||||||||||||||||||||||||||
| echo ' "ralph-specum": {' | ||||||||||||||||||||||||||||||||||
| echo " \"command\": \"$INSTALL_DIR/$BINARY_NAME\"" | ||||||||||||||||||||||||||||||||||
| echo ' }' | ||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reconsider using a regional npm mirror as the default registry.
Using
registry.npmmirror.com(a China-based npm mirror) as the default registry in a committed.npmrccan cause issues:https://registry.npmjs.org/).Consider removing this file or using the official npm registry. Individual developers can configure regional mirrors locally without committing them to the repository.
Suggested fix
Either remove
mcp-server/.npmrcentirely, or use the official registry:📝 Committable suggestion
🤖 Prompt for AI Agents