utcp_mcp 0.2.0
utcp_mcp: ^0.2.0 copied to clipboard
MCP transport for the Dart UTCP client: let LLM agents discover and call Model Context Protocol server tools over stdio, streamable HTTP and legacy HTTP+SSE.
0.2.0 #
- A cached OAuth2 token is dropped when the server answers 401 or 403, and a token that is not a usable bearer token is no longer cached.
- A
text/event-streamresponse is recognized whatever the case of its Content-Type. - Legacy HTTP+SSE MCP servers are supported:
transportortypesseselects them, and anhttpserver that answers its first request with 404 or 405 falls back to SSE. When the fallback fails too, the error gives the streamable HTTP status as well. - Breaking: a server's
typeis read as MCP host configuration files write it, so{"type": "sse"}, which used to mean streamable HTTP, now selects legacy HTTP+SSE.streamable-http,streamable_httpandstreamableHttpare accepted ashttp. - Breaking: a
ws://orwss://server URL, which used to parse, is rejected when the config is parsed, with an error saying WebSocket MCP servers are not supported. - Breaking: an
authobject on an HTTP server, and anyauthon a stdio server (nullincluded), used to be dropped and now throw aFormatExceptionnaming the server. A stringauthon an HTTP server is used as its bearer token, as MCP hosts write it. - Resource tools are unique: resources that share a name, or whose
resource_<name>is a tool's name, becomeresource_<name>_<n>in URI order, and a tool namedresource_<name>is called instead of shadowed. - Breaking: a resource tool reads the URI it was registered with, without listing resources and tools again, even after the server's resources change. Register the manual with the protocol that calls its tools first; otherwise a resource tool is sent as a tool call.
- Local
$refs in tool schemas are inlined, as the TypeScript SDK does, including under properties nameddefault,enumorconst. Cycles and malformed references stay references, and expansion is bounded. - A JSON-RPC error from the server throws
McpRpcException, whosecodeis the error code. - A stdio
commandmay be an array, as in the UTCP security guide: the first element is the command and the rest go beforeargs.
0.1.1 #
- Docs: package cross-links, badges and platform notes.
- Runs on the web with streamable HTTP servers; there a stdio server fails discovery, and its tool calls throw a
UtcpException, saying it needs a native platform. See the README's Platforms section for CORS and redirects in browsers.
0.1.0 #
- Initial release: the
mcpcall template and communication protocol, for MCP servers over stdio and streamable HTTP. - Tools are discovered from every configured server and named
manual.server.tool; resources can be registered as tools. - Sessions are reused across calls, replaced when their connection drops, and closed with their last manual or on
close. - HTTP servers go through
HttpTransportfromutcp, with manual-level OAuth2, OAuth2 user, API key and Basic auth. - A tool call is no longer retried after it may have reached the server; only listing and resource reads are retried on a fresh session.
- Discovery errors and logs name the server and command but never stdio
args,env, headers or tokens, and carry no stack traces. McpCallTemplate.endpointslists HTTP server URLs, so a remote manual cannot pointmcptools at a loopback server.- Tool call and resource errors are redacted like discovery errors: refusing a plain HTTP server URL, or an error from the HTTP transport, no longer puts the URL's query or user info in the message, and percent-encoded values are masked too.
- Redaction no longer throws on non-UTF-8 percent escapes in a server URL, and the log line for a failed session end is redacted too.