flutter3d_mcp library
Every library of flutter3d_mcp, in one import: the kit every server is built on, the project server's tools, and the level and model editors' servers.
A program that runs one server imports that one: kit.dart,
project_tools.dart, editor.dart or model.dart.
Classes
- Answer
- What a tool call actually did, and the sentence to say about it.
-
AnsweredCall<
A> - One call a ToolTableServer answered, as a watcher is told of it: ToolTableServer.onCall with the server's own answer type, ToolTableServer.onProjectCall with a project tool's ToolResult.
- CommandTarget
-
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. - DepthSpan
- How far in front of the eye something reaches, nearest and farthest.
- EditorMcpServer
- A level editor, offered to an agent as a table of tools.
- EditorSession
- One level document, open, with the editor's own verbs on it.
- LevelCamera
- Where a picture of the level is taken from: the eye, and the point it looks at.
- LevelView
-
The level as the software rasteriser draws it, and what an agent can learn
from the drawing —
screenshotandreport. - LoopbackMcpServer
-
A server listening on
127.0.0.1. - McpToolRegistry
-
MCP tools, merged into the project's servers as
<namespace>.<tool>: the slot McpTools fills,host.registry<McpTools>(). - McpTools
- The McpToolRegistry a project fills: the MCP tools its plugins bring, each under the plugin's namespace.
- 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.
- OfferedPrompt
-
One prompt: what
prompts/listoffers, and the textprompts/gethands back —ux-44. -
OfferedTool<
S, A> - One tool: what an agent is offered, and what calling it does to the session.
- PieceCover
- One piece in front of another, and how much of the other it hides.
- PieceReport
- What one piece of the level looks like from a camera.
- PixelBox
- A box of whole pixels on the frame, from the top left, every edge inclusive.
- PlaySession
-
HR5for an agent: the game the open level belongs to, run, reloaded, stopped and sent the level when it is saved — the editor application's Play, through the sameFlutterRun. - ProjectMcpServer
- A server offering a project's McpTools and nothing else.
- ProjectRoot
- The directory a server's file tools are held to, and the one place a path an agent sent becomes a path on the disk.
- ProjectTool
- One tool a plugin, or the application, added to a project's McpTools.
- ResolvedPath
- What ProjectRoot.tryResolve answers: the resolved path inside the root, or the sentence that refuses it. Exactly one of the two is set.
-
SessionToolCall<
S> - One call of a server's own tool: a ToolCall with the session the server runs it against.
- ToolAudio
-
A sound a tool answers with: the encoded bytes and their media type
(
audio/wav,audio/ogg). - ToolCall
- One call of a project tool: what an agent passed, under the name it called.
- ToolContent
- One piece of what a tool answers: words, a picture, a sound, a resource or a link to one, as the protocol's content objects say them.
- ToolHints
- What a tool does to the world it is called on, as the protocol's annotations say it to a host — which may ask a person before a destructive call, and may call a read-only one without asking.
- ToolImage
- A picture a tool answers with: the encoded bytes and their media type.
- ToolName
-
The name a tool is published under,
area.verb, and what it does to the world it is called on. - ToolOtherContent
- Content of a kind this build has no class for, kept as the JSON it came as and written back unchanged.
- ToolResource
- A resource carried inside the answer: its uri, and its contents as text or as bytes (blob).
- ToolResourceLink
- A link to a resource the client may read, rather than its contents.
- ToolResult
-
What a tool call answers: content for a model to read, and the
machine-readable structuredContent when the tool declares an
outputSchema. - ToolSpec
-
One tool, as
tools/listoffers it: a name, a sentence, the JSON Schema of its arguments, the JSON Schema of thestructuredContentit answers with when it answers one, and its ToolHints. -
ToolTableServer<
S, A> - A server offering tools over one session, every answer turned into a result by toResult.
- ToolText
- Words a tool answers with.
Constants
-
buildTargets
→ const Set<
String> -
What
flutter buildis asked to make, by the word an agent gives it. -
describableFamilies
→ const List<
String> -
The families
describeTypecan be asked about. -
editorAnswerSchema
→ const Map<
String, Object?> -
The shape of every editor tool's
structuredContent, as theoutputSchemaeach tool declares: whether the call did what it was asked (did, false for a refusal), its sentence, the selection after it in the wordslevel.listuses, and whether a picture came with it. - editorMcpSchemaVersion → const String
-
The version of this server's tools — names and input schemas — as the
initializeresult announces it beside editorMcpVersion. - editorMcpVersion → const String
- The version this server tells a client it is: the pubspec's.
-
editorToolNames
→ const Map<
String, ToolName> -
What each of editorTools is published as,
area.verb, and what it does to the document. The name a tool is written under — the editor command's own word, whichEditorCommand.fromJsonreads — stays answerable as an alias until 2.0. -
modelAnswerSchema
→ const Map<
String, Object?> -
The shape of every model tool's
structuredContent— whatModelSession.structuredwrites — as theoutputSchemaeach tool declares. - modelMcpSchemaVersion → const String
-
The version of this server's tools — names and input schemas — as the
initializeresult announces it beside modelMcpVersion. - modelMcpUsage → const String
-
What
model_mcpprints for--helpand for a wrong argument count. - 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.
-
modelToolNames
→ const Map<
String, ToolName> -
What each of the modeller's tools is published as,
area.verb, and what it does to the project. The written name — the model command's own word, whichhistory.batchand the command journal still use — stays an alias until 2.0. - projectMcpSchemaVersion → const String
- The version of ProjectMcpServer's own tools, of which there are none.
- projectMcpVersion → const String
- The version ProjectMcpServer tells a client it is: the pubspec's.
-
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. - schemaToolName → const String
- The name of the tool every server offers to say what schema versions it speaks.
- schemaVersionMetaKey → const String
-
The
_metakey a server's tools, and itsinitializeresult, carry their schema version under.
Properties
- auditTool → ModelPictureTool
-
audit:AssetAuditin words and the asset from all seven views in one picture, withrepairto put right what has one right answer.final -
editorTools
→ List<
EditorTool> -
Everything this server offers: the ten commands, the six verbs that are
about the session rather than about the document, and the two that look
at it —
view.screenshotandview.report.no setter -
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
-
commandInputSchema(
PluginCommandInfo command) → Map< String, Object?> -
command's arguments as a tool's input schema: an object with one property per argument hint, each required when it has no default. -
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. -
pictureResultOf(
Answer answer) → ToolResult -
answeras a tool result: the sentence, then the PNG when there is one. -
refuseArguments(
ToolSpec tool, Map< String, Object?> arguments) → String? -
Why
argumentsare not a call totool, or null when they are. -
resultOf(
Answer answer) → ToolResult -
answeras a tool result: the sentence, marked as an error when it is a refusal. -
serveEditorMcp(
List< String> arguments, {List<Flutter3dPlugin> plugins = const <Flutter3dPlugin>[]}) → EditorMcpServer -
Opens the level
argumentsnames and serves it over stdio, offering the MCP toolspluginsbring beside the editor's own. -
serveModelMcp(
List< String> arguments, {McpTools? projectTools}) → ModelMcpServer? -
Opens the project
argumentsnames and serves it over stdio, offeringprojectToolsbeside the modeller's own. -
Offers every command the plugins added to
piecesas a tool oftools,<namespace>.<name>, that runs it onsession's document; keeps the offer in step while plugins are switched on and off, until the registration it returns is cancelled. -
writeMcpSessionFile(
File file, {required int port, required String token}) → void - Where an application's own running LoopbackMcpServer can be found, written beside the application's existing session state.
Typedefs
-
EditorTool
= OfferedTool<
EditorSession, Answer> -
One tool: what an agent is offered, and what calling it does to the
document — see
flutter3d_mcp/kit.dart's OfferedTool for why a pair rather than a table and a switch. -
GameAsk
= Future<
GameExtensionReply> Function(String vmService, String method, {Map<String, String> args}) -
Asks a running game for one of its
ext.flutter3d.*extensions — seecallGameExtension, which is what a session asks with unless a test hands in its own. -
ModelPictureTool
= OfferedTool<
ModelSession, Answer> - A modeller tool that may answer with a picture: a body over the ModelSession that answers an Answer.
-
ModelTool
= OfferedTool<
ModelSession, Answer> -
One tool: what an agent is offered, and what calling it does — see
flutter3d_mcp/kit.dart's OfferedTool for why a pair rather than a table and a switch. - NewRun = FlutterRun Function(String projectRoot, String? device)
-
Makes a run of
projectRootondevice. A parameter of PlaySession so a test hands it a run over a tool of its own making. -
ProjectToolRun
= FutureOr<
ToolResult> Function(ToolCall call) - What calling a project tool does: one ToolCall in, a result out.
-
RunFlutterIn
= Future<
ProcessResult> Function(List<String> arguments, String workingDirectory) -
Runs
flutterwithargumentsinworkingDirectoryto the end — what PlaySession.build builds with. A parameter so a test answers for the tool.
Exceptions / Errors
- PathOutsideRootException
- A path a file tool was handed that lies outside its ProjectRoot.