MIDIFabric’s effects are Lua programs. We wanted users to describe an effect to an AI tool they already use and have it write the code. We chose MCP to connect those tools to MIDIFabric.
Why MCP
We considered three ways to connect an AI tool:
- Call an AI service’s API from MIDIFabric. This requires an API key and separate API billing, even if the user already has a subscription to an AI client.
- Run an AI command-line tool (such as
codex execorclaude -p) from MIDIFabric. We could not determine whether the services’ terms allow this use, so we did not adopt it. We are not claiming that it is prohibited. - Run an MCP server. MCP (Model Context Protocol) lets an AI client that the user starts, such as Codex or Claude Code, call tools provided by MIDIFabric. MIDIFabric does not start the AI client or access its account credentials.
We chose the third. MIDIFabric runs a small MCP server, and you connect your own AI tool to it.
The connection stays inside the Mac
The MCP connection described here is for Mac and has been tested with Codex and Claude Code.
- The server listens only on
127.0.0.1, the Mac’s own loopback address. Nothing on your network can reach it. - It is off until you turn it on in Settings > AI. The default port is 8765; you can change it while the server is stopped.
- Every request must carry an access token: 256 random bits, created once and kept until you regenerate it. The token is compared in constant time.
- Requests with an
Originheader are rejected, because no browser should ever talk to this server. TheHostheader must match exactly. Requests over 4 MiB are rejected. - All of these checks happen before the request is parsed.
MIDIFabric can copy a Codex configuration or a Claude Code registration command, each containing the server address and access token. You paste it into your AI client; MIDIFabric does not edit the client’s settings.
Why plain http on localhost
Traffic on the loopback address never leaves the Mac. A program that could read that traffic could also read the token from the configuration file or from memory, so encryption would not protect anything more. HTTPS would also need a self-signed certificate that each AI tool has to be told to trust, which would turn “paste this command” into a much longer setup.
What the token does and does not protect
The token stops apps that do not have it from using the server. It does not stop an app running as the same user that can read your AI tool’s configuration file, the clipboard or memory, and it does not identify which program is calling; another client with the right token can connect. The app warns that the copied configuration contains the token and should not be shared.
What the AI can and cannot do
The server offers twelve tools. With them, the AI can:
- read MIDIFabric’s authoring guides and the bundled effect templates,
- check an effect it has written (compile and initialize it, without playing any MIDI),
- submit a new effect or a revision of an existing one,
- list your registered effects and read one in full, including its Lua code,
- only if you allow it in Settings > AI, read the MIDI records the monitor is holding and the applied routing setup. Monitor and routing are allowed separately, and both are off by default.
The monitor records include SysEx and device and port names. The routing setup includes connections, route and effect names, bypass states and the effects’ current parameter values. The AI cannot read unapplied edits, audio, logs or other files. Even when allowed, it only reads: it cannot change routing, send notes or SysEx, or run commands. Turning a permission off does not recall what the AI has already received.
What the AI reads goes to the AI company under your own account and its terms. Your prompt goes straight from you to your AI tool; it never passes through MIDIFabric. Whenever we expand what AI tools can read, we update the in-app description, the manual and the privacy policy in the same change.
From submission to registration
When the AI submits an effect, MIDIFabric checks it and keeps the latest candidate in memory. By default you open it in the editor and press Apply. You can turn on automatic registration in Settings > AI, but it applies only to submissions made after you turn it on, and it goes through the same checks and Apply as a manual registration. Placing the effect on a route is always your own action.
The check compiles and initializes the effect. To check its musical behavior, you still need to place it on a route and play it.
The full list of what AI tools can read is in MIDIFabric’s privacy policy.