Repository avatar
Other Tools
v1.2.0
active

dalamudmcp

io.github.getsetmind/dalamudmcp

Observe a local FFXIV session through Dalamud and run explicitly enabled game actions.

Documentation

DalamudMCP: FFXIV MCP Server for Dalamud

DalamudMCP is a Windows-local Model Context Protocol (MCP) server and Dalamud plugin for Final Fantasy XIV (FFXIV / FF14). It connects MCP-compatible AI clients and a command-line interface to a running game session through a current-user-only local bridge.

日本語: セットアップガイド

[!IMPORTANT] DalamudMCP requires Windows, Final Fantasy XIV, and Dalamud. Observation tools are enabled by default, while actions and unsafe integrations require explicit opt-in from the plugin UI.

Requirements

  • Windows with Final Fantasy XIV running through XIVLauncher and Dalamud
  • .NET SDK 10.0.201 or a later 10.0 feature band for building and running the CLI from source (pinned in global.json; the build scripts prefer a repository-local .dotnet\dotnet.exe when present)
  • a local Dalamud development installation for building the plugin

Quick Start

Build the plugin and CLI:

.\build\restore.ps1
.\build\build.ps1 -NoRestore

Load src/DalamudMCP.Plugin/bin/Debug/DalamudMCP.dll as a development plugin, then start the stdio MCP server:

dotnet run --project .\src\DalamudMCP.Cli\DalamudMCP.Cli.csproj -- serve mcp

After version 1.2.0 is available on NuGet.org, the CLI can also be run without a permanent installation:

dnx DalamudMCP.Cli@1.2.0 --yes serve mcp

For plugin loading, HTTP transport, security settings, and release packaging, see Install And Run.

How It Works

The current codebase is built around:

  • one handwritten operation file per tool
  • the same operation definition drives both CLI and MCP
  • the plugin owns live game execution
  • the CLI and MCP layers talk to the plugin over a local named pipe

What You Get

  • direct CLI commands such as player context and inventory summary
  • MCP over stdio with serve mcp
  • MCP over bearer-authenticated local HTTP with serve http
  • plugin auto-discovery so normal CLI usage does not need a manual pipe name
  • a plugin settings window that shows runtime health and can start the bundled HTTP server
  • generic game action execution, Lumina Excel exploration, and plugin lifecycle/package management
  • tracked navigation and bounded multi-step operation jobs that report progress instead of blocking one long call
  • pre-login session observation and native addon control inspection for the title screen, character selection, and dialogs
  • combat, job gauge, gearset, world, and ImGui window snapshots
  • a plugin developer loop: dev plugin registration, build MVID checks, dalamud.log reading, and render capture without bringing the game to the foreground
  • plugin integration through convention-based IPC calls and buffered data relay channels

Safety Defaults

DalamudMCP is observation-first, but it can expose broad mutation capabilities when the user enables them.

  • observation tools are enabled by default
  • action tools are default-off until you enable them in the plugin UI
  • unsafe integration tools are default-off and hidden behind a separate developer toggle
  • an explicit capability policy overrides the legacy toggles and is enforced again for every invocation
  • confirm-once policies show the exact arguments in the plugin UI and consume approval after one matching retry
  • policies can constrain plugin names, action IDs, jobs, territories, sheets, callgates, targets, result counts, and calls per minute
  • denied capabilities are omitted from tools/list
  • only one mutation runs at a time: a concurrent mutation, including one issued while an operation job owns execution, returns operation_busy; while a tracked move is active, other mutations except navigation.stop, jobs.cancel, captures, and events.configure return navigation_busy

This is intentional. The public surface should stay conservative unless you explicitly widen it.

Current Tool Surface

The table below is generated from the operation attributes in src/DalamudMCP.Plugin/Operations. Run ./build/update-tools.ps1 after adding or renaming a tool; CI checks the generated block with ./build/update-tools.ps1 -Check.

