跳到正文
r/MachineLearning· /u/nmilosev·· 3 小时前AI 评分56

Integrum:把任意 Python 模块转成基于反射的 MCP server

Integrum - Reflection based MCP server from any Python Module/Library [P]

AI 导读

作者发布开源库 Integrum,可通过反射把现有 Python 库或模块快速转成 MCP server,提供 CLI,采用 MIT 许可并已发布到 PyPI。示例中作者让 Gemma 4 调用 scikit-learn,在 Iris 玩具数据集上创建随机森林分类器。作者认为相比让智能体直接写代码,这种反射方式更形式化、更易验证,并询问是否已有类似方案。

正文

Hi! I wrote a small library called Integrum that allows you to quickly create MCP server(s) from existing Python libraries or modules. It has a CLI so it is really easy to use (I hope!).

It is open-source (MIT) and on PyPI, so sharing it here if somebody finds it useful.

Code: https://github.com/alphadeepai/integrum

Blog post: https://nmilosev.svbtle.com/integrum-reflection-based-mcp-server-from-any-python-module-or-library

As an example I gave Gemma 4 access to scikit-learn and told it to create a RF classifier for a toy dataset (Iris) and it did it rather well! Here is that example session..

Obviously an interesting discussion is this approach vs. just letting the agents write code: I think this approach is more formal and therefore easier to verify.

I haven't found any other reflection based approaches like this, let me know if I missed some.

submitted by /u/nmilosev
[link] [留言]

来源:r/MachineLearning · reddit.com