THE ORIONIS API
Build with clarity.
Explore the building blocks of an async-first Python framework. Every module, class, and method — connected, searchable, and ready to build with.
class documentation
Open scopes on the supplied container; never create a parallel application.
| Method | __init__ |
Reuse native service bindings and one compiled server. |
| Async Method | request |
Collect a finite exchange; use stream() for subscriptions. |
| Async Method | stream |
Keep the existing application's scope alive through the entire stream. |
| Async Method | tool |
Invoke a tool through JSON-RPC input and output bytes. |
| Class Variable | __slots__ |
Declare the instance attribute slots reserved by this class. |
| Instance Variable | app |
Application container supplying configuration and dependencies. |
| Instance Variable | dispatcher |
Dispatcher sharing this client's configuration and event bus. |
def __init__(self, app:
IContainer, server: type[ Server] | CompiledMcpServer, config: McpConfig | None = None):
(source)
¶
Reuse native service bindings and one compiled server.
| Parameters | |
app:orionis.container.contracts.container.IContainer | Application container supplying configuration and dependencies. |
server:type[orionis.mcp.server.primitives.Server] | CompiledMcpServer | Server declaration to compile, or an existing compiled server. |
config:orionis.mcp.config.McpConfig | None, optional | Protocol limits; use the default configuration when omitted. |
| Returns | |
None | No return value. |
async def request(self, method:
str, params: dict[ str, object] | None = None, *, meta: dict[ str, object] | None = None, request_id: str | int = 1) -> McpTestResponse:
(source)
¶
Collect a finite exchange; use stream() for subscriptions.
| Parameters | |
method:str | JSON-RPC method to invoke. |
params:dict[str, object] | None, optional | Method parameters, defaulting to an empty mapping. |
meta:dict[str, object] | None, optional | Request metadata overriding the default version and capabilities. |
requeststr | int, optional | Correlation identifier, defaulting to 1. |
| Returns | |
orionis.test.McpTestResponse | Final response and preceding notifications in wire order. |
async def stream(self, method:
str, params: dict[ str, object] | None = None, *, meta: dict[ str, object] | None = None, request_id: str | int = 1) -> AsyncIterator[ dict[ str, object]]:
(source)
¶
Keep the existing application's scope alive through the entire stream.
| Parameters | |
method:str | JSON-RPC method to invoke. |
params:dict[str, object] | None, optional | Method parameters, defaulting to an empty mapping. |
meta:dict[str, object] | None, optional | Request metadata overriding the default version and capabilities. |
requeststr | int, optional | Correlation identifier, defaulting to 1. |
| Yields | |
dict[str, object] | Each decoded notification or final response in wire order. |
async def tool(self, name:
str, arguments: dict[ str, object] | None = None) -> McpTestResponse:
(source)
¶
Invoke a tool through JSON-RPC input and output bytes.
| Parameters | |
name:str | Registered tool name. |
arguments:dict[str, object] | None, optional | Tool input fields, defaulting to an empty mapping. |
| Returns | |
orionis.test.McpTestResponse | Serialized tool result and preceding notifications. |