MCP toolOperation IDSource
cancel_operation_jobjobs.cancelJobOperations.cs
capture_game_rendergame.captureNativeCaptureOperation.cs
capture_game_screenshotgame.screenshotGameScreenshotOperation.cs
equip_gearsetgearsets.equipGearsetEquipOperation.cs
events_configureevents.configureGameEventOperations.cs
events_queryevents.queryGameEventOperations.cs
events_waitevents.waitGameEventOperations.cs
game_action_executegame.action.executeGameActionExecuteOperation.cs
game_action_resolvegame.action.resolveGameActionResolveOperation.cs
game_data_describe_sheetgame-data.describe-sheetGameDataOperations.cs
game_data_get_rowgame-data.get-rowGameDataOperations.cs
game_data_list_sheetsgame-data.list-sheetsGameDataOperations.cs
game_data_searchgame-data.searchGameDataOperations.cs
get_addon_listaddon.listAddonListOperation.cs
get_addon_stringsaddon.stringsAddonStringsOperation.cs
get_addon_treeaddon.treeAddonTreeOperation.cs
get_available_questsquest.availableAvailableQuestsOperation.cs
get_chat_logchat.readChatLogReadOperation.cs
get_combat_snapshotcombat.snapshotCombatSnapshotOperation.cs
get_condition_contextcondition.contextObservationOperations.cs
get_current_quest_objectivequest.current-objectiveCurrentQuestObjectiveOperation.cs
get_dalamud_logplugin.inspect.logDalamudLogOperation.cs
get_dev_plugin_stateplugin.inspect.buildPluginBuildOperations.cs
get_duty_contextduty.contextDutyContextOperation.cs
get_fate_contextfate.contextFateContextOperation.cs
get_gearsetsgearsets.listGearsetsOperation.cs
get_inventory_currenciesinventory.currenciesObservationOperations.cs
get_inventory_equipmentinventory.equipmentObservationOperations.cs
get_inventory_itemsinventory.itemsObservationOperations.cs
get_inventory_summaryinventory.summaryInventorySummaryOperation.cs
get_job_gaugecombat.gaugeJobGaugeOperation.cs
get_nearby_interactablesnearby.interactablesNearbyInteractablesOperation.cs
get_operation_jobjobs.statusJobOperations.cs
get_party_contextparty.contextObservationOperations.cs
get_player_contextplayer.contextPlayerContextOperation.cs
get_quest_statusquest.statusQuestStatusOperation.cs
get_runtime_infoplugin.inspect.runtimeRuntimeInfoOperation.cs
get_session_statesession.stateSessionStateOperation.cs
get_session_statussession.statusSessionStatusOperation.cs
get_target_contexttarget.contextObservationOperations.cs
get_world_snapshotworld.snapshotWorldSnapshotOperation.cs
imgui_windowsimgui.windowsImGuiWindowsOperation.cs
interact_with_targetinteract.with.targetInteractWithTargetOperation.cs
invoke_plugin_ipcplugin.ipcSafeInvokePluginIpcOperation.cs
list_addon_elementsaddon.controlsAddonControlOperations.cs
list_plugin_commandscommand.listCommandListOperation.cs
move_to_entitymove.to.entityMoveToEntityOperation.cs
move_to_nearby_interactablemove.to.nearby.interactableMoveToNearbyInteractableOperation.cs
navigation_startnavigation.startNavigationOperations.cs
navigation_statusnavigation.statusNavigationOperations.cs
navigation_stopnavigation.stopNavigationOperations.cs
navigation_waitnavigation.waitNavigationOperations.cs
operate_addon_controladdon.controlAddonControlOperations.cs
plugin_data_pollplugin.data.pollPluginDataPollOperation.cs
plugin_data_subscribeplugin.data.subscribePluginDataSubscribeOperation.cs
plugin_data_unsubscribeplugin.data.unsubscribePluginDataUnsubscribeOperation.cs
plugin_describeplugin.inspect.describePluginManagementOperations.cs
plugin_lifecycleplugin.lifecycle.controlPluginManagementOperations.cs
plugin_listplugin.inspect.listPluginManagementOperations.cs
plugin_packageplugin.package.controlPluginManagementOperations.cs
register_dev_pluginplugin.lifecycle.register-devRegisterDevPluginOperation.cs
reload_pluginplugin.reloadPluginReloadOperation.cs
select_addon_menu_itemaddon.select.menu-itemAddonSelectMenuItemOperation.cs
send_addon_callback_valuesaddon.callback.valuesAddonCallbackValuesOperation.cs
send_addon_eventaddon.eventAddonEventOperation.cs
send_addon_inputaddon.inputAddonInputOperation.cs
slash_commandcommand.slashSlashCommandOperation.cs
start_operation_jobjobs.startJobOperations.cs
target_objecttarget.objectTargetObjectOperation.cs
teleport_to_aetheryteteleport.to.aetheryteTeleportToAetheryteOperation.cs
unsafe_invoke_plugin_ipcunsafe.invoke.plugin-ipcUnsafeInvokePluginIpcOperation.cs
use_duty_actionduty.actionDutyActionOperation.cs
wait_for_dev_pluginplugin.inspect.wait-buildPluginBuildOperations.cs
wait_operation_jobjobs.waitJobOperations.cs

