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
requests
andnumpy
to 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_URL
variable inside thecalculate_magic_matrix
tool 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_square
tool. 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.
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Enables generation of magic squares by exposing a single tool that connects to a remote MATLAB service. Users can specify the desired square size and receive structured magic square data with metadata.