Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
9365d62
feat: Implement Test Coverage Measurement and Reporting
DaleSeo Sep 8, 2025
71f8153
chore: add changeset
DaleSeo Sep 8, 2025
0907f07
feat: remove unnecessary codecov setting
DaleSeo Sep 8, 2025
aee6522
chore: add changeset
DaleSeo Sep 9, 2025
8426e82
feat: Configuration for disabling authorization token passthrough (#336)
swcollard Sep 9, 2025
f9fbb35
chore: update RMCP version to latest (#328)
nicholascioli Sep 11, 2025
b6464f9
test: add tests for mcp server event
DaleSeo Sep 9, 2025
1d3363f
test: add tests for SupergraphSdlQuery
DaleSeo Sep 10, 2025
946a7c3
chore: add changeset
DaleSeo Sep 11, 2025
fcb0f34
update HEAD option to be the release branch and not where the workflo…
esilverm Sep 12, 2025
be7b5e8
fix: Disable statefulness to attempt to fix initialize race condition…
swcollard Sep 12, 2025
d3681e3
Update SDL handling in sdl_to_api_schema function
lennyburdette Sep 16, 2025
301774e
Sync main → develop (PR #355) (#363)
apollo-bot2 Sep 17, 2025
a678c85
Sync main → develop (PR #353) (#361)
apollo-bot2 Sep 17, 2025
00ce281
docs: updating define operation collections section with note on vari…
alocay Sep 12, 2025
8f51dd5
edit for simplicity, lead with the intent
mabuyo Sep 15, 2025
77dedb3
edit operation collections section for style consistency and clarity
mabuyo Sep 15, 2025
359efbd
librarian edits
mabuyo Sep 15, 2025
c18795e
test: updating e2e test script to specify a specific version for test…
alocay Sep 19, 2025
bbb9cd2
chore: adding changeset
alocay Sep 19, 2025
2d3943f
re-run checks
alocay Sep 19, 2025
8ac2f28
feat: improve search tool description
DaleSeo Sep 11, 2025
45fdea2
feat: improve introspect tool description
DaleSeo Sep 11, 2025
7097712
test: add tests to verify updated tool descriptions
DaleSeo Sep 11, 2025
edd442c
chore: add changeset
DaleSeo Sep 11, 2025
51837d0
chore: rename test methods
DaleSeo Sep 15, 2025
0155c34
add minify support for directives and specify deprecated
esilverm Sep 12, 2025
088062c
update tool descriptions to support Deprecated directive understandin…
esilverm Sep 12, 2025
5c08084
normalize reason text
esilverm Sep 17, 2025
62344c4
add snapshot tests for minification
esilverm Sep 17, 2025
0c7d828
add changeset
esilverm Sep 17, 2025
ef69a8c
update existing snapshots
esilverm Sep 17, 2025
56abe71
move reason handling to if let so it is clear that we only handle the…
esilverm Sep 18, 2025
a33499e
update tests to show support for deprecation with no provided reason
esilverm Sep 18, 2025
58854db
update docs
esilverm Sep 18, 2025
3e69db4
feat: add CORS support
DaleSeo Sep 15, 2025
bfb7d5b
docs: update config file reference
DaleSeo Sep 18, 2025
87579bc
chore: add changeset
DaleSeo Sep 18, 2025
d3f72cd
test: add integartion tests for cors
DaleSeo Sep 19, 2025
5d6921d
docs: add cors docs page
DaleSeo Sep 22, 2025
3ca42fc
feat: include W3C trace context headers
DaleSeo Sep 23, 2025
0ccc251
feat: include DELETE method for CORS
DaleSeo Sep 23, 2025
d41c5cd
docs: remove studio domain from example config
DaleSeo Sep 23, 2025
f2c95bf
feat: add the MDN link for CORS with credentials
DaleSeo Sep 23, 2025
48fcdfa
Prototype OpenTelemetry Traces in MCP Server (#274)
swcollard Aug 25, 2025
c1cfddf
Implement metrics for mcp tool and operation counts and durations (#297)
swcollard Aug 28, 2025
b2759b7
fix: Include the cargo feature and TraceContextPropagator to send ote…
swcollard Aug 28, 2025
fcdab35
Add basic config file options to otel telemetry (#330)
swcollard Sep 8, 2025
8f1be84
feat: adding ability to omit attributes for traces and metrics (#358)
alocay Sep 16, 2025
0ee2224
feat: adding config option for trace sampling (#370)
alocay Sep 17, 2025
8681f20
chore: exclude test-only code from coverage analysis
DaleSeo Sep 18, 2025
28f36d8
Trace operation parsing and tool generation
swcollard Sep 18, 2025
4c699f9
Trace Auth with status_code and reason
swcollard Sep 22, 2025
d759c39
Draft documentation and user guide for mcp otel telemetry
swcollard Sep 8, 2025
97142d6
Add more unit test coverage
swcollard Sep 23, 2025
a39eb0e
chore: bumping to version 0.9.0
DaleSeo Sep 24, 2025
61574d1
Update operation tracing and client initialization attributes
swcollard Sep 26, 2025
d97a56f
Also add client version to metric
swcollard Sep 29, 2025
23ebbd2
Merge pull request #391 from apollographql/fix/telemetry-attributes-2
swcollard Sep 29, 2025
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
2 changes: 1 addition & 1 deletion .github/workflows/prep-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ jobs:

- name: Open/Update draft PR to main
env:
HEAD: ${{ github.ref_name }}
HEAD: release/${{ steps.bump.outputs.new_version }}
TITLE: Releasing ${{ steps.bump.outputs.new_version }}
shell: bash
run: |
Expand Down
157 changes: 84 additions & 73 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -1,75 +1,86 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Run apollo-mcp-server [Weather][Streamable HTTP]",
"runtimeExecutable": "cargo",
"runtimeArgs": [
"run",
"--bin",
"apollo-mcp-server",
"--",
"graphql/weather/config.yaml",
],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"env": {
"RUST_BACKTRACE": "1"
}
},
{
"type": "lldb",
"request": "launch",
"name": "Debug apollo-mcp-server [Weather][Streamable HTTP]",
"cargo": {
"args": [
"build",
"--bin=apollo-mcp-server",
"--lib"
],
"filter": {
"name": "apollo-mcp-server",
"kind": "bin"
}
},
"args": [
"graphql/weather/config.yaml",
],
"cwd": "${workspaceFolder}",
"env": {
"RUST_BACKTRACE": "1"
}
},
{
"type": "node",
"request": "launch",
"name": "Run apollo-mcp-server [TheSpaceDevs][Streamable HTTP]",
"runtimeExecutable": "cargo",
"runtimeArgs": [
"run",
"--bin",
"apollo-mcp-server",
"--",
"graphql/TheSpaceDevs/config.yaml",
],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"env": {
"RUST_BACKTRACE": "1"
}
},
{
"type": "node",
"request": "launch",
"name": "Run mcp-inspector",
"runtimeExecutable": "npx",
"runtimeArgs": [
"@modelcontextprotocol/inspector"
],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal"
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Run apollo-mcp-server [Weather][Streamable HTTP]",
"runtimeExecutable": "cargo",
"runtimeArgs": [
"run",
"--bin",
"apollo-mcp-server",
"--",
"graphql/weather/config.yaml"
],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"env": {
"RUST_BACKTRACE": "1"
}
},
{
"type": "lldb",
"request": "launch",
"name": "Debug apollo-mcp-server [Weather][Streamable HTTP]",
"cargo": {
"args": ["build", "--bin=apollo-mcp-server", "--lib"],
"filter": {
"name": "apollo-mcp-server",
"kind": "bin"
}
]
}
},
"args": ["graphql/weather/config.yaml"],
"cwd": "${workspaceFolder}",
"env": {
"RUST_BACKTRACE": "1",
"APOLLO_MCP_LOGGING__LEVEL": "debug"
}
},
{
"type": "node",
"request": "launch",
"name": "Run apollo-mcp-server [TheSpaceDevs][Streamable HTTP]",
"runtimeExecutable": "cargo",
"runtimeArgs": [
"run",
"--bin",
"apollo-mcp-server",
"--",
"graphql/TheSpaceDevs/config.yaml"
],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal",
"env": {
"RUST_BACKTRACE": "1"
}
},
{
"type": "lldb",
"request": "launch",
"name": "Debug apollo-mcp-server [TheSpaceDevs][Streamable HTTP]",
"cargo": {
"args": ["build", "--bin=apollo-mcp-server", "--lib"],
"filter": {
"name": "apollo-mcp-server",
"kind": "bin"
}
},
"args": ["graphql/TheSpaceDevs/config.yaml"],
"cwd": "${workspaceFolder}",
"env": {
"RUST_BACKTRACE": "1",
"APOLLO_MCP_LOGGING__LEVEL": "debug"
}
},
{
"type": "node",
"request": "launch",
"name": "Run mcp-inspector",
"runtimeExecutable": "npx",
"runtimeArgs": ["@modelcontextprotocol/inspector"],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal"
}
]
}
186 changes: 184 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,188 @@ All notable changes to this project will be documented in this file.

This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

# [0.9.0] - 2025-09-24

## 🚀 Features

### Prototype OpenTelemetry Traces in MCP Server - @swcollard PR #274

Pulls in new crates and SDKs for prototyping instrumenting the Apollo MCP Server with Open Telemetry Traces.

- Adds new rust crates to support OTel
- Annotates excecute and call_tool functions with trace macro
- Adds Axum and Tower middleware's for OTel tracing
- Refactors Logging so that all the tracing_subscribers are set together in a single module.

### Add CORS support - @DaleSeo PR #362

This PR implements comprehensive CORS support for Apollo MCP Server to enable web-based MCP clients to connect without CORS errors. The implementation and configuration draw heavily from the Router's approach. Similar to other features like health checks and telemetry, CORS is supported only for the StreamableHttp transport, making it a top-level configuration.

### Enhance tool descriptions - @DaleSeo PR #350

This PR enhances the descriptions of the introspect and search tools to offer clearer guidance for AI models on efficient GraphQL schema exploration patterns.

### Telemetry: Trace operations and auth - @swcollard PR #375

- Adds traces for the MCP server generating Tools from Operations and performing authorization
- Includes the HTTP status code to the top level HTTP trace

### Implement metrics for mcp tool and operation counts and durations - @swcollard PR #297

This PR adds metrics to count and measure request duration to events throughout the MCP server

- apollo.mcp.operation.duration
- apollo.mcp.operation.count
- apollo.mcp.tool.duration
- apollo.mcp.tool.count
- apollo.mcp.initialize.count
- apollo.mcp.list_tools.count
- apollo.mcp.get_info.count

### Adding ability to omit attributes for traces and metrics - @alocay PR #358

Adding ability to configure which attributes are omitted from telemetry traces and metrics.

1. Using a Rust build script (`build.rs`) to auto-generate telemetry attribute code based on the data found in `telemetry.toml`.
2. Utilizing an enum for attributes so typos in the config file raise an error.
3. Omitting trace attributes by filtering it out in a custom exporter.
4. Omitting metric attributes by indicating which attributes are allowed via a view.
5. Created `telemetry_attributes.rs` to map `TelemetryAttribute` enum to a OTEL `Key`.

The `telemetry.toml` file includes attributes (both for metrics and traces) as well as list of metrics gathered. An example would look like the following:

```
[attributes.apollo.mcp]
my_attribute = "Some attribute info"

[metrics.apollo.mcp]
some.count = "Some metric count info"
```

This would generate a file that looks like the following:

```
/// All TelemetryAttribute values
pub const ALL_ATTRS: &[TelemetryAttribute; 1usize] = &[
TelemetryAttribute::MyAttribute
];
#[derive(Debug, ::serde::Deserialize, ::schemars::JsonSchema,, Clone, Eq, PartialEq, Hash, Copy)]
pub enum TelemetryAttribute {
///Some attribute info
#[serde(alias = "my_attribute")]
MyAttribute,
}
impl TelemetryAttribute {
/// Supported telemetry attribute (tags) values
pub const fn as_str(&self) -> &'static str {
match self {
TelemetryAttribute::MyAttribute => "apollo.mcp.my_attribute",
}
}
}
#[derive(Debug, ::serde::Deserialize, ::schemars::JsonSchema,, Clone, Eq, PartialEq, Hash, Copy)]
pub enum TelemetryMetric {
///Some metric count info
#[serde(alias = "some.count")]
SomeCount,
}
impl TelemetryMetric {
/// Converts TelemetryMetric to &str
pub const fn as_str(&self) -> &'static str {
match self {
TelemetryMetric::SomeCount => "apollo.mcp.some.count",
}
}
}
```

An example configuration that omits `tool_name` attribute for metrics and `request_id` for tracing would look like the following:

```
telemetry:
exporters:
metrics:
otlp:
endpoint: "http://localhost:4317"
protocol: "grpc"
omitted_attributes:
- tool_name
tracing:
otlp:
endpoint: "http://localhost:4317"
protocol: "grpc"
omitted_attributes:
- request_id
```

### Configuration for disabling authorization token passthrough - @swcollard PR #336

A new optional new MCP Server configuration parameter, `transport.auth.disable_auth_token_passthrough`, which is `false` by default, that when true, will no longer pass through validated Auth tokens to the GraphQL API.

### Adding config option for trace sampling - @alocay PR #366

Adding configuration option to sample traces. Can use the following options:

1. Ratio based samples (ratio >= 1 is always sample)
2. Always on
3. Always off

Defaults to always on if not provided.

## 🐛 Fixes

### Update SDL handling in sdl_to_api_schema function - @lennyburdette PR #365

Loads supergraph schemas using a function that supports various features, including Apollo Connectors. When supergraph loading failed, it would load it as a standard GraphQL schema, which reveals Federation query planning directives in when using the `search` and `introspection` tools.

### Include the cargo feature and TraceContextPropagator to send otel headers downstream - @swcollard PR #307

Inside the reqwest middleware, if the global text_map_propagator is not set, it will no op and not send the traceparent and tracestate headers to the Router. Adding this is needed to correlate traces from the mcp server to the router or other downstream APIs

### Add support for deprecated directive - @esilverm PR #367

Includes any existing `@deprecated` directives in the schema in the minified output of builtin tools. Now operations generated via these tools should take into account deprecated fields when being generated.

## 📃 Configuration

### Add basic config file options to otel telemetry - @swcollard PR #330

Adds new Configuration options for setting up configuration beyond the standard OTEL environment variables needed before.

- Renames trace->telemetry
- Adds OTLP options for metrics and tracing to choose grpc or http upload protocols and setting the endpoints
- This configuration is all optional, so by default nothing will be logged

### Disable statefulness to fix initialize race condition - @swcollard PR #351

We've been seeing errors with state and session handling in the MCP Server. Whether that is requests being sent before the initialized notification is processed. Or running a fleet of MCP Server pods behind a round robin load balancer. A new configuration option under the streamable_http transport `stateful_mode`, allows disabling session handling which appears to fix the race condition issue.

## 🛠 Maintenance

### Update RMCP dependency - @nicholascioli PR #328

Update the RMCP dependency to the latest version, pulling in newer specification changes.

### Pin stable rust version - @nicholascioli PR #287

Pins the stable version of Rust to the current latest version to ensure backwards compatibility with future versions.

### Add tests for server event and SupergraphSdlQuery - @DaleSeo PR #347

This PR adds tests for some uncovered parts of the codebase to check the Codecov integration.

### Configure Codecov with coverage targets - @DaleSeo PR #337

This PR adds `codecov.yml` to set up Codecov with specific coverage targets and quality standards. It helps define clear expectations for code quality. It also includes some documentation about code coverage in `CONTRIBUTING.md` and adds the Codecov badge to `README.md`.

### Implement Test Coverage Measurement and Reporting - @DaleSeo PR #335

This PR adds the bare minimum for code coverage reporting using [cargo-llvm-cov](https://crates.io/crates/cargo-llvm-cov) and integrates with [Codecov](https://www.codecov.io/). It adds a new `coverage` job to the CI workflow that generates and uploads coverage reporting in parallel with existing tests. The setup mirrors that of Router, except it uses `nextest` instead of the built-in test runner and CircleCI instead of GitHub Actions.

### Fix version on mcp server tester - @alocay PR #374

Add a specific version when calling the mcp-server-tester for e2e tests. The current latest (1.4.1) as an issue so to avoid problems now and in the future updating the test script to invoke the testing tool via specific version.

# [0.8.0] - 2025-09-12

## 🚀 Features
Expand All @@ -30,8 +212,6 @@ Update the RMCP dependency to the latest version, pulling in newer specification

Pins the stable version of Rust to the current latest version to ensure backwards compatibility with future versions.



# [0.7.5] - 2025-09-03

## 🐛 Fixes
Expand All @@ -51,6 +231,7 @@ This change also updates the input schema to the execute tool to make it more cl
Adding some basic e2e tests using [mcp-server-tester](https://github.com/steviec/mcp-server-tester). Currently, the tool does not always exit (ctrl+c is sometimes needed) so this should be run manually.

### How to run tests?

Added a script `run_tests.sh` (may need to run `chmod +x` to run it) to run tests. Basic usage found via `./run_tests.sh -h`. The script does the following:

1. Builds test/config yaml paths and verifies the files exist.
Expand All @@ -60,6 +241,7 @@ Added a script `run_tests.sh` (may need to run `chmod +x` to run it) to run test
5. On script exit the generated config is cleaned up.

### Example run:

To run the tests for `local-operations` simply run `./run_tests.sh local-operations`

### Update snapshot format - @DaleSeo PR #313
Expand Down
1 change: 0 additions & 1 deletion CHANGELOG_SECTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,3 @@ Update the RMCP dependency to the latest version, pulling in newer specification
### ci: Pin stable rust version ([Issue #287](https://github.com/apollographql/apollo-mcp-server/issues/287))

Pins the stable version of Rust to the current latest version to ensure backwards compatibility with future versions.

Loading