server_runtime_status#

scikitplot.mcp.server_runtime_status()[source]#

Report, without importing the MCP SDK, whether the protocol server can run in this interpreter — so callers can degrade gracefully to the SDK-free retrieval layer instead of catching an exception from create_server.

This never imports mcp/mcp_types (it only checks for their presence via importlib.util.find_spec), so it is safe on any interpreter, including Python 3.8/3.9 where the MCP SDK cannot be installed.

Returns:
dict

Keys: retrieval_available (always True — the SDK-free retrieval core works everywhere), server_available (True only when the Python floor and the SDK are both satisfied), python_ok, python, sdk_present, and reason (None when available, else a short machine-readable cause).

Return type:

dict[str, object]

Notes

Tier model (see RULESET.md): the retrieval contracts, result/provenance models, native search APIs, and Corpus/Annoy adapters are Tier L (Python 3.8+). The MCP protocol server is Tier S (Python >= 3.10 with mcp>=2.0.0,<3). There is deliberately no ad-hoc JSON-RPC “MCP fallback”.

Examples

>>> status = server_runtime_status()
>>> if status["server_available"]:
...     server = create_server(retriever)
... else:
...     hits = retriever.search(
...         "query", k=5
...     )  # Tier-L: DocsRetriever, pydantic-free