Skip to content

Commit 6fc871d

Browse files
Merge pull request #10 from Hacker0x01/upgrade-to-v0.7.3
Upgrade apollo-mcp-server to v0.7.3
2 parents fbb3bb4 + 959f938 commit 6fc871d

File tree

6 files changed

+60
-35
lines changed

6 files changed

+60
-35
lines changed

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ RUN apt-get update && apt-get install -y curl && \
77
# Set working directory
88
WORKDIR /app
99

10-
RUN curl -sSL https://mcp.apollo.dev/download/nix/v0.3.0 | sh
10+
RUN curl -sSL https://mcp.apollo.dev/download/nix/v0.7.3 | sh
1111

1212
# Copy the graphql directory containing schema and operations
1313
COPY ./graphql /app/graphql
14+
COPY ./config.yaml /config.yaml
1415

1516
# Copy the entrypoint script
1617
COPY ./entrypoint /app/entrypoint

README.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ A Docker image that provides access to HackerOne's GraphQL API through the Model
1313
docker run -i --rm \
1414
-e ENDPOINT="https://hackerone.com/graphql" \
1515
-e TOKEN="<your_base64_encoded_token>" \
16-
-e ALLOW_MUTATIONS="none" \
16+
-e MUTATION_MODE="none" \
1717
hackertwo/hackerone-graphql-mcp-server:1.0.5
1818
```
1919

@@ -26,12 +26,13 @@ A Docker image that provides access to HackerOne's GraphQL API through the Model
2626

2727
## Environment Variables
2828

29-
- `ENDPOINT`: GraphQL endpoint URL (default: https://hackerone.com/graphql)
30-
- `TOKEN`: Base64 encoded API token in format: `base64(username:api_key)`
31-
- `ALLOW_MUTATIONS`: Controls which mutations are allowed (default: none)
32-
- `none`: No mutations allowed
33-
- `explicit`: Only explicitly defined mutations allowed
34-
- `all`: All mutations allowed
29+
| Variable | Description | Default |
30+
| ---------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------- |
31+
| `ENDPOINT` | GraphQL endpoint URL | `https://hackerone.com/graphql` |
32+
| `TOKEN` | Base64 encoded API token in format: `base64(username:api_key)` | - |
33+
| `MUTATION_MODE` | Controls which mutations are allowed:<br/>• `none`: No mutations allowed<br/>• `explicit`: Only explicitly defined mutations allowed<br/>• `all`: All mutations allowed | `none` |
34+
| `DISABLE_TYPE_DESCRIPTION` | If set to `true`, tools will have no type descriptions (e.g. "The returned value has type ...") | `false` |
35+
| `DISABLE_SCHEMA_DESCRIPTION` | If set to `true`, tools will have no schema description | `false` |
3536

3637
## Generating an API Token
3738

@@ -65,7 +66,7 @@ A Docker image that provides access to HackerOne's GraphQL API through the Model
6566
"-e",
6667
"TOKEN=<your_base64_encoded_token>",
6768
"-e",
68-
"ALLOW_MUTATIONS=none",
69+
"MUTATION_MODE=none",
6970
"hackertwo/hackerone-graphql-mcp-server:1.0.5"
7071
]
7172
}
@@ -88,7 +89,7 @@ A Docker image that provides access to HackerOne's GraphQL API through the Model
8889
"-e",
8990
"TOKEN=<your_base64_encoded_token>",
9091
"-e",
91-
"ALLOW_MUTATIONS=none",
92+
"MUTATION_MODE=none",
9293
"hackertwo/hackerone-graphql-mcp-server:1.0.5"
9394
]
9495
}

config.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# https://www.apollographql.com/docs/apollo-mcp-server/command-reference
2+
endpoint: __ENDPOINT__
3+
headers:
4+
Authorization: "Bearer __TOKEN__"
5+
operations:
6+
source: local
7+
paths:
8+
- /app/graphql/operations
9+
schema:
10+
source: local
11+
path: /app/graphql/schema.graphql
12+
logging:
13+
level: error
14+
overrides:
15+
disable_type_description: __DISABLE_TYPE_DESCRIPTION__
16+
disable_schema_description: __DISABLE_SCHEMA_DESCRIPTION__
17+
enable_explorer: false
18+
mutation_mode: __MUTATION_MODE__
19+
transport:
20+
type: stdio

entrypoint

Lines changed: 24 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,36 @@
22

33
# NOTE: Log level must be as high as possible to avoid breaking the stdio MCP protocol.
44

