[Enhancement]: Let MCP tools securely access existing conversation attachments

Open
#18,503 0 comments 1 reaction 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
typescript
Domain
api, backend

Research direction

Start by reading the existing MCP tool input handling and conversation attachment access paths; the issue names General, Plugins, and Endpoints as affected components but gives no file or test paths. Trace how current-message and earlier attachments are identified and how server opt-in, ownership, tenant isolation, file-type restrictions, and short-lived read-only access are enforced. Done means opted-in MCP tools can use eligible conversation attachments through ordinary tool arguments, while non-opted-in servers and existing Code Interpreter/RAG workflows behave as before.

Written by the indexing model from the issue text.

Description

✨ enhancement
What features would you like to see added?

Allow agents to use files already attached to a LibreChat conversation as inputs to compatible MCP tools, without asking users to upload them again or create and manage file-sharing URLs.

LibreChat already provides a unified attachment experience in some configurations, but file delivery and access are still largely tool-specific. Code Interpreter/Run Code, RAG/File Search, and other built-in capabilities each have their own file-consumption paths. A file visible in the conversation is therefore not necessarily available to an MCP tool that needs it.

For a user, this distinction is confusing: if they upload a spreadsheet, PDF, image, or audio file, they expect an agent to be able to use that same attachment with the appropriate enabled tool—whether built into LibreChat or provided by an MCP server.

Example user journey:

  1. I upload a spreadsheet to a conversation.
  2. I ask the agent to process it using a connected MCP data-analysis tool.
  3. The agent references my existing attachment in the MCP tool call, and the tool can read it.
  4. I ask a follow-up question about the same file, without re-uploading it.

The goal is seamless upload once, use with compatible tools behavior, starting with MCP inputs. This request does not require redesigning Code Interpreter or RAG file handling, or introducing a new public-sharing option in the UI.

More details

Desired behavior

  • Current-message attachments are available to an MCP tool when the relevant server is explicitly enabled for attachment access.
  • Supported earlier attachments from the same conversation can also be used in follow-up requests where conversation history/files are available.
  • Users do not need to upload files to a special destination, manually copy URLs, or understand internal file routing.
  • Existing MCP tools that accept file URLs can use the attachments through their ordinary tool arguments, without LibreChat-specific APIs.
  • File access respects ownership, tenant isolation, file-type restrictions, and server configuration; external access is read-only and short-lived.
  • Servers that are not opted in, and existing Code Interpreter/RAG workflows, continue to behave as before.

Example use cases

  • Process an uploaded PDF with an MCP document extraction or conversion tool.
  • Analyze an uploaded XLSX/CSV file using a remote MCP service.
  • Edit or inspect an uploaded image with an MCP image-processing tool.
  • Reuse a previously attached file across multi-step agent workflows.

Relationship to existing requests and work

This is a narrower, complementary request to existing work, focused on automatic, secure MCP-tool access to already uploaded conversation attachments:

  • #8060 requests temporary downloadable links for MCP integrations. This issue focuses on transparent tool-call-time handoff, rather than exposing file links for the user or model to manage.
  • #15481 proposes exposing stable file references/metadata so the model can name attachments. This request additionally requires those references to resolve into actual MCP tool access.
  • #13913 proposes a broader unified virtual filesystem across Code Interpreter, MCP, and other tools. This issue is a smaller, immediately useful MCP-input capability.
  • #17370 discusses automatic routing of unified uploads to built-in tools; this request complements that effort for MCP servers.
  • PR #15891 proposes a separate "Upload and Share as URL" flow with public links, whereas this request aims to reuse normal conversation uploads with temporary, controlled access.
  • PR #14940 proposes forwarding selected images as data URLs; this request is not limited to images and does not require embedding file bytes in tool calls.
Which components are impacted by your request?

General, Plugins, Endpoints

Pictures

Not applicable — no UI change is required.

Dominant language
TypeScript
Stars
45.6k
Forks
9.4k
Avg merge
16h 24m
Merged PRs (30d)
825

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from LibreChat-AI/LibreChat

All issues in LibreChat-AI/LibreChat

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.