Skip to content

Commit 498f231

Browse files
Allow server "description" to be configured (#650)
1 parent 3ec6779 commit 498f231

File tree

5 files changed

+42
-3
lines changed

5 files changed

+42
-3
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
default: minor
3+
---
4+
5+
# Allow server "description" to be configured
6+
7+
Example:
8+
9+
```yaml title="config.yaml"
10+
server_info:
11+
name: "Acme Corp GraphQL Server"
12+
version: "2.0.0"
13+
title: "Acme MCP Server"
14+
website_url: "https://acme.com/mcp-docs"
15+
description: "MCP server for Acme Corp's GraphQL API"
16+
```

crates/apollo-mcp-server/src/runtime.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ mod test {
198198
version: None,
199199
title: None,
200200
website_url: None,
201+
description: None,
201202
},
202203
custom_scalars: None,
203204
endpoint: Endpoint(

crates/apollo-mcp-server/src/server/states/running.rs

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -538,8 +538,7 @@ impl ServerHandler for Running {
538538
title: self.server_info.title().map(|s| s.to_string()),
539539
version: self.server_info.version().to_string(),
540540
website_url: self.server_info.website_url().map(|s| s.to_string()),
541-
// TODO: Add support for this via configuration similar to above fields
542-
description: None,
541+
description: self.server_info.description().map(|s| s.to_string()),
543542
},
544543
capabilities,
545544
..Default::default()
@@ -1429,6 +1428,13 @@ mod tests {
14291428
info.server_info.website_url,
14301429
Some("https://www.apollographql.com/docs/apollo-mcp-server".to_string())
14311430
);
1431+
assert_eq!(
1432+
info.server_info.description,
1433+
Some(
1434+
"A Model Context Protocol (MCP) server for exposing GraphQL APIs as tools."
1435+
.to_string()
1436+
)
1437+
);
14321438
assert_eq!(info.server_info.icons, None);
14331439
}
14341440

@@ -1444,6 +1450,7 @@ mod tests {
14441450
version: Some("3.0.0-beta".to_string()),
14451451
title: Some("Custom GraphQL Server".to_string()),
14461452
website_url: Some("https://my-server.example.com/docs".to_string()),
1453+
description: Some("A custom MCP server for testing".to_string()),
14471454
};
14481455

14491456
let running = Running {
@@ -1482,6 +1489,10 @@ mod tests {
14821489
info.server_info.website_url,
14831490
Some("https://my-server.example.com/docs".to_string())
14841491
);
1492+
assert_eq!(
1493+
info.server_info.description,
1494+
Some("A custom MCP server for testing".to_string())
1495+
);
14851496
}
14861497

14871498
mod sse_resumability {

crates/apollo-mcp-server/src/server_info.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ pub struct ServerInfoConfig {
1717

1818
/// URL to the server's website or documentation
1919
pub website_url: Option<String>,
20+
21+
/// A brief description of the server
22+
pub description: Option<String>,
2023
}
2124

2225
impl ServerInfoConfig {
@@ -37,4 +40,10 @@ impl ServerInfoConfig {
3740
.as_deref()
3841
.or(Some("https://www.apollographql.com/docs/apollo-mcp-server"))
3942
}
43+
44+
pub fn description(&self) -> Option<&str> {
45+
self.description.as_deref().or(Some(
46+
"A Model Context Protocol (MCP) server for exposing GraphQL APIs as tools.",
47+
))
48+
}
4049
}

docs/source/config-file.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -467,7 +467,8 @@ These fields are under the top-level `server_info` key and configure the server
467467
| `name` | `string` | `"Apollo MCP Server"` | The name of the MCP server implementation (used as a technical identifier) |
468468
| `version` | `string` | Current crate version (e.g., `"1.5.0"`) | The version of the MCP server implementation |
469469
| `title` | `string` | `"Apollo MCP Server"` | Human-readable title for the server (used for display in UIs) |
470-
| `website_url` | `URL` | `"https://www.apollographql.com/docs/apollo-mcp-server"` | URL to the server's website or documentation |
470+
| `website_url` | `URL` | `"https://www.apollographql.com/docs/apollo-mcp-server"` | URL to the server's website or documentation |
471+
| `description` | `string` | `"A Model Context Protocol (MCP) server for exposing GraphQL APIs as tools."` | A brief description of the server |
471472

472473
All fields are optional. If not specified, sensible defaults are used. This is useful when wrapping Apollo MCP Server or branding it for specific use cases.
473474

@@ -477,6 +478,7 @@ server_info:
477478
version: "2.0.0"
478479
title: "Acme MCP Server"
479480
website_url: "https://acme.com/mcp-docs"
481+
description: "MCP server for Acme Corp's GraphQL API"
480482
```
481483

482484
## Example config files

0 commit comments

Comments
 (0)