Skip to content

MCP Server Inventory

This inventory classifies the existing ldev command surface by how well it fits the local MCP server.

Current MCP Surface

The current server registers 15 tools:

ToolSource command areaFit
ldev_contextcontext --jsonStrong
liferay_checkportal check --jsonStrong
ldev_statusstatus --jsonStrong
ldev_logs_diagnoselogs diagnose --jsonStrong
liferay_inventory_sitesportal inventory sitesStrong
liferay_inventory_pagesportal inventory pagesStrong
liferay_inventory_pageportal inventory pageStrong
liferay_inventory_structuresportal inventory structuresStrong
liferay_inventory_templatesportal inventory templatesStrong
liferay_doctordoctorStrong
liferay_deploy_statusdeploy statusStrong
liferay_osgi_statusosgi statusStrong
liferay_osgi_diagosgi diag <bundle>Strong
liferay_osgi_thread_dumposgi thread-dumpStrong
liferay_mcp_checkmcp checkStrong

These are good first tools because they return structured results, answer common agent questions without requiring shell parsing, and keep mutating workflows CLI-first. liferay_osgi_thread_dump is the exception that writes diagnostic dump artifacts.

Best Next MCP Tools

These commands should be the next candidates because they are read-only or diagnostic, have stable JSON output, and are useful before an agent mutates anything.

PriorityMCP toolBacking command/functionWhy
P0ldev_ai_bootstrapai bootstrap --intent ... --json / runAiBootstrapHigher-level context plus targeted doctor checks. Useful for discover/develop/deploy/troubleshoot intents.
P0liferay_inventory_preflightportal inventory preflight / runLiferayPreflightExplicit API-surface readiness for inventory/resource workflows.
P1reindex_statusportal reindex status / runReindexStatusCommon runtime diagnostic after imports or content shrink work.
P1reindex_tasksportal reindex tasks / runReindexTasksComplements reindex_status with active task detail.
P1liferay_search_indicesportal search indices / runLiferaySearchIndicesGood read-only Elasticsearch inventory.
P1liferay_search_mappingsportal search mappings --index / runLiferaySearchMappingsHelpful for diagnosing indexing/schema issues.
P1page_layout_exportportal page-layout export / runLiferayPageLayoutExportRead-only normalized page JSON for page debugging. Prefer returning JSON directly rather than writing --output.
P1page_layout_diffportal page-layout diff / runLiferayPageLayoutDiffStrong verification tool for before/after page checks.
P1resource_get_structureresource structure / runLiferayResourceGetStructureRead one resource without filesystem writes.
P1resource_get_templateresource template / runLiferayResourceGetTemplateRead one template without filesystem writes.
P1resource_get_adtresource adt / runLiferayResourceGetAdtRead one ADT without filesystem writes.
P1resource_list_adtsresource adts / runLiferayResourceListAdtsDiscovery for ADT work.
P1resource_list_fragmentsresource fragments / runLiferayResourceListFragmentsDiscovery for fragment work.

Conditional MCP Tools

These are useful, but they write files, call external services, run longer operations, or need stricter guardrails.

MCP toolBacking command/functionSuggested rule
resource_export_structureresource export-structureAllow with explicit output path or return-only mode.
resource_export_templateresource export-templateAllow with explicit output path or return-only mode.
resource_export_structuresresource export-structuresRequire explicit allSites and cap/error strategy.
resource_export_templatesresource export-templatesRequire explicit allSites, continueOnError, and output directory.
resource_export_adtsresource export-adtsSame as template exports.
resource_export_fragmentsresource export-fragmentsSame as template exports.
resource_import_*resource import-*Expose check-only first. Mutating imports should require a separate apply: true input and should reject plural imports unless explicit.
resource_migration_initresource migration-initOK as a file-generation tool if output is explicit.
resource_migration_pipelineresource migration-pipelinePowerful but high-blast-radius; expose after import guardrails exist.
deploy_preparedeploy prepareWrites build artifacts but does not touch runtime. Useful after explicit user intent.
deploy_module / deploy_themedeploy module, deploy themeMutating build/deploy flow; require exact target.
deploy_watchdeploy watchLong-running; expose only with bounded iterations.
env_waitenv waitOK as bounded diagnostic with timeout.
env_diffenv diffRead-only unless writeBaseline; reject writeBaseline by default.
db_querydb queryUseful but risky; allow read-only SELECT first, reject files/mutations unless an explicit unsafe mode exists.

Poor MCP Fits

These commands are interactive, destructive, secret-bearing, or better handled by the human-facing CLI.

CommandReason
shellInteractive terminal session, no structured return.
logs without diagnoseStreaming terminal output; use logs diagnose instead.
osgi gogoInteractive terminal session.
env clean, worktree clean, worktree gc --applyDestructive local cleanup.
db import --force, db sync --forceReplaces local database state.
db download, db sync, files-downloadExternal downloads, credentials, long-running operations. Better as CLI workflows.
project init, ai install, ai updateBootstrap/configuration flows, not normal runtime tools.
auth tokenSecret-bearing result. Prefer health checks that do not return tokens.
config set, feature-flags enable/disable, reindex speedup-on/offMutates local/portal configuration; expose later only with explicit apply semantics.
content prunePotentially destructive portal content operation; keep CLI-first.

Startup Options

The current local server uses stdio. In that model the MCP client starts ldev-mcp-server itself, so a separate background daemon is not required and can actually be the wrong abstraction: stdio needs a process connected to the client's stdin/stdout.

Implemented improvements:

  1. ldev ai mcp-setup --tool all. This writes .vscode/mcp.json, .claude/mcp.json, and .cursor/mcp.json in one run. It solves the real daily friction without changing transport.

  2. ldev ai mcp-setup --target . --tool vscode --strategy local|global|npx. Today strategy is auto-detected. An explicit strategy lets a developer force a local project dependency for reproducible worktrees or force global for speed.

  3. ldev mcp doctor. This should validate the generated config file, resolve the command on PATH, run ldev-mcp-server --version, and optionally perform a minimal MCP initialize/list-tools handshake. This is more valuable than a background process for stdio clients.

Future option:

  1. Add a non-stdio transport later: ldev serve --transport http --port 0. This would make a background server meaningful. It should write a pid/log file under a project-local runtime directory and expose ldev serve status and ldev serve stop. Only do this if target clients support connecting to an HTTP MCP server in the desired config format.

  2. If background stdio is still desired for manual testing, add a bounded helper, not a production path: ldev serve test-client --list-tools. It can spawn the stdio server, run the MCP handshake, print the available tools, then exit.

Best near-term path: keep stdio client-managed and use ldev mcp doctor when a client does not load the expected tools. Defer background mode until there is an HTTP transport use case.

@mordonezdev/ldev for operational Liferay maintenance workflows. Built by Miguel Ordóñez