Skip to content

ServerCapabilities drops unknown fields such as events #1447

Open

Description

@kensj

Describe the bug

rmcp 3.9.0 silently drops unknown top-level fields when it deserializes ServerCapabilities. An MCP gateway that reads and forwards capabilities can therefore lose fields advertised by the upstream server. For example, ChatGPT looks for capabilities.events in initialize or server/discover responses to discover MCP Events. MCP Events documentation

To reproduce

Create a Cargo binary and add these dependencies to Cargo.toml:

[dependencies]
rmcp = { version = "=3.9.0", default-features = false, features = ["server"] }
serde_json = "1"

Put this in src/main.rs and run cargo run:

use rmcp::model::ServerCapabilities;
use serde_json::json;

fn main() {
    let input = json!({"tools": {}, "events": {}});
    let capabilities: ServerCapabilities = serde_json::from_value(input.clone()).unwrap();
    let output = serde_json::to_value(capabilities).unwrap();

    println!("input:  {input}");
    println!("output: {output}");
}

Expected behavior

Both tools and events should survive the JSON round trip. The MCP schema permits additional server capability fields. MCP ServerCapabilities schema

Logs

Actual output with the published rmcp 3.9.0 crate:

input:  {"events":{},"tools":{}}
output: {"tools":{}}

Additional context

We carry a local #[serde(flatten)] patch to preserve additional fields. An earlier Rust SDK PR proposed the same capability behavior, and the Python SDK has a parallel report. Rust SDK PR #1170 · Python SDK issue #3640

AI assistance: I used Codex to search for prior reports, inspect the SDK source, write and run the minimal reproduction, and draft this issue.

Activity

  1. added
    bugSomething is not working
    P1High: significant functionality gap or spec violation
    T-modelModel/data structure changes
    ready for workIssue is well-defined and ready to be picked up
    on Nov 12, 2026
  2. github-actions commented on Nov 12, 2026

    @github-actions
    Contributor

    @jokemanfire is on triage rotation this week and is the reviewer for this one.

    Codex labeled this bug / P1 (T-model). Please confirm or correct those labels.

    Automated triage. Labels are a first pass and the assigned maintainer has the final say.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P1High: significant functionality gap or spec violationT-modelModel/data structure changesbugSomething is not workingready for workIssue is well-defined and ready to be picked up

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions