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
class McpHttpPolicy(IHttpEndpointPolicy): (source)
Constructor: McpHttpPolicy(app, config)
Enforce MCP origin and error rules around the existing HTTP pipeline.
| Method | __init__ |
Compile an origin set without capturing any request or identity. |
| Method | before |
Validate Origin for preflight and unsupported methods as well as POST. |
| Async Method | exception |
Report failures without calling the native HTML/debug presenter. |
| Method | is |
Identify expected MCP protocol and mapped HTTP policy failures. |
| Async Method | response |
Preserve protocol output and replace browser bodies with safe errors. |
| Class Variable | __slots__ |
Declare the instance attribute slots reserved by this class. |
| Class Variable | monitor |
Monitor disconnects flag used by McpHttpPolicy. |
| Instance Variable | _app |
Application container supplying configuration and dependencies. |
| Instance Variable | _origins |
Origins produced by frozenset. |
Compile an origin set without capturing any request or identity.
| Parameters | |
app:orionis.IApplication | Application container supplying configuration and dependencies. |
config:orionis.mcp.config.McpConfig | Validated configuration controlling this component. |
| Returns | |
None | Complete the documented operation without returning a value. |
Validate Origin for preflight and unsupported methods as well as POST.
| Parameters | |
adapter:orionis.http.adapters.request.contracts.transport.TransportAdapter | Value supplied for adapter. |
| Returns | |
orionis.http.Response | None | Result of the operation described above. |
async def exception(self, exception:
Exception, request: Request | TransportAdapter) -> Response:
(source)
¶
Report failures without calling the native HTML/debug presenter.
| Parameters | |
exception:Exception | Exception being inspected or reported. |
request:Request | TransportAdapter | Current request and its trusted execution context. |
| Returns | |
orionis.http.Response | Result of the operation described above. |
Identify expected MCP protocol and mapped HTTP policy failures.
| Parameters | |
exception:BaseException | Failure to classify before HTTP observation. |
| Returns | |
bool | True for MCP protocol errors with status below 500 or for mapped policy exception types, including subclasses; otherwise False. |
Preserve protocol output and replace browser bodies with safe errors.
| Parameters | |
response:orionis.http.Response | Value supplied for response. |
| Returns | |
orionis.http.Response | Result of the operation described above. |