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.

module documentation

Provide mcp transport operations.

Includes McpProtocolResponse, origin_allowed, McpHttpPolicy.

Class McpHttpPolicy Enforce MCP origin and error rules around the existing HTTP pipeline.
Class McpProtocolResponse Mark encoded protocol output to keep adaptation constant-time.
Function _error Use public status names rather than exception messages or middleware bodies.
Function origin_allowed Accept absent origins and one explicitly configured serialized origin.
Constant _AUTHENTICATION_HEADERS Authentication headers used by policy.
Constant _CLIENT_ERROR_START Client error start value used by policy.
Constant _EXCEPTION_STATUS Exception status definitions used by policy.
Constant _JSON_MEDIA_TYPE application/json.
Constant _REDIRECTION_START Redirection start value used by policy.
Constant _REPLACED_HEADERS Replaced headers used by policy.
Constant _SERVER_ERROR_START Server error start value used by policy.
def _error(status: int) -> McpProtocolResponse: (source)

Use public status names rather than exception messages or middleware bodies.

Parameters
status:intValue supplied for status.
Returns
orionis.mcp.transport.policy.McpProtocolResponseResult of the operation described above.
def origin_allowed(headers: Headers, origins: frozenset[str]) -> bool: (source)

Accept absent origins and one explicitly configured serialized origin.

Parameters
headers:orionis.http.payload.estructures.headers.HeadersValue supplied for headers.
origins:frozenset[str]Value supplied for origins.
Returns
boolResult of the operation described above.
_AUTHENTICATION_HEADERS = (source)

Authentication headers used by policy.

Value
frozenset(set(['www-authenticate', 'allow']))
_CLIENT_ERROR_START: int = (source)

Client error start value used by policy.

Value
400
_EXCEPTION_STATUS = (source)

Exception status definitions used by policy.

Value
{AuthenticationException: HTTPStatus.UNAUTHORIZED,
 AuthorizationException: HTTPStatus.FORBIDDEN,
 RouteNotFound: HTTPStatus.NOT_FOUND,
 MethodNotAllowed: HTTPStatus.METHOD_NOT_ALLOWED,
 PayloadTooLargeException: HTTPStatus.REQUEST_ENTITY_TOO_LARGE,
 UnsupportedMediaTypeException: HTTPStatus.UNSUPPORTED_MEDIA_TYPE,
 CSRFTokenMismatchException: HTTPStatus.FORBIDDEN,
...
_JSON_MEDIA_TYPE: str = (source)

application/json.

Value
'application/json'
_REDIRECTION_START: int = (source)

Redirection start value used by policy.

Value
300
_REPLACED_HEADERS = (source)

Replaced headers used by policy.

Value
frozenset(set(['content-type', 'content-length', 'location']))
_SERVER_ERROR_START: int = (source)

Server error start value used by policy.

Value
500