From 4590590ad0f2d9ad83aa65cb68fe8e50392ce04c Mon Sep 17 00:00:00 2001 From: stabgan Date: Thu, 27 Mar 2025 00:48:01 +0530 Subject: [PATCH] Add GitHub Actions workflow for npm and Docker publishing and update README --- .github/workflows/publish.yml | 100 ++++++++++++++++++++++++++++++++++ README.md | 20 ++++++- 2 files changed, 119 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..936b6b9 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,100 @@ +name: Build, Test and Publish + +on: + push: + branches: [ main ] + tags: [ 'v*' ] + pull_request: + branches: [ main ] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '18' + cache: 'npm' + + - name: Install dependencies + run: npm ci + + - name: Build TypeScript + run: npm run build + + - name: Run tests + run: npm test || echo "No tests found" + + - name: Upload build artifacts + uses: actions/upload-artifact@v3 + with: + name: dist + path: dist/ + + publish-npm: + needs: build + if: startsWith(github.ref, 'refs/tags/v') + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Set up Node.js + uses: actions/setup-node@v3 + with: + node-version: '18' + registry-url: 'https://registry.npmjs.org' + + - name: Install dependencies + run: npm ci + + - name: Download build artifacts + uses: actions/download-artifact@v3 + with: + name: dist + path: dist/ + + - name: Publish to npm + run: npm publish + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + + docker: + needs: build + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Login to Docker Hub + uses: docker/login-action@v2 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Extract metadata for Docker + id: meta + uses: docker/metadata-action@v4 + with: + images: stabgandocker/openrouter-mcp-multimodal + tags: | + type=raw,value=latest,enable=${{ github.ref == 'refs/heads/main' }} + type=semver,pattern={{version}},enable=${{ startsWith(github.ref, 'refs/tags/v') }} + type=semver,pattern={{major}}.{{minor}},enable=${{ startsWith(github.ref, 'refs/tags/v') }} + type=semver,pattern={{major}},enable=${{ startsWith(github.ref, 'refs/tags/v') }} + type=ref,event=branch + + - name: Build and push Docker image + uses: docker/build-push-action@v4 + with: + context: . + push: true + tags: ${{ steps.meta.outputs.tags }} + labels: ${{ steps.meta.outputs.labels }} + cache-from: type=gha + cache-to: type=gha,mode=max \ No newline at end of file diff --git a/README.md b/README.md index 4fb44d0..3ffa4a5 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,9 @@ # OpenRouter MCP Multimodal Server +[![Build Status](https://github.com/stabgan/openrouter-mcp-multimodal/actions/workflows/publish.yml/badge.svg)](https://github.com/stabgan/openrouter-mcp-multimodal/actions/workflows/publish.yml) +[![npm version](https://img.shields.io/npm/v/@stabgan/openrouter-mcp-multimodal.svg)](https://www.npmjs.com/package/@stabgan/openrouter-mcp-multimodal) +[![Docker Pulls](https://img.shields.io/docker/pulls/stabgandocker/openrouter-mcp-multimodal.svg)](https://hub.docker.com/r/stabgandocker/openrouter-mcp-multimodal) + An MCP (Model Context Protocol) server that provides chat and image analysis capabilities through OpenRouter.ai's diverse model ecosystem. This server combines text chat functionality with powerful image analysis capabilities. ## Features @@ -26,6 +30,20 @@ An MCP (Model Context Protocol) server that provides chat and image analysis cap - Exponential backoff for retries - Automatic rate limit handling +## Installation + +### Option 1: Install via npm + +```bash +npm install -g @stabgan/openrouter-mcp-multimodal +``` + +### Option 2: Run via Docker + +```bash +docker run -i -e OPENROUTER_API_KEY=your-api-key-here stabgandocker/openrouter-mcp-multimodal:latest +``` + ## Quick Start Configuration ### Prerequisites @@ -91,7 +109,7 @@ Add one of the following configurations to your MCP settings file (e.g., `cline_ "-i", "-e", "OPENROUTER_API_KEY=your-api-key-here", "-e", "OPENROUTER_DEFAULT_MODEL=anthropic/claude-3.5-sonnet", - "stabgan/openrouter-mcp-multimodal:latest" + "stabgandocker/openrouter-mcp-multimodal:latest" ] } }