v0.9.0
Added
-
Public in-process transport surface on
MCPServer— two methods that let
an in-process consumer (a bridge, a Pydantic-AI toolset, a management command)
run tools exactly as a remote MCP client would, without the HTTP / JSON-RPC hop
and without reaching into handler internals:MCPServer.list_tools(cursor=None, *, user, request=None)returns one
tools/listpage with the same mergedinputSchema(serializer fields plus a
selector tool's filter / ordering / pagination arguments and the
additionalPropertiespolicy), the sameFILTER_LISTINGS_BY_PERMISSIONS
per-caller filter, and the same opaque-cursor pagination as the wire.MCPServer.acall_tool(name, arguments=None, *, user, request=None)(async)
invokes a tool with the full transport applied — the transport-level MCP
permissions and rate limits, the selector post-fetch pipeline (filter / order
/ paginate), a selector binding's MCP-onlyinput_serializer, chain tools, and
the output format — everything the spec-corecall_tooldeliberately omits.
Returns the wire'sdictpayload (content/structuredContent/isError)
or aJsonRpcErrorfor a protocol fault.
Both build the call context internally from
user+request(synthesising a
minimal request whenrequestisNone). -
JsonRpcErrorandJsonRpcErrorCodere-exported from the package root, so a
consumer ofacall_tool/list_toolscan branch on protocol faults without a
leaf-module import.