diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d219ea7..e0dcdb4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,6 +9,9 @@ on: jobs: build: runs-on: ubuntu-latest + permissions: + id-token: write # Required for OIDC authentication + contents: read steps: - name: Checkout @@ -24,3 +27,21 @@ jobs: npm install npm run build npx vitest --watch=false + + - name: Build + run: npm run build + + - name: Update server.json version + run: | + VERSION=$(node -p "require('./package.json').version") + sed -i "s/{{VERSION}}/$VERSION/g" server.json + + - name: Install MCP Publisher + run: | + curl -L "https://github.com/modelcontextprotocol/registry/releases/download/v1.1.0/mcp-publisher_1.1.0_$(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 + run: ./mcp-publisher login github-oidc + + - name: Publish to MCP Registry + run: ./mcp-publisher publish diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..41db969 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,42 @@ +name: Publish to MCP Registry + +on: + push: + tags: + - '[0-9]+.[0-9]+.[0-9]+' + +jobs: + build-and-publish: + runs-on: ubuntu-latest + permissions: + contents: read + id-token: write + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: '20' + cache: npm + + - name: Install dependencies + run: npm ci + + - name: Build + run: npm run build + + - name: Update server.json version + run: sed -i "s/{{VERSION}}/$GITHUB_REF_NAME/g" server.json + + - name: Install MCP Publisher + run: | + curl -L "https://github.com/modelcontextprotocol/registry/releases/download/v1.1.0/mcp-publisher_1.1.0_$(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 + run: ./mcp-publisher login github-oidc + + - name: Publish to MCP Registry + run: ./mcp-publisher publish diff --git a/package.json b/package.json index b2cdcdf..5e52f13 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,8 @@ { "name": "@antv/mcp-server-chart", "description": "A Model Context Protocol server for generating charts using AntV. This is a TypeScript-based MCP server that provides chart generation capabilities. It allows you to create various types of charts through MCP tools.", - "version": "0.9.1", + "mcpName": "io.github.antvis/mcp-server-chart", + "version": "0.9.0-beta.1", "main": "build/index.js", "types": "build/index.d.ts", "exports": { diff --git a/server.json b/server.json new file mode 100644 index 0000000..fd8b769 --- /dev/null +++ b/server.json @@ -0,0 +1,46 @@ +{ + "$schema": "https://static.modelcontextprotocol.io/schemas/2025-09-16/server.schema.json", + "name": "io.github.antvis/mcp-server-chart", + "description": "A Model Context Protocol server for generating charts using AntV.", + "status": "active", + "repository": { + "url": "https://github.com/antvis/mcp-server-chart", + "source": "github" + }, + "version": "{{VERSION}}", + "packages": [ + { + "registryType": "npm", + "registryBaseUrl": "https://registry.npmjs.org", + "identifier": "@antv/mcp-server-chart", + "version": "{{VERSION}}", + "transport": { + "type": "stdio" + }, + "environmentVariables": [ + { + "name": "VIS_REQUEST_SERVER", + "description": "Custom chart generation service URL for private deployment", + "default": "https://antv-studio.alipay.com/api/gpt-vis", + "isRequired": false, + "format": "string", + "isSecret": false + }, + { + "name": "SERVICE_ID", + "description": "Service identifier for chart generation records", + "isRequired": false, + "format": "string", + "isSecret": true + }, + { + "name": "DISABLED_TOOLS", + "description": "Comma-separated list of tool names to disable", + "isRequired": false, + "format": "string", + "isSecret": false + } + ] + } + ] +}