ORIONIS API REFERENCE

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

Keep the reader available while bounded request tasks execute independently.

Method __init__ Prepare request-local task ownership without touching process streams.
Async Method _accept Stop queued output without joining a potentially blocked OS writer.
Method _cancel Ignore malformed, unknown and already completed cancellation messages.
Method _done Remove completed task ownership and notify the reader of I/O failures.
Async Method _invoke Execute one call in its own DI scope, sanitizing only application errors.
Async Method _readLoop Race each cancellable read against a failed request's transport I/O.
Async Method _stream Preserve backpressure and close an owned producer on all exits.
Async Method _write Serialize frames and suppress output after EOF or owner shutdown.
Async Method run Run until EOF, joining all owned request cleanup before returning.
Async Method runStandardStreams Bind portable daemon-backed streams and keep application prints on stderr.
Class Variable __slots__ Declare the instance attribute slots reserved by this class.
Instance Variable _active Operations currently running for this connection or transport.
Instance Variable _app Application container supplying configuration and dependencies.
Instance Variable _closing Whether resource cleanup is currently in progress.
Instance Variable _config Validated configuration controlling this component.
Instance Variable _dispatcher Dispatcher produced by McpDispatcher.
Instance Variable _failed Backend retaining failed-job records.
Instance Variable _failure Failure retained for propagation or reporting.
Instance Variable _lock Lock protecting concurrent access to shared state.
Instance Variable _reports Failure delivery tasks owned until transport shutdown.
Instance Variable _running Running flag used by McpStdioTransport.
def __init__(self, app: IApplication, compiled: CompiledMcpServer, config: McpConfig, bus: IMcpEventBus): (source)

Prepare request-local task ownership without touching process streams.

Parameters
app:orionis.IApplicationApplication container supplying configuration and dependencies.
compiled:orionis.mcp.server.compiler.CompiledMcpServerPrecompiled metadata shared by request executions.
config:orionis.mcp.config.McpConfigValidated configuration controlling this component.
bus:orionis.mcp.contracts.event_bus.IMcpEventBusValue supplied for bus.
Returns
NoneComplete the documented operation without returning a value.
async def _accept(self, data: bytes, writer: LineWriter): (source)

Stop queued output without joining a potentially blocked OS writer.

Parameters
data:bytesValue supplied for data.
writer:orionis.mcp.transport.stdio.LineWriterOutput stream receiving complete messages with backpressure.
Returns
NoneComplete the documented operation without returning a value.
def _cancel(self, request: JsonRpcRequest): (source)

Ignore malformed, unknown and already completed cancellation messages.

Parameters
request:orionis.mcp.protocol.requests.JsonRpcRequestCurrent request and its trusted execution context.
Returns
NoneComplete the documented operation without returning a value.
def _done(self, request_id: str | int, task: asyncio.Task[None]): (source)

Remove completed task ownership and notify the reader of I/O failures.

Parameters
request_id:str | intValue supplied for request_id.
task:asyncio.Task[None]Value supplied for task.
Returns
NoneComplete the documented operation without returning a value.
async def _invoke(self, request: JsonRpcRequest, writer: LineWriter): (source)

Execute one call in its own DI scope, sanitizing only application errors.

Parameters
request:orionis.mcp.protocol.requests.JsonRpcRequestCurrent request and its trusted execution context.
writer:orionis.mcp.transport.stdio.LineWriterOutput stream receiving complete messages with backpressure.
Returns
NoneComplete the documented operation without returning a value.
async def _readLoop(self, reader: LineReader, writer: LineWriter): (source)

Race each cancellable read against a failed request's transport I/O.

Parameters
reader:orionis.mcp.transport.stdio.LineReaderInput stream supplying bounded messages.
writer:orionis.mcp.transport.stdio.LineWriterOutput stream receiving complete messages with backpressure.
Returns
NoneComplete the documented operation without returning a value.
async def _stream(self, writer: LineWriter, source: AsyncIterator[bytes]): (source)

Preserve backpressure and close an owned producer on all exits.

Parameters
writer:orionis.mcp.transport.stdio.LineWriterOutput stream receiving complete messages with backpressure.
source:collections.abc.AsyncIterator[bytes]Source whose values or lifecycle are consumed by this operation.
Returns
NoneComplete the documented operation without returning a value.
async def _write(self, writer: LineWriter, data: bytes): (source)

Serialize frames and suppress output after EOF or owner shutdown.

Parameters
writer:orionis.mcp.transport.stdio.LineWriterOutput stream receiving complete messages with backpressure.
data:bytesValue supplied for data.
Returns
NoneComplete the documented operation without returning a value.
async def run(self, reader: LineReader, writer: LineWriter): (source)

Run until EOF, joining all owned request cleanup before returning.

Parameters
reader:orionis.mcp.transport.stdio.LineReaderInput stream supplying bounded messages.
writer:orionis.mcp.transport.stdio.LineWriterOutput stream receiving complete messages with backpressure.
Returns
NoneComplete the documented operation without returning a value.
async def runStandardStreams(self): (source)

Bind portable daemon-backed streams and keep application prints on stderr.

Returns
NoneComplete the documented operation without returning a value.
__slots__: tuple[str, ...] = (source)

Declare the instance attribute slots reserved by this class.

Operations currently running for this connection or transport.

Application container supplying configuration and dependencies.

_closing: bool = (source)

Whether resource cleanup is currently in progress.

Validated configuration controlling this component.

_dispatcher = (source)

Dispatcher produced by McpDispatcher.

Backend retaining failed-job records.

Failure retained for propagation or reporting.

Lock protecting concurrent access to shared state.

Failure delivery tasks owned until transport shutdown.

_running: bool = (source)

Running flag used by McpStdioTransport.