-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathentrypoint
More file actions
executable file
·37 lines (31 loc) · 1.26 KB
/
entrypoint
File metadata and controls
executable file
·37 lines (31 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
# NOTE: Log level must be as high as possible to avoid breaking the stdio MCP protocol.
ENDPOINT="${ENDPOINT:-https://hackerone.com/graphql}"
MUTATION_MODE="${ALLOW_MUTATIONS:-${MUTATION_MODE:-none}}" # backwards compatible with ALLOW_MUTATIONS
DISABLE_TYPE_DESCRIPTION="${DISABLE_TYPE_DESCRIPTION:-false}"
DISABLE_SCHEMA_DESCRIPTION="${DISABLE_SCHEMA_DESCRIPTION:-false}"
# Validate that TOKEN is provided
if [ -z "$TOKEN" ]; then
echo "Error: TOKEN environment variable is required" >&2
exit 1
fi
# Validate MUTATION_MODE value
case "$MUTATION_MODE" in
"none"|"explicit"|"all")
# Valid value, continue
;;
*)
echo "Error: MUTATION_MODE must be one of: none, explicit, all. Got: $MUTATION_MODE" >&2
exit 1
;;
esac
# Create a temporary config file with the dynamic endpoint and authorization header
CONFIG_FILE="/tmp/config.yaml"
sed -e "s|__ENDPOINT__|${ENDPOINT}|g" \
-e "s|__TOKEN__|${TOKEN}|g" \
-e "s|__MUTATION_MODE__|${MUTATION_MODE}|g" \
-e "s|__DISABLE_TYPE_DESCRIPTION__|${DISABLE_TYPE_DESCRIPTION}|g" \
-e "s|__DISABLE_SCHEMA_DESCRIPTION__|${DISABLE_SCHEMA_DESCRIPTION}|g" \
/config.yaml > "$CONFIG_FILE"
# Launch the apollo-mcp-server with the dynamically generated config
/app/apollo-mcp-server "$CONFIG_FILE"