Skip to content

MCPAnotated beans found in wrong order #4618

@DannySortino

Description

@DannySortino

Bug description
When using MCPAnnotations such as @McpProgress the AbstractAnnotatedMethodBeanPostProcessor adds the found related methods of the beans to the internal registry. However it is then possible that the McpClientSpecificationFactoryAutoConfiguration will be found and created by Spring before any @component beans meaning that any methods with @McpProgress will fail to be properly created as listeners.

Environment
SpringAI 1.1.0-M2

Steps to reproduce
Have a bean defined with @componet and within that have an @McpProgress method. It will then be noticied that the McpClientSpecificationFactoryAutoConfiguration will be created first and not the Component Bean, and will result in no listener being created.

Expected behavior
I would expect any bean that has @McpProgress to be picked up and processed, and not only ones found within the root spring applicaiton class, and within @configuration classes.

Metadata

Metadata

Assignees

Labels

MCPbugSomething isn't working

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions