Skip to content

Caused by: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "tools" #2481

Closed
@JoshuaCH

Description

@JoshuaCH

After I started the mcp server, I failed to configure mcp through the cursor client. After debugging, I found that the cursor's mcp protocol interaction message contained undefined fields, which could not be recognized during json serialization, resulting in the error Caused by: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "tools"

Solution:
Specifically in McpWebFluxServerAutoConfiguration

You can add mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) during initialization

For example:
@bean
@ConditionalOnMissingBean
public WebFluxSseServerTransport webFluxTransport(McpServerProperties serverProperties) {
ObjectMapper mapper = new ObjectMapper();
mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);
return new WebFluxSseServerTransport(mapper, serverProperties.getSseMessageEndpoint());
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions