Skip to content
Merged
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
79 changes: 79 additions & 0 deletions .github/workflows/publish-mcp-registry.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
name: Publish MCP Registry

on:
push:
branches: [ main ]
paths:
- server.json
workflow_dispatch:

concurrency:
group: publish-mcp-registry
cancel-in-progress: false

jobs:
publish:
if: github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write

steps:
- name: Check out repository
uses: actions/checkout@v5
Comment thread
adarshdigievo marked this conversation as resolved.

- name: Check registry version alignment
run: |
PROJECT_VERSION="$(python3 -c 'import tomllib; print(tomllib.load(open("pyproject.toml", "rb"))["project"]["version"])')"
REGISTRY_VERSION="$(jq -r '.version' server.json)"
if [[ "${PROJECT_VERSION}" != "${REGISTRY_VERSION}" ]]; then
echo "::error title=Version mismatch::pyproject.toml is ${PROJECT_VERSION}, but server.json is ${REGISTRY_VERSION}. Keep both versions aligned."
exit 1
fi

# Registry versions are immutable. Every server.json metadata update must
# use a version that has not previously been published.
- name: Check registry version is unpublished
run: |
SERVER_NAME="$(jq -r '.name' server.json)"
SERVER_VERSION="$(jq -r '.version' server.json)"
ENCODED_NAME="$(jq -rn --arg value "${SERVER_NAME}" '$value | @uri')"
ENCODED_VERSION="$(jq -rn --arg value "${SERVER_VERSION}" '$value | @uri')"
REGISTRY_URL="https://registry.modelcontextprotocol.io/v0.1/servers/${ENCODED_NAME}/versions/${ENCODED_VERSION}"
HTTP_STATUS="$(curl --silent --show-error --location \
--output registry-version.json \
--write-out '%{http_code}' \
"${REGISTRY_URL}")"

case "${HTTP_STATUS}" in
404)
;;
200)
echo "::error title=Registry version already exists::${SERVER_NAME} ${SERVER_VERSION} is already published. Bump version in server.json and pyproject.toml before publishing metadata changes."
exit 1
;;
*)
echo "::error title=Registry lookup failed::The registry returned HTTP ${HTTP_STATUS} while checking ${SERVER_NAME} ${SERVER_VERSION}."
cat registry-version.json
exit 1
;;
esac

- name: Install MCP publisher
env:
MCP_PUBLISHER_VERSION: v1.8.1
MCP_PUBLISHER_SHA256: a06c9096dcb9727c13555b6be26c7effa707b01f06a4c561ba7a3635443cf2cc
run: |
curl --fail --location --silent --show-error \
--output mcp-publisher.tar.gz \
"https://github.com/modelcontextprotocol/registry/releases/download/${MCP_PUBLISHER_VERSION}/mcp-publisher_linux_amd64.tar.gz"
echo "${MCP_PUBLISHER_SHA256} mcp-publisher.tar.gz" | sha256sum --check -
tar -xzf mcp-publisher.tar.gz mcp-publisher
chmod +x mcp-publisher

- name: Authenticate to MCP Registry
run: ./mcp-publisher login github-oidc

- name: Publish server metadata
run: ./mcp-publisher publish server.json
9 changes: 9 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,14 @@ jobs:
- name: Install dependencies
run: uv sync --group dev --frozen

- name: Check registry version alignment
run: |
PROJECT_VERSION="$(uv run --no-sync python -c 'import tomllib; print(tomllib.load(open("pyproject.toml", "rb"))["project"]["version"])')"
REGISTRY_VERSION="$(jq -r '.version' server.json)"
if [[ "${PROJECT_VERSION}" != "${REGISTRY_VERSION}" ]]; then
echo "::error title=Version mismatch::pyproject.toml is ${PROJECT_VERSION}, but server.json is ${REGISTRY_VERSION}. Keep both versions aligned."
exit 1
fi

- name: Run tests
run: uv run pytest -q
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "serpapi-mcp-server"
version = "0.6.0"
version = "1.0.2"
description = "A Model Context Protocol (MCP) server implementation that integrates with SerpApi for comprehensive search engine results and data extraction"
requires-python = ">=3.12"
dependencies = [
Expand Down
18 changes: 14 additions & 4 deletions server.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,26 @@
{
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
"name": "io.github.serpapi/serpapi-mcp",
"version": "1.0.1",
"title": "SerpApi",
"version": "1.0.2",
"description": "Official SerpApi MCP server for Google, Bing, and other search engines.",
"websiteUrl": "https://serpapi.com/",
"repository": {
"url": "https://github.com/serpapi/serpapi-mcp",
"source": "github"
},
"remotes": [
{
"type": "http",
"url": "https://mcp.serpapi.com/mcp"
"type": "streamable-http",
"url": "https://mcp.serpapi.com/{SERPAPI_API_KEY}/mcp",
"variables": {
Comment thread
adarshdigievo marked this conversation as resolved.
"SERPAPI_API_KEY": {
"description": "Your SerpApi API key. Get one at https://serpapi.com/manage-api-key",
"isRequired": true,
"isSecret": true,
"placeholder": "your-serpapi-api-key"
}
}
}
]
}
}
2 changes: 1 addition & 1 deletion uv.lock

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

Loading