mcpopen-sourceai

Unleashing Open Source AI: Using Refact AI to Build a MinIO MCP Server

March 19, 2025

4 min read

Originally published on Medium. Fully implemented version available at mcp.so.

Here’s how you can create your own open-source MCP server using the open-source Refact AI Agent — and what I learned about prompting AI coding agents effectively along the way.

Why MinIO for AI Workflows

Building your own AI workflow always requires a resilient, secure place to store:

  • Input text data, images, documents, videos, etc.
  • Output logs, full prompts, model responses in different formats, generated documents
  • Transient data if you have a chain of AI processes and need to keep it for observability

MinIO is a strong option here — open-source, cloud and on-premise, compatible with AWS S3. You can deploy it on your machine, server, or in the cloud.

Tools Used

  • Refact AI — open-source autonomous AI coding agent
  • MinIO — open-source object storage compatible with AWS S3
  • Model Context Protocol — open standard for connecting data sources to AI-powered tools

The Goal

Usage of MinIO in AI pipelines often requires developing custom code interfaces and wrappers to integrate it with other components of your AI workflow.

An MCP server provides a powerful capability: you can integrate it directly into your agent client and leverage it in prompts. With MCP, AI models can access your data storage without requiring complex custom integrations.

The goal was to implement a MinIO MCP server I could use for AI agent implementations, providing a seamless connection between my AI tools and data storage.

How to Work with AI Coding Agents

I went with Refact AI since the agent can reduce time not only for implementation, but also testing — you can integrate your new MCP directly into Refact AI.

If you’re new to AI coding agents, here’s the right mental model: imagine you’re working with a junior/mid-level software engineer who can code, but needs supervision.

  • You can’t delegate large-scale implementation by asking “implement another dog-dating app” — nobody will understand you, neither an AI agent nor a person
  • You must review the code
  • You must test that the result is compliant with functional requirements
  • You must test non-functional requirements (this is something I’m not sure is yet possible with AI agents)

With that in mind, as with any software development task:

  1. Split your ultimate goal into smaller parts
  2. Provide requirements and expectations for each task

Three Attempts

Refact AI solved my request in 3 attempts (one attempt = one chat session).

Attempt 1 — One-shot. Failed.

Too vague:

My goal is to generate a model-context protocol (MCP) for minio.
Generate me all needed files for minio-mcp.
use as a reference: https://modelcontextprotocol.io/introduction

Attempt 2 — Few-shots. Failed.

More references, but insufficient expectations. The code was generated and probably working, but a brief review showed it wasn’t implemented the way I needed:

My goal is to generate a model-context protocol (MCP) for minio.
Generate me all needed files for minio-mcp.
use as a reference https://github.com/aws-samples/sample-mcp-server-s3
reference mcp server and client. go to inner folders and use all files under
make sure to use latest minio python client https://github.com/minio/minio-py

Attempt 3 — Few-shots + constraints + clear expectations. Success.

This produced working code with minimal changes needed:

My goal is to generate a model-context protocol (MCP) for minio.
Generate me all needed files for minio-mcp.
1. use as a reference https://github.com/aws-samples/sample-mcp-server-s3
   reference mcp server and client.
2. go to inner folders and use all files under these folders:
   https://github.com/aws-samples/sample-mcp-server-s3/tree/main/src/s3_mcp_server
3. use server reference:
   https://github.com/aws-samples/sample-mcp-server-s3/blob/main/src/s3_mcp_server/server.py
4. use client reference:
   https://github.com/aws-samples/sample-mcp-server-s3/blob/main/src/client.py
5. make sure to use latest minio python client https://github.com/minio/minio-py
6. generate all files in the same way as it is in reference repository,
   also generate project toml, env.example, requirements.txt, etc
7. apply all changes once completed

The key difference: specific file paths from the reference repository and clear, numbered steps.

Testing and Results

Code review, integration, and testing still took some time — but implementation time was reduced by ~90%. Code was generated within minutes and was functional.

I tested the MinIO MCP server with 4 clients:

  1. Refact AI — integrates any MCP server directly into your agent
  2. Claude Desktop — native MCP integration
  3. Python Client with Anthropic chatbot
  4. Stdio client implemented using Refact AI Agent

For MCP client configuration details, see the MCP quickstart and Refact AI docs.

Lessons Learned

  1. Coding with an AI agent saves significant time, but you need to know what you want. Being specific with file paths, references, and exact requirements produces the best results.
  2. MCP servers are difficult to debug. Be prepared for minimal logs when issues arise — it’s worth building extra observability from the start.
  3. MCP integration has tremendous potential. You can create chains of MCP servers and control your agents’ work through prompts with minimal code.
  4. Open source + AI agents is a powerful combination. Leveraging open-source AI tools to build new open-source projects takes collaboration to a new level.

The combination of open-source storage and AI tools opens up powerful possibilities for creating secure, flexible AI workflows with complete data sovereignty.