MCP server: add tools to send and read file attachments

Aperta
#43,995 1 commento 1 reazione 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@marceloschmidt ci sta già lavorando.

Dal 29/11/2026.

  • #43996 di @marceloschmidt — aperta
  • #44056 di @marceloschmidt — aperta

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
javascript, typescript
Ambito
api, backend

Direzione di ricerca

Start with ALLOWED_TOOL_NAMES in apps/meteor/ee/server/api/mcp/catalog.ts and the rooms.media and rooms.mediaConfirm routes in apps/meteor/server/api/v1/rooms.ts. Trace how MCP tools accept JSON arguments and how the routes handle multipart uploads and confirmation. Done means an MCP tool can send a file attachment with a message in a room or DM; the issue does not name tests to run.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

type: feature
What

The Rocket.Chat MCP server can't send a file, and it can't read one.

  • It can post text messages (post_chat_postMessage, post_chat_sendMessage), but it has no upload tool. When an agent needs to share a file in a room or DM, it can only paste the file's contents as text.
  • It can read messages, and a message with an attachment carries the file's ID and URL, but no tool returns the file itself. An agent can't open a document someone attached, or see a screenshot.
Why

An agent was asked to send a .md spec as an attachment in a DM. The connector couldn't do it, so the agent opened the web client in the user's browser and uploaded the file there. A connector that can post messages should be able to attach files to them too.

The reverse is as common: a user attaches a file and asks the agent about it. Today the agent sees that a file exists and nothing more.

Current state
  • ALLOWED_TOOL_NAMES in apps/meteor/ee/server/api/mcp/catalog.ts lists no upload routes. The only uploads entry is the commented-out post_uploads_delete.
  • Uploads go through rooms.media/:rid followed by rooms.mediaConfirm/:rid/:fileId (apps/meteor/server/api/v1/rooms.ts). rooms.media takes a multipart body, but MCP tool calls carry JSON arguments. Adding the route to the allow-list therefore isn't enough on its own.
  • Files are served from /file-upload/:id/:name, a plain HTTP route, not a typed REST endpoint, so the catalog can't expose it. Its response is the raw file, while a tool call returns JSON.
  • tools/call returns every result as one text block. For the model to see an image, the result has to be an MCP image block.
Lingua principale
TypeScript
Stelle
46.6k
Fork
14.2k
Merge medio
2g 21h
PR unite (30g)
302

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di RocketChat/Rocket.Chat

Tutte le issue di RocketChat/Rocket.Chat

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.