The generic Excel search is bounded to 100 returned rows, 10,000 scanned rows, and 500 ms per call. Plugin package operations only select manifests already present in Dalamud's configured repositories; the MCP request cannot supply an arbitrary download URL or CLR method name.

Manifold remains at 1.0.0 because it owns the operation and CLI layer, not MCP version negotiation. The MCP-facing layer uses the official C# SDK 2.1.0 and adds transport-independent effect, permission, schema, and execution metadata to the internal protocol descriptor.

The handwritten truth source for these operations lives under src/DalamudMCP.Plugin/Operations.

Install And Run

1. Build

.\build\restore.ps1
.\build\build.ps1 -NoRestore

If Dalamud is not installed in the default developer path, set DALAMUD_HOME or pass -DalamudHome to the build scripts.

$env:DALAMUD_HOME = 'C:\path\to\Hooks\dev'
.\build\build.ps1 -NoRestore -DalamudHome $env:DALAMUD_HOME

2. Install The Plugin

The active plugin is:

Build output:

Load that plugin in Dalamud, then open its configuration window.

3. Try The CLI

dotnet run --project .\src\DalamudMCP.Cli\DalamudMCP.Cli.csproj -- player context
dotnet run --project .\src\DalamudMCP.Cli\DalamudMCP.Cli.csproj -- session status --json
dotnet run --project .\src\DalamudMCP.Cli\DalamudMCP.Cli.csproj -- inventory summary
dotnet run --project .\src\DalamudMCP.Cli\DalamudMCP.Cli.csproj -- session state
dotnet run --project .\src\DalamudMCP.Cli\DalamudMCP.Cli.csproj -- chat read --channels Say,Party --max-count 10

If the system dotnet is older than the SDK pinned in global.json, run the same commands with .\.dotnet\dotnet.exe.

chat read returns a next cursor. Pass it back with --after-cursor to read only newer entries; the dropped count and truncated flag report entries that left the buffer before they were read.

Normal CLI use auto-discovers the active plugin instance from active-instance.json.

--pipe <name> is still supported as an advanced override for debugging or multi-instance scenarios.

Self-update and self-uninstall require the external supervisor so the verification process survives the plugin stopping or restarting:

dotnet run --project .\src\DalamudMCP.Cli\DalamudMCP.Cli.csproj -- supervise self-package --action update --timeout-seconds 90
dotnet run --project .\src\DalamudMCP.Cli\DalamudMCP.Cli.csproj -- supervise self-package --action uninstall --timeout-seconds 90

The plugin.self.manage capability must be explicitly confirmed or allowed before either command can proceed.

4. Run MCP

stdio MCP:

