Integrum
Convert any Python module or library into a FastMCP Model Context Protocol server.
Integrum turns any Python module, library, function, or class into a Model Context Protocol (MCP) server powered by FastMCP.
Integrum uses Python reflection (inspect), regex filtering, and an in-memory Word-Based Object Store (playful_llama, swift_falcon) so that object-oriented libraries (such as scikit-learn, pandas, PyTorch) can be used naturally by LLMs across multi-turn conversations without token bloat.
Features
- Module Reflection: Automatically introspects functions and classes using
inspect. - Regex Filtering: Expose only what you need with
--includeand--excluderegex patterns. - Word-Based State Management: Object IDs are short, memorable words (e.g.
playful_llama) to save tokens and avoid UUID hallucination. - Multi-User Isolation: Supports FastMCP
Contextsessions to partition objects per connecting client. - Docstring Instruction Injection: Transforms Python docstrings into LLM tool documentation and automatically injects state-handling instructions.
- Dot-Notation Attribute Resolution: Pass
swift_falcon.dataorswift_falcon.targetdirectly to subsequent tool calls likefit(). - CLI & Python API: Run from the command line (
integrum expose) or integrate directly into Python scripts.
Installation
uv pip install integrum
# or
pip install integrum
Quick Start (CLI)
Expose scikit-learn dataset loaders and RandomForestClassifier as an MCP server:
integrum expose sklearn.datasets.load_iris sklearn.ensemble.RandomForestClassifier
Preview what tools will be exposed:
integrum list sklearn.datasets.load_iris sklearn.ensemble.RandomForestClassifier
Filter functions and methods with regex:
integrum expose sklearn.datasets sklearn.ensemble \
--include "^(load_iris|RandomForestClassifier)$"
Run with HTTP or SSE transport:
integrum expose sklearn.datasets.load_iris --transport http --port 8000
Python API
from integrum import IntegrumServer
server = IntegrumServer(name="ml-server")
server.expose(["sklearn.datasets.load_iris", "sklearn.ensemble.RandomForestClassifier"])
# Run over stdio (default for MCP desktop clients)
server.run(transport="stdio")
How State Management Works
When a class is exposed, Integrum registers:
<ClassName>_create: Instantiates the class and stores it under a word ID (e.g.,playful_llama).<ClassName>_<method>: Accepts a virtual parameterobj_id: str(e.g.,obj_id="playful_llama"), resolves the underlying instance, and executes the method.
Returned objects (such as datasets or numpy arrays) are also registered in the store with word IDs, allowing subsequent tools to receive them as arguments.
Examples
Check out examples/gemma_sklearn_session.md and examples/gemma_sklearn_session.json for a complete, verified multi-turn transcript of Gemma 4 26B loading the Iris dataset, performing train_test_split, training a RandomForestClassifier, and evaluating accuracy.
Links & Homepage
- Homepage & Repository: https://github.com/alphadeepai/integrum
- Issue Tracker: https://github.com/alphadeepai/integrum/issues
License
This project is licensed under the terms of the MIT License. Copyright (c) 2026 AlphaDeep.
Metadata
Release files for integrum 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| integrum-0.1.1.tar.gz | 298.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| integrum-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 410.1 kB
Release files / integrum-0.1.1.tar.gz
| Download URL | integrum-0.1.1.tar.gz |
|---|---|
| Size | 298.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
76bdb44c3ee3d708a8eaffcf2622f0e149f868854f857ec86cbaa3c649d0dfcc
|
|
BLAKE2b-256 checksum How to use checksums |
eed3d1d0510b5f167eef09263ce04114ade25b726074ca213aa1983ce1c52686
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.12
|
Release files / integrum-0.1.1-py3-none-any.whl
| Download URL | integrum-0.1.1-py3-none-any.whl |
|---|---|
| Size | 111.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
097a174dc1f027b754065772b8b2fa314deea3bb81721732dd9c914c98e9ee16
|
|
BLAKE2b-256 checksum How to use checksums |
f7a7f83e6f4964863aa6c788462fe8dd8bfbd4aaeee856c0c13f828368633e18
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.12
|