Integrum:从任意 Python 模块或库生成基于反射的 MCP Server
Integrum – Reflection based MCP Server from any Python module or library
Integrum 已开源,可从任意 Python 库、模块甚至普通类快速生成 MCP Server,采用 MIT 许可证。它通过内存对象存储实现状态管理,并借助 FastMCP 的 context 支持多用户隔离。测试中 Gemma 4(26B A4B)调用 scikit-learn 的 Random Forest 在 Iris 数据集上构建并评估模型,取得 100% 验证准确率。
October 9, 2026
Integrum - Reflection based MCP Server from any Python module or library
Yesterday I open sourced Integrum, a library that is a part of AlphaDeep 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).
Couple of interesting things about it:
State Management #
Obviously 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.
Multi-user isolation #
LLM 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.
Gemma experiment (recursive self-improvement? :)) #
To 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. It didn’t experiment with hyperparameter tuning but since it got 100% validation accuracy it didn’t have the opportunity.
It 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. :)
0
Kudos
0
Kudos
来源:Hacker News · nmilosev.svbtle.com