How to hit /api/files directly? (Programmatic uploads via MCP server)
#602
Unanswered
asnijders-dc
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hey everyone,
I'm trying to bypass the web UI and programmatically push files directly to LibreChat from an external backend (specifically, an MCP server handling local docs).
I've tested the
/api/filesendpoint and can successfully auth if I grab and reuse my active session cookies/tokens from the browser. However, I haven't been able to successfully auth with the endpoint directly using either the Librechat OpenID ID token, Access token, etc.Since there's no public documentation on direct backend ingestion for files yet, I'm looking for some clarity on the intended workflow:
multipart/form-data, I assume? Are there any hidden required fields besides the file binary (likepurposeorconversationId)?file_id) comes back that I need to map into a subsequent message payload so the LLM actually sees the file?If anyone has a quick
curlsnippet or node script of a direct backend file upload to LibreChat without relying on a hijacked session token, that would be amazing.Cheers!
All reactions