Skip to content

Commit e821580

Browse files
authored
Implement automated apollo-mcp-server schema sync (#92)
* feat: add automated schema sync workflow * feat: upgrade to official apollo-mcp-server schema v1.3.0 * feat: allow vscode directory to be committed to the repo * feat: Ensure validation workflow does not error due to ajv * feat: refine github mcp server workflow check
1 parent 00bfb30 commit e821580

File tree

12 files changed

+1456
-106
lines changed

12 files changed

+1456
-106
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
* @apollographql/team-growth
2+
add-mcp/.vscode/schemas/* @gocamille @apollographql/team-growth
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Sync Apollo MCP Server Schema
2+
3+
on:
4+
# Run on a schedule (daily check)
5+
schedule:
6+
- cron: "0 0 * * *" # Daily at midnight UTC
7+
8+
# Allow manual trigger
9+
workflow_dispatch:
10+
11+
jobs:
12+
sync-schema:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: write
16+
pull-requests: write
17+
18+
steps:
19+
- name: Checkout repository
20+
uses: actions/checkout@v4
21+
22+
- name: Get latest Apollo MCP Server release
23+
id: get-release
24+
run: |
25+
LATEST=$(curl -s https://api.github.com/repos/apollographql/apollo-mcp-server/releases/latest | jq -r '.tag_name')
26+
echo "version=$LATEST" >> $GITHUB_OUTPUT
27+
echo "Latest version: $LATEST"
28+
29+
- name: Get current schema version
30+
id: current-version
31+
run: |
32+
if [ -f "add-mcp/.vscode/schemas/VERSION" ]; then
33+
CURRENT=$(cat add-mcp/.vscode/schemas/VERSION)
34+
else
35+
CURRENT="none"
36+
fi
37+
echo "version=$CURRENT" >> $GITHUB_OUTPUT
38+
echo "Current version: $CURRENT"
39+
40+
- name: Check if update needed
41+
id: check-update
42+
run: |
43+
if [ "${{ steps.get-release.outputs.version }}" != "${{ steps.current-version.outputs.version }}" ]; then
44+
echo "needs_update=true" >> $GITHUB_OUTPUT
45+
echo "Update needed: ${{ steps.current-version.outputs.version }} -> ${{ steps.get-release.outputs.version }}"
46+
else
47+
echo "needs_update=false" >> $GITHUB_OUTPUT
48+
echo "Schema is up to date"
49+
fi
50+
51+
- name: Download new schema
52+
if: steps.check-update.outputs.needs_update == 'true'
53+
run: |
54+
VERSION="${{ steps.get-release.outputs.version }}"
55+
curl -L -o add-mcp/.vscode/schemas/mcp-server.schema.json \
56+
"https://github.com/apollographql/apollo-mcp-server/releases/download/${VERSION}/config.schema.json"
57+
echo "$VERSION" > add-mcp/.vscode/schemas/VERSION
58+
59+
- name: Create Pull Request
60+
if: steps.check-update.outputs.needs_update == 'true'
61+
uses: peter-evans/create-pull-request@98357b18bf14b5342f975ff684046ec3b2a07725 # v8.0.0
62+
with:
63+
token: ${{ secrets.GITHUB_TOKEN }}
64+
commit-message: "chore: update MCP server schema to ${{ steps.get-release.outputs.version }}"
65+
title: "Update MCP Server Schema to ${{ steps.get-release.outputs.version }}"
66+
body: |
67+
## Automated Schema Update
68+
69+
This PR updates the Apollo MCP Server configuration schema from `${{ steps.current-version.outputs.version }}` to `${{ steps.get-release.outputs.version }}`.
70+
71+
**Release Notes:** https://github.com/apollographql/apollo-mcp-server/releases/tag/${{ steps.get-release.outputs.version }}
72+
73+
### Changes
74+
- Updated `add-mcp/.vscode/schemas/mcp-server.schema.json` to official Apollo schema
75+
- Updated `add-mcp/.vscode/schemas/VERSION` to track current version
76+
77+
### Testing
78+
- [ ] Verify schema validation works in VS Code
79+
- [ ] Check no false positives on existing template YAML files
80+
branch: update-mcp-schema-${{ steps.get-release.outputs.version }}
81+
labels: dependencies, automated
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Validate Template Files
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- 'add-mcp/**/*.yaml'
7+
- 'add-mcp/**/*.yml'
8+
- 'add-mcp/.vscode/schemas/**'
9+
10+
jobs:
11+
validate-yaml:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: '20'
20+
21+
- name: Install validation tools
22+
run: npm install -g ajv-cli ajv-formats js-yaml
23+
24+
- name: Download latest schema
25+
run: |
26+
curl -L -o /tmp/mcp-schema.json \
27+
"https://github.com/apollographql/apollo-mcp-server/releases/download/$(curl -s https://api.github.com/repos/apollographql/apollo-mcp-server/releases/latest | jq -r '.tag_name')/config.schema.json"
28+
29+
- name: Validate MCP YAML files
30+
run: |
31+
echo "Validating MCP configuration YAML files..."
32+
33+
# Find all MCP config files
34+
for file in add-mcp/.apollo/mcp.*.yaml; do
35+
if [ -f "$file" ]; then
36+
echo "Validating $file..."
37+
js-yaml "$file" > /tmp/config.json
38+
ajv validate -s /tmp/mcp-schema.json --spec=draft2020 --strict=false -d /tmp/config.json || exit 1
39+
echo "✓ $file is valid"
40+
fi
41+
done
42+
43+
echo "All MCP configuration files validated successfully!"

add-mcp/.apollo/mcp.local.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
# Working local configuration:
55
overrides:
66
mutation_mode: all
7-
require_confirmation: true # Confirmation required for mutations
87
operations:
98
source: collection
109
id: default # localhost:4000 in browser → Sandbox → Collections → Create operations for MCP tools

add-mcp/.apollo/mcp.staging.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
# Working staging configuration:
55
overrides:
66
mutation_mode: all
7-
require_confirmation: true # Confirmation required for mutations
87
operations:
98
source: collection
109
id: default # GraphQL endpoint in browser → Sandbox → Collections → Create operations for MCP tools

add-mcp/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ node_modules/
2020
.docker/
2121

2222
# IDE files
23-
.vscode/
2423
.idea/
2524

2625
# Temporary files
Lines changed: 212 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,212 @@
1+
{
2+
// Apollo MCP Server Configuration Snippets
3+
// Based on official Apollo MCP Server documentation
4+
//
5+
// These snippets provide complete configuration templates for common
6+
// Apollo MCP Server setups. Use prefixes like 'mcp', 'mcphttp', 'mcpfull'.
7+
8+
"MCP Basic Config": {
9+
"scope": "yaml",
10+
"prefix": ["mcp", "mcpbasic"],
11+
"body": [
12+
"# Apollo MCP Server Configuration",
13+
"endpoint: ${1:http://localhost:4000/}",
14+
"transport:",
15+
" type: ${2|stdio,streamable_http,sse|}",
16+
"$0"
17+
],
18+
"description": "Basic Apollo MCP Server configuration"
19+
},
20+
21+
"MCP with GraphOS": {
22+
"scope": "yaml",
23+
"prefix": ["mcpgraphos", "mcpstudio"],
24+
"body": [
25+
"# Apollo MCP Server with GraphOS",
26+
"endpoint: ${1:http://localhost:4000/}",
27+
"graphos:",
28+
" apollo_key: \\${${2:APOLLO_KEY}}",
29+
" apollo_graph_ref: \\${${3:APOLLO_GRAPH_REF}}",
30+
"transport:",
31+
" type: ${4|stdio,streamable_http,sse|}",
32+
"$0"
33+
],
34+
"description": "MCP Server with Apollo GraphOS configuration"
35+
},
36+
37+
"MCP HTTP with Auth": {
38+
"scope": "yaml",
39+
"prefix": ["mcphttp", "mcpauth"],
40+
"body": [
41+
"# Apollo MCP Server with HTTP transport and authentication",
42+
"endpoint: ${1:https://api.example.com/graphql}",
43+
"transport:",
44+
" type: streamable_http",
45+
" address: ${2:127.0.0.1}",
46+
" port: ${3:5000}",
47+
" auth:",
48+
" servers:",
49+
" - ${4:https://auth.example.com}",
50+
" audiences:",
51+
" - ${5:api.example.com}",
52+
" resource: ${6:https://mcp.example.com}",
53+
" scopes:",
54+
" - ${7:read:data}",
55+
" - ${8:write:data}",
56+
"$0"
57+
],
58+
"description": "HTTP transport with OAuth 2.0 authentication"
59+
},
60+
61+
"MCP Headers": {
62+
"scope": "yaml",
63+
"prefix": ["mcpheaders", "headers"],
64+
"body": [
65+
"headers:",
66+
" Authorization: Bearer \\${${1:GRAPHQL_TOKEN}}",
67+
" X-API-Key: \\${${2:API_KEY}}",
68+
"$0"
69+
],
70+
"description": "Add headers for GraphQL requests"
71+
},
72+
73+
"MCP CORS Config": {
74+
"scope": "yaml",
75+
"prefix": ["mcpcors", "cors"],
76+
"body": [
77+
"cors:",
78+
" origin:",
79+
" - ${1:http://localhost:3000}",
80+
" - ${2:https://app.example.com}",
81+
" credentials: ${3:true}",
82+
"$0"
83+
],
84+
"description": "CORS configuration for HTTP transport"
85+
},
86+
87+
"MCP Complete Config": {
88+
"scope": "yaml",
89+
"prefix": ["mcpfull", "mcpcomplete"],
90+
"body": [
91+
"# Apollo MCP Server Full Configuration",
92+
"endpoint: ${1:https://api.example.com/graphql}",
93+
"",
94+
"# GraphOS Integration",
95+
"graphos:",
96+
" apollo_key: \\${${2:APOLLO_KEY}}",
97+
" apollo_graph_ref: \\${${3:APOLLO_GRAPH_REF}}",
98+
"",
99+
"# Transport Settings",
100+
"transport:",
101+
" type: ${4|streamable_http,sse,stdio|}",
102+
" address: ${5:127.0.0.1}",
103+
" port: ${6:5000}",
104+
" auth:",
105+
" servers:",
106+
" - ${7:https://auth.example.com}",
107+
" audiences:",
108+
" - ${8:api.example.com}",
109+
" scopes:",
110+
" - ${9:read:data}",
111+
" - ${10:write:data}",
112+
"",
113+
"# CORS Configuration",
114+
"cors:",
115+
" origin:",
116+
" - ${11:http://localhost:3000}",
117+
" credentials: ${12:true}",
118+
"",
119+
"# Request Headers",
120+
"headers:",
121+
" Authorization: Bearer \\${${13:GRAPHQL_TOKEN}}",
122+
"",
123+
"# Schema & Operations",
124+
"schema:",
125+
" source: ${14|introspection,file,studio|}",
126+
"operations:",
127+
" source: ${15|introspection,manifest,studio|}",
128+
"",
129+
"# Server Overrides",
130+
"overrides:",
131+
" mutation_mode: ${16|safe,all,none|}",
132+
"",
133+
"# Introspection",
134+
"introspection:",
135+
" enabled: ${17:true}",
136+
" cache_ttl: ${18:300}",
137+
"",
138+
"# Health Check",
139+
"health_check:",
140+
" enabled: ${19:true}",
141+
" path: ${20:/health}",
142+
"",
143+
"# Logging",
144+
"logging:",
145+
" level: ${21|info,debug,warn,error,trace|}",
146+
" format: ${22|text,json|}",
147+
"",
148+
"# Telemetry",
149+
"telemetry:",
150+
" service_name: ${23:mcp-server}",
151+
" version: ${24:1.0.0}",
152+
"$0"
153+
],
154+
"description": "Complete Apollo MCP Server configuration with all features"
155+
},
156+
157+
"MCP Docker Run": {
158+
"scope": "yaml,dockerfile,sh",
159+
"prefix": ["mcpdocker"],
160+
"body": [
161+
"docker run \\\\",
162+
" -it --rm \\\\",
163+
" -p ${1:5000}:${1:5000} \\\\",
164+
" -v \\${PWD}/${2:config.yaml}:/config.yaml \\\\",
165+
" -v \\${PWD}:/data \\\\",
166+
" ghcr.io/apollographql/apollo-mcp-server:latest /config.yaml",
167+
"$0"
168+
],
169+
"description": "Docker run command for Apollo MCP Server"
170+
},
171+
172+
"MCP Telemetry": {
173+
"scope": "yaml",
174+
"prefix": ["mcptelemetry", "telemetry"],
175+
"body": [
176+
"telemetry:",
177+
" service_name: ${1:apollo-mcp-server}",
178+
" version: ${2:1.0.0}",
179+
" exporters:",
180+
" metrics:",
181+
" ${3:# Metrics export config}",
182+
" tracing:",
183+
" ${4:# Trace export config}",
184+
"$0"
185+
],
186+
"description": "Telemetry configuration for monitoring"
187+
},
188+
189+
"MCP Schema Source": {
190+
"scope": "yaml",
191+
"prefix": ["mcpschema", "schema"],
192+
"body": [
193+
"schema:",
194+
" source: ${1|introspection,file,studio|}",
195+
" ${2:file: ./schema.graphql}",
196+
"$0"
197+
],
198+
"description": "Schema source configuration"
199+
},
200+
201+
"MCP Operations Source": {
202+
"scope": "yaml",
203+
"prefix": ["mcpops", "operations"],
204+
"body": [
205+
"operations:",
206+
" source: ${1|introspection,manifest,studio|}",
207+
" ${2:manifest: ./manifest.json}",
208+
"$0"
209+
],
210+
"description": "Operations source configuration"
211+
}
212+
}

0 commit comments

Comments
 (0)