{"slug": "integrum-reflection-based-mcp-server-from-any-python-module-or-library", "title": "Integrum – Reflection based MCP Server from any Python module or library", "summary": "Developer Nemanja Milosevic open sourced Integrum, an MIT-licensed library that generates MCP servers from existing Python modules, libraries, or plain classes, under the AlphaDeep project. Integrum uses an in-memory object store with word-based keys for state management and relies on FastMCP context for multi-user isolation in HTTP/SSE sessions. In a test, Gemma 4 (26B A4B) used Integrum to access scikit-learn's Random Forest Classifier on the Iris dataset and reached 100% validation accuracy without hyperparameter tuning.", "body_md": "# \n[Integrum - Reflection based MCP Server from any Python module or library](https://nmilosev.svbtle.com/integrum-reflection-based-mcp-server-from-any-python-module-or-library)\n\nYesterday I open sourced [Integrum](https://github.com/alphadeepai/integrum), a library that is a part of [AlphaDeep](https://alphadeep.ai) world. It allows you to quickly create MCP server(s) from existing Python libraries or modules (or even plain classes!). It is released with MIT license and I hope somebody else also finds it useful for a more formal approach to giving agents additional capabilities (compared to just letting them writing arbitrary code with or without a sandbox).\n\nCouple of interesting things about it:\n\n### State Management [#](#state-management_3)\n\nObviously not all Python code is functional, so some state management is required. I opted for a simple in memory object store pattern with keys being “model-friendly” -> they are words to save tokens. Also there is tuple unpacking, array access and other simple needed things to get started.\n\n### Multi-user isolation [#](#multiuser-isolation_3)\n\nLLM sessions are stateless by design so I thought it would be hard to keep track of which object belongs to which user. Luckily after inspecting FastMCP implementation it seems like context is present (for HTTP/SSE anyway) so that didn’t turn out to be that difficult in the end.\n\n## Gemma experiment (recursive self-improvement? :)) [#](#gemma-experiment-recursive-selfimprovement_2)\n\nTo test Integrum out I gave Gemma 4 (26B A4B) access to `scikit-learn` Random Forest Classifier and a toy dataset (Iris). [Without much trouble Gemma was able to build and evaluate a small model](https://github.com/alphadeepai/integrum/blob/main/examples/gemma_sklearn_session.md). It didn’t experiment with hyperparameter tuning but since it got 100% validation accuracy it didn’t have the opportunity. \n\nIt would be interesting to see what it would do with a “hard” problem. It would also be interesing if we gave it tools to update its own weights to improve performance on some benchmark. :)", "url": "https://wpnews.pro/news/integrum-reflection-based-mcp-server-from-any-python-module-or-library", "canonical_source": "https://nmilosev.svbtle.com/integrum-reflection-based-mcp-server-from-any-python-module-or-library", "published_at": "2026-10-09 19:03:31+00:00", "updated_at": "2026-10-09 19:22:12.410498+00:00", "lang": "en", "topics": ["ai-agents", "agent-protocols", "ai-tools", "developer-tools", "large-language-models"], "entities": ["Integrum", "Nemanja Milosevic", "AlphaDeep", "FastMCP", "Gemma 4", "scikit-learn", "Random Forest Classifier", "Iris dataset"], "also_reported_by": [], "alternates": {"html": "https://wpnews.pro/news/integrum-reflection-based-mcp-server-from-any-python-module-or-library", "markdown": "https://wpnews.pro/news/integrum-reflection-based-mcp-server-from-any-python-module-or-library.md", "text": "https://wpnews.pro/news/integrum-reflection-based-mcp-server-from-any-python-module-or-library.txt", "jsonld": "https://wpnews.pro/news/integrum-reflection-based-mcp-server-from-any-python-module-or-library.jsonld"}}