Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Unsupported model error when using Bedrock Anthropic (Claude) with MCP tools

未关闭
#1,176 4 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

@hemasekhar-p 已经在做这个了。

开始于 2026年5月4日。

评估

这个 Issue 还没有评估数据。

描述

needs review

Describe the Bug:

When using a Bedrock-backed Anthropic Claude model via SpringAI, the model works correctly without tools. However, when MCP tools are added to the LlmAgent, the execution fails with Unsupported model from LlmRegistry.

This suggests that tool-enabled flows rely on LlmRegistry, which does not recognize non-Gemini models such as Bedrock Anthropic.

Steps to Reproduce:
1. Create a Bedrock ChatModel:

BedrockProxyChatModel.builder()
        .region(Region.of(config.getLocation()))
        .bedrockRuntimeClient(bedrockClient)
        .bedrockRuntimeAsyncClient(bedrockAsyncClient)
        .defaultOptions(options)
        .build();

2. Create an LlmAgent WITHOUT tools:

LlmAgent llmAgent = LlmAgent.builder()
        .name("McpTestClient")
        .model(new SpringAI(chatModel, "us.anthropic.claude-sonnet-4-5-20250929-v1:0"))
        .description(".....")
        .instruction(".....")
        .build();

3. Execute using runner:

InMemoryRunner runner = new InMemoryRunner(llmAgent);

Session session = runner.sessionService()
        .createSession(runner.appName(), "user1")
        .blockingGet();

Content userMsg = Content.fromParts(
        Part.fromText("What is the capital of France ?")
);

Flowable<Event> events =
        runner.runAsync(session.userId(), session.id(), userMsg);

events.blockingForEach(event ->
        System.out.println(event.stringifyContent())
);

THIS WORKS AS EXPECTED

4. Add MCP tools:

LlmAgent.builder()
        .name("McpTestClient")
        .model(new SpringAI(chatModel, "us.anthropic.claude-sonnet-4-5-20250929-v1:0"))
        .description(".....")
        **.tools(mcptools)**
        .instruction(".....")
        .build();

5. Run the same flow

Expected Behavior:

MCP tools should work with Bedrock Anthropic models the same way they work with Gemini models, since the base model invocation works correctly.

Observed Behavior:

Execution fails with:

IllegalArgumentException: Unsupported model: us.anthropic.claude-sonnet-4-5-20250929-v1:0

The exception originates from:

com.google.adk.models.LlmRegistry.createLlm()

Environment Details:
ADK Library Version: 1.2.0
OS: Linux
TS Version: N/A
Model Information:
Model used: us.anthropic.claude-sonnet-4-5-20250929-v1:0
Provider: AWS Bedrock (Anthropic Claude)

Logs:
java.lang.IllegalArgumentException: Unsupported model: us.anthropic.claude-sonnet-4-5-20250929-v1:0
at com.google.adk.models.LlmRegistry.createLlm(LlmRegistry.java:91)

Additional Context:
The same model works correctly when tools are NOT used
The failure only occurs when .tools(...) is added to LlmAgent
Initial investigation suggests LlmRegistry only supports Gemini models
Non-Gemini providers (Bedrock / Anthropic) are not registered

This raises the question:

Is tool support currently limited to Gemini models?
Should Bedrock / Anthropic models be supported in LlmRegistry?

Minimal Reproduction Code:
LlmAgent.builder()
.name("McpTestClient")
.model(new SpringAI(chatModel, "us.anthropic.claude-sonnet-4-5-20250929-v1:0"))
.tools(mcptools)
.build();

How often has this issue occurred?:
Always

主要语言
Java
星标
1.7k
派生
433
平均合并
3 天 13 小时
30 天内合并 PR
42

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

google/adk-java 的其他 Issue

查看 google/adk-java 的全部 Issue

相似的 Issue

更多 Java Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。