Commit Graph

10 Commits

Author SHA1 Message Date
Max Isbey a7a9ab58b7 Replace FileResource.is_binary with an encoding field
FileResource guessed is_binary from mime_type with a text/* prefix check,
and because False doubled as the "not given" sentinel an explicit
is_binary=False could never take effect, so application/json files were
always served as base64 blobs. Text reads also used Path.read_text()
with no encoding, i.e. the platform locale.

The field is now encoding: str | None. A string decodes the file and
serves it as text; None reads bytes and serves a blob. When omitted the
default comes from mime_type: the declared charset if present, else
utf-8 for textual types (text/*, +json/+xml suffixes, application/json,
xml, javascript), else None.

Resource models now reject unknown keyword arguments, so passing the
removed is_binary= fails at construction instead of being ignored.
2026-07-25 19:32:11 +00:00
Max 8d0f928e40 Pass InputRequiredResult through the MCPServer prompt and resource pipelines (#3020) 2026-06-29 16:50:58 +01:00
Max 24717cc8eb feat: RFC 6570 URI templates with operator-aware security (#2356) 2026-06-26 20:29:17 +02:00
Marcelo Trylesinski 0ee7f1b293 Split protocol types into a standalone mcp-types package (#2973) 2026-06-25 19:18:38 +02:00
Marcelo Trylesinski f253682393 Return -32602 for resource not found (SEP-2164) (#2920) 2026-06-20 16:55:23 +02:00
Matt LeMay c5f12ec1e9 Add resources parameter to MCPServer (#2414)
Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
2026-04-12 14:42:12 +02:00
Max Isbey 3ce0f76e6e Don't block the event loop on sync resource and prompt functions (#2380) 2026-03-31 13:43:56 -04:00
Max Isbey 92f1b1500d fix: remove MIME type validation from MCPServer Resource (#2235) 2026-03-06 14:50:58 +00:00
Max Isbey cc22bf5464 refactor: remove request_ctx ContextVar, thread Context explicitly (#2203)
Co-authored-by: Marcelo Trylesinski <marcelotryle@gmail.com>
2026-03-04 13:23:02 +00:00
Marcelo Trylesinski 65c614e48e Rename FastMCP to MCPServer (#1951) 2026-01-25 14:45:52 +01:00