Skip to main content

Module server_mcp

Module server_mcp 

Source
Expand description

Model Context Protocol server exposed at the /mcp endpoint.

Wraps every Command the crate::background_thread dispatcher understands as an MCP tool, plus a handful of MCP resources (game lists, enum dumps, examples, reference docs) and prompts for common workflows (“open and inspect a pack”, “edit a DB table”, “manage dependencies”, …). Each MCP client gets its own dedicated Session and McpServer — same isolation guarantees as the WebSocket clients.

Each tool call:

  1. Translates its *Args payload into a Command and ships it through the session’s background_loop via the send_and_respond! helper.
  2. Wraps the resulting Response back into a CallToolResult.

The *Args structs are the canonical schema for every tool. Their JsonSchema derive is what rmcp ships to clients to advertise tool arguments, so docstrings on individual fields show up directly in MCP tool listings.

Macros§

parse_json 🔒
Parse a JSON string into the expected type, returning a tool-level error on failure.
send_and_respond 🔒
Helper to send a command and return the JSON response.

Structs§

AddKeysToKeyDeletesArgs
AddNoteArgs
AddPackedFilesArgs
AddPackedFilesFromAnimpackArgs
AddPackedFilesFromPackFileArgs
AddPackedFilesFromPackFileToAnimpackArgs
BoolArg
BuildStarposArgs
CallCommandArgs
CascadeEditionArgs
ChangeCompressionFormatArgs
ContainerPathArg
ContainerPathsArg
CopyOrCutPackedFilesArgs
DecodePackedFileArgs
DefinitionArg
DeleteFromAnimpackArgs
DeleteNoteArgs
DiagnosticsCheckArgs
DiagnosticsUpdateArgs
DuplicatePackedFilesArgs
ExportRigidToGltfArgs
ExtractPackedFilesArgs
GetPackTranslationArgs
GetRFilesFromAllSourcesArgs
GetReferenceDataFromDefinitionArgs
GlobalSearchArgs
GlobalSearchReplaceMatchesArgs
GoToDefinitionArgs
ImportDependenciesArgs
InitializeMyModFolderArgs
McpServer
MCP server bound to a single Session.
MergeFilesArgs
NewPackedFileArgs
OpenPackedFileInExternalProgramArgs
OpenPackfilesArgs
OptimizePackFileArgs
PackKeyArg
PackKeyBoolArg
PackKeyPathArg
PackKeyStringArg
PackKeyStringsArg
PackMapArgs
PastePackedFilesArgs
PathArg
ReferencingColumnsForDefinitionArgs
RenamePackedFilesArgs
SavePackedFileFromExternalViewArgs
SavePackedFileFromViewArgs
SavePackedFilesToPackFileAndCleanArgs
SaveSchemaArgs
SchemaPatchArgs
SearchReferencesArgs
SetDependencyPackFilesListArgs
SetGameSelectedArgs
SetPackFileTypeArgs
SetPackSettingsArgs
SetVideoFormatArgs
SettingsSetBoolArgs
SettingsSetF32Args
SettingsSetI32Args
SettingsSetPathBufArgs
SettingsSetStringArgs
SettingsSetVecRawArgs
SettingsSetVecStringArgs
StringArg
StringI32Args
StringsArg
TsvExportArgs
TsvImportArgs
UpdateAnimIdsArgs

Functions§

resource 🔒
Build an Annotated with common fields set.