REDDIT 原始帖子

Notion's API supports file uploads, but the MCP connector doesn't seem to expose it. Any way around this?

I have a Claude workflow that reads a receipt or invoice I upload in chat, pulls out the vendor, date, amount and line items, and creates an entry in my Notion Expenses database. It works well, except for one thing: the receipt file itself never makes it into…

原帖正文r/Notion

I have a Claude workflow that reads a receipt or invoice I upload in chat, pulls out the vendor, date, amount and line items, and creates an entry in my Notion Expenses database. It works well, except for one thing: the receipt file itself never makes it into Notion. I still attach every receipt by hand, which defeats most of the point. I know Notion added file uploads to the public API in May 2025. The flow is documented here and looks simple enough: https://notionmastery.com/uploading-files-via-notions-api/ POST /v1/file_uploads to create a pending upload, which returns an upload_url POST the raw bytes to that upload_url POST .../complete if it was multi-part Reference the returned upload ID when you set a property, a page body block, or a page cover So the capability exists. My problem is that I cannot reach it. What I actually have I'm using Claude's hosted Notion connector (MCP). The only file-related tool it gives me is notion-create-attachment, and it accepts exactly two kinds of input: content: inline UTF-8 text only, capped at 200 KiB. Fine for HTML, Markdown, CSV, SVG, JSON. No good for a JPEG or a PDF. source_url: a public HTTPS link that Notion downloads server side. It must be a direct link. No redirects, no cookies, no auth headers, no private addresses. There is no parameter for sending raw bytes, so steps 1 to 3 above are simply not available to me. What I've already tested notion-create-attachment with inline text works. It returns a file-upload:// source I can drop into a page. So the plumbing is fine, the input format is the blocker. Calling api.notion.com directly from Claude's code sandbox is blocked at the network level. Curl returns nothing, exit code 000. So writing my own script against the documented API is out, even if I created an internal integration token. A Google Drive share link as source_url looks like a dead end too, since Drive download links redirect and Notion explicitly rejects redirects. What I'm hoping someone can tell me Is there any Notion MCP server that exposes the real file_uploads endpoints? Self-hosted or community built is fine. I'd rather run the proper flow than encode images into HTML. Does a file-upload:// reference even work in a file property, or only in the page body? I haven't found a clear answer, and the docs mostly show page covers and content blocks. Is there a sane way to produce a temporary public direct link that Notion's server side fetch will accept, meaning no redirect and no auth? These are receipts with my name and card details on them, so I'm not keen on dumping them on a random public host, but a short lived signed URL would be acceptable if there's a clean option. Has anyone done the base64 in HTML trick into Notion? Any gotchas with rendering, size, or Notion stripping the data URI? More broadly, is a small self-hosted relay the normal answer here, where I run something that holds a token and does the three step upload, and my assistant just calls it? Happy to share the working half of the setup if it's useful to anyone. Mostly I just want to stop attaching receipts by hand.

已收录讨论

2 条评论

u/mooka42

I built my own custom MCP with Claude Code to do this. It uses FastMCP and exposes all of the API functionality.

u/mooka42

I've improved it since. If it's useful I could update this and break it out into its own repo. I use custom file backend to help me pass files in a scratchpad between my various custom Claude Coded MCPs. https://github.com/snickery/quadlet-homelab/tree/main/mcp/notion-mcp