create_server#
- scikitplot.mcp.create_server(retriever, *, document_reader=None, max_concurrency=4, version='0.2.4', log_level='INFO', health_path=None)[source]#
Create an official MCP Python SDK v2
MCPServerinstance.Importing
scikitplot.mcpremains SDK-independent; the optional MCP dependency is imported only when this factory is called.- Raises:
- RuntimeError
If the interpreter is older than Python 3.10 (the MCP SDK v2 floor), or if the optional MCP SDK v2 is not installed. The two causes carry distinct messages so a 3.8/3.9 user is not told to “install mcp” when the real blocker is the interpreter version.
- Parameters:
retriever (DocsRetriever)
document_reader (Callable[[str], RetrievedChunk | None] | None)
max_concurrency (int)
version (str)
log_level (str)
health_path (str | None)
- Return type:
Notes
The MCP Python SDK v2 requires Python >= 3.10 (verified against the official SDK documentation). scikit-plots itself supports Python >= 3.8, so the server layer is an optional feature gated on the newer floor.