dotnet run --project .\src\DalamudMCP.Cli\DalamudMCP.Cli.csproj -- serve mcp

Once version 1.2.0 is available on NuGet.org, the equivalent package command is:

dnx DalamudMCP.Cli@1.2.0 --yes serve mcp

The NuGet package contains the CLI and MCP server only. The Dalamud plugin must still be built, loaded, and running in the local FFXIV session.

Local HTTP MCP:

$env:DALAMUD_MCP_HTTP_TOKEN = '<token>'
dotnet run --project .\src\DalamudMCP.Cli\DalamudMCP.Cli.csproj -- serve http --port 38473

Default endpoint:

  • http://127.0.0.1:38473/mcp

The plugin UI can also start and stop the bundled HTTP MCP server for you. It generates a 256-bit bearer token, passes it to the child process without putting it on the command line, and provides separate buttons for copying the endpoint and token. HTTP clients must send Authorization: Bearer <token>.

The HTTP server binds only to 127.0.0.1, rejects non-loopback Origin values, and delegates MCP version negotiation to the official C# SDK transport. The named-pipe bridge is current-user-only and rejects frames larger than 16 MiB.

See design/capability-kernel.md for capability policy configuration and the current limits of the implementation.

5. Build A Release Package

Build the plugin in Release and package the plugin output directory manually.

.\.dotnet\dotnet.exe build .\src\DalamudMCP.Plugin\DalamudMCP.Plugin.csproj -c Release

If you need a custom Dalamud path:

$env:DALAMUD_HOME = 'C:\path\to\Hooks\dev'
.\.dotnet\dotnet.exe build .\src\DalamudMCP.Plugin\DalamudMCP.Plugin.csproj -c Release

The packaged output is written under src/DalamudMCP.Plugin/bin/Release/DalamudMCP/. Upload the generated latest.zip manually when cutting a release.

Optional Integrations

When compatible plugins are installed, DalamudMCP can use them behind existing high-level tools.

  • teleport.to.aetheryte can fall back to Lifestream for local aethernet travel
  • navigation.*, move.to.entity, and move.to.nearby.interactable use vnavmesh through one tracked navigation service

These integrations stay behind normal high-level tools by default. Raw integration escape hatches remain developer-only.

Pre-Login Observation And Control

session state / get_session_state works without a local player. It reports title, title-movie, character-select, connecting, login-wait, loading, in-world, world-not-ready, or unknown, with the visible addon evidence and dialog addon names. unknown is not proof that the game is logged out. Login dialogs should be inspected even when an underlying screen is still visible.

Use addon controls --addon _TitleMenu to obtain the current GAME START button reference, then addon control --addon _TitleMenu --reference <reference> --action click. Observe session state again before the next action. The same native control inspection is available in character selection and confirmation dialogs. References expire across addon lifecycles; do not reuse an old reference or infer success from dispatch alone. Closing a movie's overlay is not proof that the movie ended.

This operates through Dalamud native addon APIs, not OS keyboard/mouse automation. It does not enter launcher credentials or bypass login queues.

Long-Running Operations

Navigation

navigation start --x <x> --y <y> --z <z> returns an operation ID as soon as vnavmesh accepts the request. Acceptance is not arrival. Use navigation wait --operation-id <id> (up to 30 seconds per call), navigation status, and navigation stop --operation-id <id> with that ID.

  • terminal states include arrived, stopped_before_destination, cancelled, timed_out, failed, territory_changed, and logged_out
  • a wait timeout does not cancel movement; only the operation deadline (--timeout-seconds, up to 600) or an explicit stop does
  • stopping and stop_unconfirmed mean the stop has not been observed yet; check again before issuing another mutation

Operation Jobs

jobs start --steps-json <json> runs 1 to 32 explicit steps in order, within a deadline of up to 600 seconds. Each step is authorized like a normal call. Arguments use request property names in camelCase, and navigation.wait / navigation.stop steps use "operationId": "$navigation" to refer to the move started earlier in the same job. A job cannot wait for or stop navigation it did not start.

