Skip to main content
Glama
publish.yml3.04 kB
name: Publish to npm on: release: types: [published] workflow_run: workflows: ["Release Please"] types: [completed] workflow_dispatch: inputs: publish_to_registry: description: 'Force MCP registry publish without npm release' required: false default: false type: boolean permissions: contents: read id-token: write # for npm trusted publishing (OIDC) and provenance jobs: publish: if: >- ${{ github.event_name == 'release' || (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success') || github.event_name == 'workflow_dispatch' }} name: Publish package runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v6 - name: Setup Node.js uses: actions/setup-node@v6 with: node-version: 20.x cache: 'npm' registry-url: 'https://registry.npmjs.org' - name: Update npm for OIDC trusted publishing run: npm install -g npm@latest - name: Install dependencies run: npm ci - name: Build run: npm run build - name: Verify package contents run: npm pack --dry-run - name: Read package version id: pkg run: | node -e "console.log('version=' + require('./package.json').version)" >> "$GITHUB_OUTPUT" - name: Check if version already exists on npm id: exists run: | set -e PKG_NAME=$(node -p -e "require('./package.json').name") VERSION=${{ steps.pkg.outputs.version }} if npm view "${PKG_NAME}@${VERSION}" version > /dev/null 2>&1; then echo "exists=true" >> "$GITHUB_OUTPUT" echo "Version ${VERSION} already published for ${PKG_NAME}; skipping publish." else echo "exists=false" >> "$GITHUB_OUTPUT" echo "Version ${VERSION} not found on registry; will publish." fi - name: Publish to npm if: steps.exists.outputs.exists == 'false' run: npm publish --access public --provenance - name: Install MCP Publisher if: steps.exists.outputs.exists == 'false' || (github.event_name == 'workflow_dispatch' && github.event.inputs.publish_to_registry == 'true') run: | curl -L "https://github.com/modelcontextprotocol/registry/releases/download/v1.3.10/mcp-publisher_$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').tar.gz" \ | tar xz mcp-publisher - name: Login to MCP Registry if: steps.exists.outputs.exists == 'false' || (github.event_name == 'workflow_dispatch' && github.event.inputs.publish_to_registry == 'true') run: ./mcp-publisher login github-oidc - name: Publish to MCP Registry if: steps.exists.outputs.exists == 'false' || (github.event_name == 'workflow_dispatch' && github.event.inputs.publish_to_registry == 'true') run: ./mcp-publisher publish

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Daghis/teamcity-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server