部分mcp配置启动错误
1、这是我的mcp配置 "postgresql-mcp": { "command": "npx", "args": [ "@henkey/postgres-mcp-server", "--connection-string", "postgresql://postgres:[email protected]:5432/test" ] } 在cline里配置是可以正常使用的。
2、在spring ai中配置启动报以下错误。 但其他mcp是正常的。只是这个mcp报错
[org/springframework/ai/mcp/client/autoconfigure/McpClientAutoConfiguration.class]: Failed to instantiate [java.util.List]: Factory method 'mcpSyncClients' threw exception with message: Unrecognized field "pg_analyze_database" (class io.modelcontextprotocol.spec.McpSchema$ServerCapabilities$ToolCapabilities), not marked as ignorable (one known property: "listChanged"]) at [Source: UNKNOWN; byte offset: #UNKNOWN] (through reference chain: io.modelcontextprotocol.spec.McpSchema$InitializeResult["capabilities"]->io.modelcontextprotocol.spec.McpSchema$ServerCapabilities["tools"]->io.modelcontextprotocol.spec.McpSchema$ServerCapabilities$ToolCapabilities["pg_analyze_database"]) at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:804) ~[spring-beans-6.2.7.jar:6.2.7] at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:240) ~[spring-beans-6.2.7.jar:6.2.7] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1395) ~[spring-beans-6.2.7.jar:6.2.7]
Failed to instantiate [org.springframework.ai.mcp.SyncMcpToolCallbackProvider]: Factory method 'mcpToolCallbacks' threw exception with message: Error creating bean with name 'mcpSyncClients' defined in class path resource [org/springframework/ai/mcp/client/autoconfigure/McpClientAutoConfiguration.class]: Failed to instantiate [java.util.List]: Factory method 'mcpSyncClients' threw exception with message: Unrecognized field "pg_analyze_database" (class io.modelcontextprotocol.spec.McpSchema$ServerCapabilities$ToolCapabilities), not marked as ignorable (one known property: "listChanged"]) at [Source: UNKNOWN; byte offset: #UNKNOWN] (through reference chain: io.modelcontextprotocol.spec.McpSchema$InitializeResult["capabilities"]->io.modelcontextprotocol.spec.McpSchema$ServerCapabilities["tools"]->io.modelcontextprotocol.spec.McpSchema$ServerCapabilities$ToolCapabilities["pg_analyze_database"]) at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:804) ~[spring-beans-6.2.7.jar:6.2.7] at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:546) ~[spring-beans-6.2.7.jar:6.2.7] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1375) ~[spring-beans-6.2.7.jar:6.2.7] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1205) ~[spring-beans-6.2.7.jar:6.2.7]
Factory method 'mcpToolCallbacks' threw exception with message: Error creating bean with name 'mcpSyncClients' defined in class path resource [org/springframework/ai/mcp/client/autoconfigure/McpClientAutoConfiguration.class]: Failed to instantiate [java.util.List]: Factory method 'mcpSyncClients' threw exception with message: Unrecognized field "pg_analyze_database" (class io.modelcontextprotocol.spec.McpSchema$ServerCapabilities$ToolCapabilities), not marked as ignorable (one known property: "listChanged"]) at [Source: UNKNOWN; byte offset: #UNKNOWN] (through reference chain: io.modelcontextprotocol.spec.McpSchema$InitializeResult["capabilities"]->io.modelcontextprotocol.spec.McpSchema$ServerCapabilities["tools"]->io.modelcontextprotocol.spec.McpSchema$ServerCapabilities$ToolCapabilities["pg_analyze_database"]) at org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:804) ~[spring-beans-6.2.7.jar:6.2.7] at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:546) ~[spring-beans-6.2.7.jar:6.2.7] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1375) ~[spring-beans-6.2.7.jar:6.2.7]