Skip to content

Commit 39ab098

Browse files
committed
Add MCP publishing workflow, validation script, and server configuration
1 parent 76bf165 commit 39ab098

File tree

5 files changed

+202
-1
lines changed

5 files changed

+202
-1
lines changed

.github/workflows/publish-mcp.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Publish to MCP Registry
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Version to publish'
8+
required: true
9+
type: string
10+
11+
jobs:
12+
13+
# from https://github.com/domdomegg/time-mcp-pypi/blob/master/.github/workflows/ci.yml
14+
publish:
15+
needs: ci
16+
runs-on: ubuntu-latest
17+
timeout-minutes: 15
18+
permissions:
19+
contents: write # Required for creating GitHub releases
20+
id-token: write # Required for MCP registry OIDC authentication
21+
env:
22+
CI: true
23+
steps:
24+
- name: Checkout ${{ github.sha }}
25+
uses: actions/checkout@v4
26+
27+
- name: Set up Python 3.13
28+
uses: actions/setup-python@v4
29+
with:
30+
python-version: '3.13'
31+
32+
- name: Extract version
33+
id: version
34+
run: echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
35+
36+
- name: Install dependencies
37+
run: pip install build
38+
39+
- name: Update project version
40+
run: |
41+
sed -i 's/{{VERSION}}/${{ steps.version.outputs.VERSION }}/g' server.json
42+
43+
- name: Install MCP Publisher
44+
run: |
45+
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
46+
47+
- name: Login to MCP Registry
48+
run: ./mcp-publisher login github-oidc
49+
50+
- name: Publish to MCP Registry
51+
run: ./mcp-publisher publish
52+
53+
# - name: Create GitHub Release
54+
# uses: softprops/action-gh-release@v2
55+
# with:
56+
# files: dist/*
57+
# generate_release_notes: true
58+
# env:
59+
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,4 +131,7 @@ bin/
131131
Pipfile
132132
.DS_Store
133133

134-
VERSION
134+
VERSION
135+
.mcpregistry_github_token
136+
.mcpregistry_registry_token
137+
mcp-key.pem

README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -477,4 +477,17 @@ pytest sling/tests/test_sling_class.py -v
477477

478478
## MCP
479479

480+
To Login:
481+
482+
```
483+
mcp-publisher login dns --domain slingdata.io --private-key $(openssl pkey -in mcp-key.pem -noout -text | grep -A3 "priv:" | tail -n +2 | tr -d ' :\n')`
484+
```
485+
486+
To Publish:
487+
488+
```
489+
mcp-publisher publish
490+
```
491+
492+
480493
mcp-name: io.slingdata/sling-cli

scripts/validate-mcp.sh

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
#!/bin/bash
2+
# filepath: scripts/validate-mcp.sh
3+
set -e
4+
5+
echo "🔍 Validating MCP server configuration..."
6+
7+
# Check if Python is available
8+
if ! command -v python3 &> /dev/null && ! command -v python &> /dev/null; then
9+
echo "⚠️ Python not found. MCP server requires Python >=3.8"
10+
else
11+
echo "✅ Python found"
12+
fi
13+
14+
# Check if pip is available
15+
if ! command -v pip3 &> /dev/null && ! command -v pip &> /dev/null; then
16+
echo "⚠️ pip not found. Required for installing Sling package"
17+
else
18+
echo "✅ pip found"
19+
fi
20+
21+
# Check if ajv-cli is installed for schema validation
22+
if ! command -v ajv &> /dev/null; then
23+
echo "Installing ajv-cli for JSON schema validation..."
24+
if command -v npm &> /dev/null; then
25+
npm install -g ajv-cli
26+
else
27+
echo "⚠️ npm not found. Skipping schema validation."
28+
echo " Install Node.js and npm to validate server.json schema"
29+
exit 0
30+
fi
31+
fi
32+
33+
# Download the MCP server schema
34+
echo "📥 Downloading MCP server schema..."
35+
curl -s -o /tmp/server-schema.json https://static.modelcontextprotocol.io/schemas/2025-09-16/server.schema.json
36+
37+
# Validate the server.json file
38+
echo "✅ Validating server.json against schema..."
39+
if ajv validate -s /tmp/server-schema.json -d server.json; then
40+
echo "✅ server.json is valid!"
41+
else
42+
echo "❌ server.json validation failed!"
43+
exit 1
44+
fi
45+
46+
# Test Sling installation and MCP command
47+
echo "🧪 Testing Sling installation..."
48+
if command -v sling &> /dev/null; then
49+
echo "✅ Sling CLI found"
50+
51+
# Test MCP command
52+
echo "🧪 Testing MCP command..."
53+
if timeout 3s sling mcp --help &> /dev/null; then
54+
echo "✅ Sling MCP command works!"
55+
else
56+
echo "⚠️ Could not test 'sling mcp' command (this is normal if no help flag exists)"
57+
fi
58+
else
59+
echo "⚠️ Sling CLI not found. Testing pip installation..."
60+
61+
# Try to install sling temporarily for testing
62+
if command -v pip3 &> /dev/null; then
63+
echo "🧪 Testing pip installation of sling package..."
64+
pip3 show sling &> /dev/null && echo "✅ Sling package is already installed" || echo "ℹ️ Sling package not installed (users will install via: pip install sling)"
65+
fi
66+
fi
67+
68+
echo ""
69+
echo "🎉 Validation complete!"
70+
echo ""
71+
echo "📋 Installation instructions for users:"
72+
echo " pip install sling"
73+
echo " # Then the MCP server can be started with: sling mcp"

server.json

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-09-16/server.schema.json",
3+
"name": "io.slingdata/sling-cli",
4+
"version": "1.4.24",
5+
"description": "Sling CLI MCP server for data pipeline and replication management",
6+
"homepage": "https://github.com/slingdata-io/sling",
7+
"sourceUrl": "https://github.com/slingdata-io/sling",
8+
"license": "MIT",
9+
"licensePath": "LICENSE",
10+
"vendor": {
11+
"name": "SlingData",
12+
"url": "https://slingdata.io"
13+
},
14+
"runtime": {
15+
"name": "python",
16+
"version": ">=3.8"
17+
},
18+
"commands": {
19+
"default": {
20+
"command": "sling",
21+
"args": ["mcp"]
22+
}
23+
},
24+
"installation": {
25+
"pip": {
26+
"package": "sling"
27+
}
28+
},
29+
"packages": [
30+
{
31+
"registryType": "pypi",
32+
"identifier": "sling",
33+
"version": "1.4.23",
34+
"transport": {
35+
"type": "stdio"
36+
}
37+
}
38+
],
39+
"categories": [
40+
"data-processing",
41+
"data-wrangling",
42+
"developer-tools"
43+
],
44+
"keywords": [
45+
"data",
46+
"query",
47+
"SQL",
48+
"pipeline",
49+
"replication",
50+
"etl",
51+
"database"
52+
]
53+
}

0 commit comments

Comments
 (0)