Integrum

Turn Python libraries into MCP servers with Integrum's reflective approach

Turning Python libraries into MCP servers shouldn't require a rewrite, and Integrum proves it.

3 min readMachine Learning

Integrum's reflective approach to turning Python libraries into MCP servers is a quiet but meaningful step forward for anyone who has felt friction between AI agents and established code. The library, built by developer nmilosev and released under MIT, uses Python's introspection capabilities to expose any module or library as a Model Context Protocol server. That means an agent like Gemma 4 can call scikit-learn's functions directly, rather than generating code that may or may not run correctly. This is not about replacing the agent's ability to write code, it is about giving it a structured, verifiable interface to tools that already work.

The practical consequence for data practitioners is immediate. When you give an agent access to a library through an MCP server, every function call is explicit, every parameter is defined, and the result is deterministic. The agent does not hallucinate a method signature or invent a nonexistent API. This is the same kind of thinking that makes Android Bench 2.0 Measures AI Agents on Complex, Multi-Step Tasks so valuable: benchmarks that require agents to complete real, multi-step workflows reveal where unstructured code generation falls short. Integrum's reflection-based approach offers a complementary path, instead of evaluating the agent's output, you formalize the input it can work with.

What stands out about Integrum is not the novelty of reflection, which Python has supported for decades, but the deliberate choice to build a bridge between that old capability and the new MCP protocol. The library is small, CLI-driven, and intentionally limited in scope. It does not promise to rewrite your workflow. It simply says: here is a way to make your existing Python tools accessible to an AI, and here is why that is easier to verify than letting the agent write its own code. That is a refreshingly honest value proposition in a space where many tools overpromise. It also echoes the philosophy behind Explore a unified vector space for text, code, images, and more, where the goal is to reduce friction between different data modalities rather than replace them with something new.

The open question is whether this approach scales beyond single-library use cases. Integrum works well for exposing a library like scikit-learn, but real-world data pipelines often involve chaining multiple libraries, handling state, and managing errors that reflection alone cannot anticipate. The developer acknowledges this trade-off, noting that the formal interface is easier to verify than generated code, but verification still requires human oversight. The next logical step would be to see how Integrum handles libraries with complex dependencies or mutable state, and whether the reflection-based server can maintain performance under concurrent agent calls. For now, the library is a practical tool worth exploring, especially if you have ever watched an agent write a scikit-learn pipeline that imported a module that did not exist.

From Machine Learning

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.

Read the original at Machine Learning