5-
# Set default value for ALLOW_MUTATIONS if not provided
6-
ALLOW_MUTATIONS="${ALLOW_MUTATIONS:-none}"
5+
ENDPOINT="${ENDPOINT:-https://hackerone.com/graphql}"
6+
MUTATION_MODE="${ALLOW_MUTATIONS:-${MUTATION_MODE:-none}}" # backwards compatible with ALLOW_MUTATIONS
7+
DISABLE_TYPE_DESCRIPTION="${DISABLE_TYPE_DESCRIPTION:-false}"
8+
DISABLE_SCHEMA_DESCRIPTION="${DISABLE_SCHEMA_DESCRIPTION:-false}"
79

8-
# Validate ALLOW_MUTATIONS value
9-
case "$ALLOW_MUTATIONS" in
10+
# Validate that TOKEN is provided
11+
if [ -z "$TOKEN" ]; then
12+
echo "Error: TOKEN environment variable is required" >&2
13+
exit 1
14+
fi
15+
16+
# Validate MUTATION_MODE value
17+
case "$MUTATION_MODE" in
1018
"none"|"explicit"|"all")
1119
# Valid value, continue
1220
;;
1321
*)
14-
echo "Error: ALLOW_MUTATIONS must be one of: none, explicit, all. Got: $ALLOW_MUTATIONS" >&2
22+
echo "Error: MUTATION_MODE must be one of: none, explicit, all. Got: $MUTATION_MODE" >&2
1523
exit 1
1624
;;
1725
esac
1826

19-
# https://www.apollographql.com/docs/apollo-mcp-server/command-reference
20-
/app/apollo-mcp-server --directory "/app/graphql" \
21-
--schema "schema.graphql" \
22-
--operations operations/ \
23-
--log error \
24-
--endpoint "${ENDPOINT}" \
25-
--header "Authorization: Bearer ${TOKEN}" \
26-
--allow-mutations "$ALLOW_MUTATIONS" \
27-
"$@"
27+
# Create a temporary config file with the dynamic endpoint and authorization header
28+
CONFIG_FILE="/tmp/config.yaml"
29+
sed -e "s|__ENDPOINT__|${ENDPOINT}|g" \
30+
-e "s|__TOKEN__|${TOKEN}|g" \
31+
-e "s|__MUTATION_MODE__|${MUTATION_MODE}|g" \
32+
-e "s|__DISABLE_TYPE_DESCRIPTION__|${DISABLE_TYPE_DESCRIPTION}|g" \
33+
-e "s|__DISABLE_SCHEMA_DESCRIPTION__|${DISABLE_SCHEMA_DESCRIPTION}|g" \
34+
/config.yaml > "$CONFIG_FILE"
35+
36+
# Launch the apollo-mcp-server with the dynamically generated config
37+
/app/apollo-mcp-server "$CONFIG_FILE"

graphql/operations/GetHackerOneCurrentUser.graphql

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,4 @@
1-
query GetHackerOneCurrentUser($extra: Boolean = true) {
2-
# This extra field is a hack to force inputs, a workaround for https://github.com/apollographql/apollo-mcp-server/issues/136
3-
_unused: __typename @skip(if: $extra)
4-
1+
query GetHackerOneCurrentUser {
52
me {
63
id
74
databaseId: _id

graphql/schema.graphql

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21543,12 +21543,6 @@ enum HaiTaskAgentEnum {
2154321543
A Flowise-powered agent specialized for content summarization, analysis, and information extraction
2154421544
"""
2154521545
FLOWISE_SAMPLE
21546-
21547-
"""
21548-
A Bedrock agent specialized for calculations, system operations, and data
21549-
processing with human oversight for sensitive operations
21550-
"""
21551-
INSIGHT_AGENT
2155221546
}
2155321547

2155421548
type HaiTaskArtifact implements Node {
@@ -22198,7 +22192,8 @@ An intake recommendation on a report
2219822192
type IntakeRecommendation implements Node {
2219922193
confidence: Int
2220022194
id: ID!
22201-
message: String
22195+
message_for_customer: String
22196+
message_for_reporter: String
2220222197
recommended_action: String
2220322198
steps: Hash
2220422199
}
@@ -31635,6 +31630,7 @@ type PentestChecklistEdge {
3163531630
}
3163631631

3163731632
type PentestChecklistTemplate implements Node {
31633+
aasm_state: String!
3163831634
archived_at: DateTime
3163931635
description: String
3164031636
global: Boolean!

0 commit comments

Comments
 (0)