flutter3d_model_mcp library
A model editor offered to an agent, over the Model Context Protocol.
The same commands a person uses, offered as tools. Every command tool
here is a ModelCommand from flutter3d_model_core — the values the
modeller application's own toolbar and keyboard go through — so an edit
made by an agent and an edit made by a hand take one route into the
project, get one name in the history, and come back out under the same
undo.
Beyond the commands, ModelSession adds the verbs a screen would
otherwise supply: ModelSession.listing and ModelSession.select,
because a program with no screen cannot point at anything; check, save,
export and import, because a project has a life outside the commands
that shape it; journal, because doc-16's CommandJournal is worth
writing to disk from the one place that already runs every command; and
mcp-09n's own composite recipes — cleanup, buildFrom and
inspect — because an agent assembling one out of the commands above
by hand is slow, expensive, and leaves a whole batch of edits as many
undo steps instead of one.
What it is not
Not a connection to a running editor. The server owns one project for
the life of one process, started by dart run. This is the half that can
be tested without a device: deterministic text out, and a suite that
drives the real protocol over a pair of streams in memory.
It does draw, though nothing else here answers with a picture.
render (mcp-06n) and renderSheet (mcp-07n, a 2×2 contact sheet of
four views) are the two tools built on flutter3d_cpu's own CpuDevice
— no GPU, no display, and, since flutter3d_conformance and
flutter3d_shaders stopped carrying the Flutter SDK in behind it, no cost
to dart run's own ability to start this server with no Flutter tool on
the machine at all. See render_tool.dart's own doc comment for why
every other tool still answers with no png rather than every tool body
here having grown one.
dart run flutter3d_model_mcp:model_mcp my-model.f3dproj
Classes
- ModelHttpServer
-
A ModelMcpServer listening on
127.0.0.1, for ModelHttpServer.start. - ModelMcpServer
- A model project, offered to an agent as a table of tools.
- ModelSession
- One model project, open, with the editor's own verbs on it.
Constants
-
describableFamilies
→ const List<
String> -
The families
describeTypecan be asked about. - modelMcpVersion → const String
- The version this server tells a client it is: the pubspec's.
-
modelPrompts
→ const List<
OfferedPrompt> - The advice, offered to every client that asks for it.
-
renderModes
→ const List<
String> -
Every mode an agent can ask for —
mcp-08n's own four, plusselection, which the row does not count because it is not a shading mode.wireframelanded 2026-09-17 as geometry rather than as a line topology;RenderShading.wireframeandwire_overlay.dartboth say why.
Properties
-
modelTools
→ List<
ModelTool> -
Everything this server offers: every command as a tool, and the verbs
that are about the session rather than about one edit —
listandselect, because a program with no screen cannot point at anything;undo/redo;check,save,exportandimport, because a project has a life outside the commands that shape it;journal, becauseCommandJournalis worth writing from the one place that runs every command already.no setter - renderSheetTool → ModelPictureTool
-
A contact sheet of
renderSheetViews—mcp-07n's own tool. Labelled: each quadrant carries the name of the view it is, drawn withtiny_font.dartrather than a widget, since this runs in a plain Dart process with no canvas in it.final - renderSnapshotTool → ModelPictureTool
-
pro-rn-04: a snapshot at a size and a supersample a person chooses, throughpro-rn-02's own tiled job.final - renderTool → ModelPictureTool
-
A picture of the project as it stands.
final
Functions
-
deleteMcpSessionFile(
File file) → void - Removes the session file writeMcpSessionFile wrote — called once the server it named is no longer listening, so nothing reads a port that has gone stale.
-
describeType(
{required String family, String? kind}) → String -
What
kindtakes, or — with nokind— every kind offamilyat once. -
writeMcpSessionFile(
File file, {required int port, required String token}) → void -
Where an application's own running
LoopbackMcpServercan be found, written beside the application's existing session state.
Typedefs
- Answer = ({bool did, String says})
- What a tool call actually did, and the sentence to say about it.
-
CommandTarget
= ({List<
int> ? elements, String? level, int? object, List<int> ? objects}) -
What a call says it acts on, instead of leaving it to the selection —
ux-20. See ModelSession.targetIn for how it is read out of a call's own arguments, and ModelSession.runOn for what it does. -
ModelPictureTool
= OfferedTool<
ModelSession, PictureAnswer> -
ModelTool
= OfferedTool<
ModelSession, Answer> -
One tool: what an agent is offered, and what calling it does — see
flutter3d_mcp_kit'sOfferedToolfor why a pair rather than a table and a switch.