[
  { "operation": "navigation.start", "arguments": { "x": 10.5, "y": 0, "z": -32.1 } },
  { "operation": "navigation.wait", "arguments": { "operationId": "$navigation", "timeoutMilliseconds": 30000 } },
  { "operation": "interact.with.target" }
]

Use jobs wait, jobs status, and jobs cancel with the returned job ID. A job owns mutation execution until it finishes, so other mutations return operation_busy; reads and jobs cancel stay available. Cancellation also stops navigation that the job owns. Jobs are session-local and are not resumed after a plugin reload. Only observation, addon, navigation, targeting, action, and event steps are accepted.

Plugin Developer Workflow

register_dev_plugin and capture_game_render are developer-only and default-off. The build and log inspection tools are read-only.

  1. plugin register-dev --plugin-name <InternalName> --dll-path <absolute dll> --expected-sha256 <sha256> registers a reviewed local build for the current session. It does not load the plugin or change Dalamud's startup locations. --dry-run validates the manifest, API level, and hash only.
  2. plugin build --plugin-name <InternalName> compares the loaded assembly MVID with the DLL on disk.
  3. plugin wait-build --plugin-name <InternalName> --expected-mvid <mvid> waits until the plugin is loaded and both memory and disk match the expected MVID. This does not prove that all of the plugin's services are ready.
  4. get_dalamud_log reads a bounded tail of dalamud.log, filtered by plugin name, and continues from a cursor. Lines mentioning credentials are omitted.
  5. capture_game_render captures the render viewport without bringing the game to the foreground. Pass the returned capture ID again to crop the cached image without taking a new frame.

Integrating Your Plugin

Other Dalamud plugins can expose functions and push data to MCP clients without referencing DalamudMCP. invoke_plugin_ipc and the plugin_data_* tools are developer-only and default-off.

IPC calls (invoke_plugin_ipc)

Register a call gate named {InternalName}.MCP.{Method}. Arguments are passed from a JSON array: booleans, integers, doubles, and strings map to bool, int, double, and string, and JSON objects or arrays are passed as JSON strings. DalamudMCP subscribes with those argument types and an object return type, so declaring the provider the same way avoids IPC type conversion. The return value is serialized to JSON.

pluginInterface.GetIpcProvider<string, int, object>("MyPlugin.MCP.Echo")
    .RegisterFunc((text, count) => string.Concat(Enumerable.Repeat(text, count)));

The MCP call is invoke_plugin_ipc with plugin-name = MyPlugin, method = Echo, and arguments-json = ["hi", 2]. The result status is ipc_success, ipc_missing, ipc_not_ready, ipc_type_mismatch, or ipc_plugin_error.

Data relay (plugin_data_*)

After an MCP client calls plugin_data_subscribe with plugin-name = MyPlugin and channel = status, DalamudMCP registers the action call gate DalamudMCP.Relay.MyPlugin.status. The target plugin pushes JSON strings to it:

var relay = pluginInterface.GetIpcSubscriber<string, object>("DalamudMCP.Relay.MyPlugin.status");
if (relay.HasAction)
    relay.InvokeAction(JsonSerializer.Serialize(new { hp = 1234 }));

plugin_data_poll removes up to max-items buffered items and keeps the rest for the next poll. When capacity is exceeded, the oldest items are dropped. plugin_data_unsubscribe unregisters the call gate and releases the buffer.

Build And Test

GitHub Actions CI validates the portable layers and repository hygiene. The plugin build remains a local or self-hosted Windows step because Dalamud.NET.Sdk still needs a resolved DALAMUD_HOME / Hooks dev directory.

Build:

.\build\build.ps1 -NoRestore

Full test run:

.\build\test.ps1 -NoBuild

The active solution is DalamudMCP.slnx.

Repository Layout

Active projects:

Test projects:

NUGET
DalamudMCP.Cli
Install Command
# nuget: DalamudMCP.Cli
Runtime: dnx