Skip to content
Closed
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
7 changes: 7 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,12 @@ jobs:
- name: Install dependencies
run: npm ci

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

- name: Validate skills
run: npm run validate

- name: Validate server.json
run: ./mcp-publisher validate
24 changes: 24 additions & 0 deletions .github/workflows/publish-mcp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Publish to MCP Registry

on:
workflow_dispatch:

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5

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

- name: Validate server.json
run: ./mcp-publisher validate

- name: Authenticate to MCP Registry
run: ./mcp-publisher login http --domain "sanity.io" --private-key "${{ secrets.MCP_PUBLISHER_PRIVATE_KEY }}"

- name: Publish server to MCP Registry
run: ./mcp-publisher publish
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@

.DS_Store
node_modules/

# mcp-publisher
.mcpregistry_*
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"description": "AI agent resources for Sanity development",
"private": true,
"scripts": {
"bump-mcp-version": "node scripts/bump-mcp-version.mjs",
"validate": "skills-ref validate ./skills/sanity-best-practices && skills-ref validate ./skills/content-modeling-best-practices && skills-ref validate ./skills/seo-aeo-best-practices && skills-ref validate ./skills/content-experimentation-best-practices",
"validate:sanity": "skills-ref validate ./skills/sanity-best-practices",
"validate:content-modeling": "skills-ref validate ./skills/content-modeling-best-practices",
Expand Down
34 changes: 34 additions & 0 deletions scripts/bump-mcp-version.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import fs from "node:fs/promises";
import path from "node:path";

const SERVER_JSON_PATH = path.join(import.meta.dirname, "..", "server.json");

const response = await fetch("https://mcp.sanity.io", {
method: "POST",
headers: { authorization: "Bearer sk_dummy", accept: "application/json; text/event-stream", "content-type": "application/json" },
body: JSON.stringify({
jsonrpc: "2.0",
id: 1,
method: "initialize",
params: {
protocolVersion: "2025-11-25",
capabilities: {},
clientInfo: {
name: "sanity-io/agent-toolkit version checker",
version: "1.0.0",
},
},
}),
});

const body = await response.json();

const mcpServerVersion = body.result.serverInfo.version;

const serverJsonContent = await fs.readFile(SERVER_JSON_PATH, "utf-8");

const updatedJsonContent = serverJsonContent.replace(/"version": ".+",$/m, `"version": "${mcpServerVersion}",`);

await fs.writeFile(SERVER_JSON_PATH, updatedJsonContent);

console.log(`Updated server.json with MCP server version: ${mcpServerVersion}`);
17 changes: 17 additions & 0 deletions server.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
"name": "io.sanity/mcp",
"description": "Direct access to your Sanity projects (content, datasets, releases, schemas) and agent rules",
"title": "Sanity",
"repository": {
"url": "https://github.com/sanity-io/agent-toolkit",
"source": "github"
},
"version": "2.12.0",
"remotes": [
{
"type": "streamable-http",
"url": "https://mcp.sanity.io"
}
]
}