@@ -13,8 +13,7 @@ DEVKIT_VERSION="0.4.0"
1313
1414# Resolve symlinks so REPO_HOME points at the real source checkout, not the symlink's
1515# directory. The installer links ~/.local/bin/devkit -> ~/.local/share/devkit/bin/devkit,
16- # so without this REPO_HOME would be ~/.local and every REPO_HOME-relative path (the MCP
17- # server lookup in setup-mcp, bundled docs, ...) would miss.
16+ # so without this REPO_HOME would be ~/.local and every REPO_HOME-relative path would miss.
1817_devkit_source=" ${BASH_SOURCE[0]} "
1918while [ -L " $_devkit_source " ]; do
2019 _devkit_dir=" $( cd -P " $( dirname " $_devkit_source " ) " && pwd) "
@@ -601,7 +600,7 @@ cmd_list() {
601600 [[ " ${1:- } " == " --json" ]] && json_mode=true
602601
603602 if $json_mode ; then
604- # Machine-readable view for the app / MCP, so they consume devkit's own state instead
603+ # Machine-readable view so other tools (CI, a UI) consume devkit's own state instead
605604 # of re-deriving it (and drifting). One JSON object per app, including the failed-start
606605 # reason and the log path so a UI can link straight to the dead end's cause.
607606 local objs=()
@@ -1499,59 +1498,6 @@ STAMP_FILE=$STAMP_FILE
14991498OUT
15001499}
15011500
1502- # ---------- MCP integration ----------
1503-
1504- # Wire the devkit MCP server into an AI agent so it can register/manage apps as
1505- # structured tool calls (instead of relying on a CLAUDE.md text instruction).
1506- cmd_setup_mcp () {
1507- # Prefer a local checkout (handy during development); otherwise run the published
1508- # package with `npx -y devkit-mcp`, so a standalone CLI install needs nothing extra.
1509- # Either way the agent gets the same stdio MCP server.
1510- local candidates=(
1511- " $REPO_HOME /../devkit-mcp/index.js"
1512- " $REPO_HOME /devkit-mcp/index.js"
1513- " $DEVKIT_HOME /devkit-mcp/index.js"
1514- )
1515- local server=" " c
1516- for c in " ${candidates[@]} " ; do
1517- if [[ -f " $c " ]]; then server=" $( cd " $( dirname " $c " ) " && pwd) /index.js" ; break ; fi
1518- done
1519-
1520- local -a runcmd
1521- if [[ -n " $server " ]]; then
1522- need node
1523- # Install deps if missing, else the server crashes with "Cannot find module
1524- # @modelcontextprotocol/sdk" on first call.
1525- local server_dir; server_dir=$( dirname " $server " )
1526- if [[ ! -d " $server_dir /node_modules/@modelcontextprotocol" ]]; then
1527- need npm
1528- echo " installing devkit MCP dependencies..."
1529- (cd " $server_dir " && npm install --silent) || die " npm install failed in $server_dir "
1530- fi
1531- runcmd=(node " $server " )
1532- else
1533- # Unscoped "devkit-mcp" is taken by an unrelated package on npm, so we publish under
1534- # the @djadmin scope. npx fetches it on first use (then caches).
1535- need npx
1536- runcmd=(npx -y @djadmin/devkit-mcp)
1537- fi
1538-
1539- if command -v claude > /dev/null 2>&1 ; then
1540- if claude mcp add devkit -- " ${runcmd[@]} " ; then
1541- echo " devkit MCP registered with Claude Code (${runcmd[*]} ). Restart Claude Code to load it."
1542- else
1543- die " failed to register the MCP with Claude Code (try: claude mcp add devkit -- ${runcmd[*]} )"
1544- fi
1545- else
1546- echo " Claude Code CLI not found. Add the devkit MCP to your agent manually:"
1547- echo " command: ${runcmd[0]} "
1548- echo " args: ${runcmd[*]: 1} "
1549- echo
1550- echo " Claude Code: claude mcp add devkit -- ${runcmd[*]} "
1551- echo " Cursor / Windsurf / other: see your agent's MCP config docs."
1552- fi
1553- }
1554-
15551501# ---------- doctor ----------
15561502
15571503# Append one JSONL record per run to ~/.devkit/.doctor.log so we can track over time
@@ -1782,9 +1728,6 @@ Sync / portability:
17821728 devkit bootstrap
17831729 devkit paths
17841730
1785- AI agent integration:
1786- devkit setup-mcp # register the devkit MCP server with Claude Code / your agent
1787-
17881731Diagnostics:
17891732 devkit doctor # full health check (caddy, symlink, registry, PIDs)
17901733 devkit doctor --json # machine-readable output for agents
@@ -1831,7 +1774,6 @@ case "${1:-help}" in
18311774 clone) shift ; cmd_clone " $@ " ;;
18321775 clone-all) cmd_clone_all ;;
18331776 paths) cmd_paths ;;
1834- setup-mcp) cmd_setup_mcp ;;
18351777 doctor) shift ; cmd_doctor " $@ " ;;
18361778 version|--version|-v) cmd_version ;;
18371779 help|--help|-h) cmd_help ;;
0 commit comments