Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/publish-mcp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Publish to MCP Registry

on:
push:
tags: ["mcp-v*"]

jobs:
publish:
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
defaults:
run:
working-directory: ./mcp
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install publisher
run: |
curl -L "https://github.com/modelcontextprotocol/registry/releases/download/v1.0.0/mcp-publisher_1.0.0_$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').tar.gz" | tar xz mcp-publisher

- name: Set server.json version to tag
run: |
VERSION=${GITHUB_REF_NAME#mcp-v}
jq --arg v "$VERSION" '.version = $v | .packages = (.packages // []) | .packages |= (.[]? // {}) | .packages |= map(if .registry_type == "pypi" then .version = $v else . end)' server.json > server.tmp.json && mv server.tmp.json server.json

- name: Validate server.json against schema
run: |
pip install jsonschema
python -c "import json,urllib.request;schema=json.load(urllib.request.urlopen('https://static.modelcontextprotocol.io/schemas/2025-07-09/server.schema.json'));data=json.load(open('server.json'));from jsonschema import validate, Draft7Validator;Draft7Validator.check_schema(schema);validate(instance=data, schema=schema);print('server.json is valid')"

- name: Login to MCP Registry (GitHub OIDC)
run: ./mcp-publisher login github-oidc

- name: Publish to MCP Registry
run: ./mcp-publisher publish
2 changes: 2 additions & 0 deletions mcp/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
with the ability to convert images to OME-Zarr format using the ngff-zarr
library.

<!-- mcp-name: io.github.thewtex/ngff-zarr -->

[![asciicast](https://asciinema.org/a/726628.png)](https://asciinema.org/a/726628)

## Features
Expand Down
6 changes: 3 additions & 3 deletions mcp/pixi.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions mcp/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ pytest-asyncio = ">=1.0.0,<2"
[tool.pixi.feature.dev.pypi-dependencies]
ngff-zarr-mcp = { path = ".", editable = true, extras = ["dev"] }
ngff-zarr = { path = "../py", editable = true, extras = ["cli", "tensorstore"] }
jsonschema = "*"

[tool.pixi.feature.dev.tasks]
test = "pytest tests/"
Expand All @@ -181,6 +182,7 @@ format-check = "black --check --diff ."
typecheck = "mypy ngff_zarr_mcp tests"
build = "hatch build"
all-checks = { depends-on = ["lint", "format-check", "typecheck"] }
validate-server-json = "python -c \"import json,urllib.request; from jsonschema import validate, Draft7Validator; schema=json.load(urllib.request.urlopen('https://static.modelcontextprotocol.io/schemas/2025-07-09/server.schema.json')); data=json.load(open('server.json')); Draft7Validator.check_schema(schema); validate(instance=data, schema=schema); print('server.json is valid')\""

[tool.pixi.feature.cloud.pypi-dependencies]
ngff-zarr-mcp = { path = ".", editable = true, extras = ["cloud"] }
Expand Down
21 changes: 21 additions & 0 deletions mcp/server.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-07-09/server.schema.json",
"name": "io.github.thewtex/ngff-zarr",
"description": "Model Context Protocol server for OME-Zarr image conversion and optimization using ngff-zarr.",
"version": "0.5.0",
"repository": {
"url": "https://github.com/thewtex/ngff-zarr",
"source": "github",
"subfolder": "mcp"
},
"packages": [
{
"registry_type": "pypi",
"identifier": "ngff-zarr-mcp",
"version": "0.5.0",
"transport": { "type": "stdio" },
"runtime_hint": "uvx",
"package_arguments": []
}
]
}
Loading