Skip to content

[Bug]: MCP Image Generation Tools: Generated images sent to non-vision models causing errors #11413

Description

@JumpLink

What happened?

When MCP (Model Context Protocol) tools return ImageContent (e.g., from image generation tools), LibreChat correctly converts them to artifacts for display. However, these artifacts are then sent back to the LLM in subsequent requests, which causes errors for non-vision models.

Expected behavior:
Image generation tools should work like LibreChat's built-in image generation tools (imageGenTools set): the generated images should be displayed to the user but NOT sent back to the LLM.

Actual behavior:
After an MCP tool generates an image successfully, LibreChat attempts to send the image artifact to the LLM, resulting in errors like:

  • "404 No endpoints found that support image input"
  • "MODEL_NOT_FOUND"

This happens because non-vision models (e.g., Deepseek) don't support image inputs.

Version Information

ghcr.io/danny-avila/librechat:v0.8.2-rc3

Steps to Reproduce

  1. Set up an MCP server that returns ImageContent (e.g., image generation tool)
  2. Configure the MCP server in LibreChat's librechat.yaml
  3. Use a non-vision model (e.g., Deepseek, GPT-3.5)
  4. Call the MCP image generation tool in a conversation
  5. The image is generated and displayed successfully
  6. LibreChat then attempts to send the image artifact to the LLM
  7. Error occurs: "404 No endpoints found that support image input" or "MODEL_NOT_FOUND"

Example MCP Tool Response:

{
  content: [
    { type: 'text', text: 'Image generated successfully.' },
    { type: 'image', data: 'iVBORw0KGgo...', mimeType: 'image/png' }
  ]
}

What browsers are you seeing the problem on?

No response

Relevant log output

2026-01-20 10:14:45 error: [api/server/controllers/agents/client.js #sendCompletion] Operation aborted 404 No endpoints found that support image input
Troubleshooting URL: https://js.langchain.com/docs/troubleshooting/errors/MODEL_NOT_FOUND/⁠

Screenshots

Image

Code of Conduct

  • I agree to follow this project's Code of Conduct

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    🐛 bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions