Provides access to a remote MATLAB service hosted on Render for generating magic squares of specified dimensions
Magic-MCP
Magic square function exposed as MCP server 🪄✨

Getting started
Create a virtual environment and install the dependencies:
python -m venv .venv source .venv/bin/activate pip install -r requirements.txtRun the MCP server:
python server.pyThe server exposes a single tool,
generate_magic_square, which proxies a remote MATLAB service hosted athttps://matlab-0j1h.onrender.com/mymagic/mymagic.Dependencies
This project now uses
requestsandnumpyto call and parse the remote MATLAB service. Ensure those packages are installed (they're included inrequirements.txt). To change the target MATLAB service URL, edit theMATLAB_SERVICE_URLvariable inside thecalculate_magic_matrixtool inserver.py.Connect an MCP-compatible client to the server (for example, via MCP discovery or by pointing the client at the stdio endpoint) and invoke the
generate_magic_squaretool. Provide the desired square size (and optionally setdebug=true) to receive a structured response containing both the magic square and the raw metadata returned by the upstream service.