# MCP server registry — written to .mcp.json / .cursor/mcp.json /
# .vscode/mcp.json by `ai-cli init` for Claude Code / Cursor / GitHub Copilot.
#
# Each server defines per-platform launch commands. Variable placeholders
# of the form {KEY} are substituted at init time from --mcp-var KEY=VALUE
# flags passed to ai-cli. Missing platform entries cause that server to be
# silently skipped on that platform — useful for engines that only ship
# Windows + macOS clients.
#
# Codex project-scope config is written to .codex/config.toml (TOML format).

# Per-platform default values for {KEY} placeholders. init/mcp does not
# prompt for keys covered here. `--mcp-var KEY=VALUE` still wins over
# defaults at substitution time. Windows expands `%LOCALAPPDATA%` at render
# time in code. macOS launches through /bin/sh so paths with spaces remain a
# single executable argument in MCP clients that split `command` too eagerly.
#
# MSW_MCP_TOKEN intentionally defaults to the issuance URL on every platform
# so the generated config contains a clickable hint when the user did not
# supply --mcp-var MSW_MCP_TOKEN=<actual-key>. They open the file, click the
# URL to issue a key, and replace the URL with it. `--mcp-var` overrides.
#
# This file ships to end users via npm. Internal/dev URLs live in
# `dev/mcp.yaml` (committed but excluded from the `files` whitelist) and
# are loaded only when `MSWAI_ENV=dev` is set.
defaults:
  windows:
    MSW_MAKER_MCP_PATH: "%LOCALAPPDATA%\\Nexon\\MapleStory Worlds\\MakerMCP\\msw-maker-mcp.bat"
    MSW_MCP_TOKEN: "https://maplestoryworlds-insight.nexon.com/credentials/api-keys"
    MSW_MCP_URL: "https://msw-mcp.nexon.com/mcp"
  macos:
    MSW_MAKER_MCP_PATH: "/Library/Application Support/Nexon/MapleStory Worlds/MapleStory Worlds.app/Contents/MacOS/MakerMCP"
    MSW_MCP_TOKEN: "https://maplestoryworlds-insight.nexon.com/credentials/api-keys"
    MSW_MCP_URL: "https://msw-mcp.nexon.com/mcp"
  linux:
    MSW_MCP_TOKEN: "https://maplestoryworlds-insight.nexon.com/credentials/api-keys"
    MSW_MCP_URL: "https://msw-mcp.nexon.com/mcp"

# Secrets are prompted in interactive `mswai mcp` runs: the issuanceUrl is
# shown and opened in the user's browser, then the entered token replaces the
# default URL above. Empty input leaves the URL as a placeholder so the user
# can still paste the token by hand later. Silent / --json runs skip this
# entirely and fall back to the defaults behavior.
secrets:
  MSW_MCP_TOKEN:
    label: "MSW MCP API token"
    issuanceUrl: "https://maplestoryworlds-insight.nexon.com/credentials/api-keys"

servers:
  msw-maker-mcp:
    windows:
      command: cmd.exe
      args:
        - /c
        - call
        - "{MSW_MAKER_MCP_PATH}"
    macos:
      command: /bin/sh
      args:
        - -c
        - 'exec "$1"'
        - msw-maker-mcp
        - "{MSW_MAKER_MCP_PATH}"

  msw-mcp:
    http:
      url: "{MSW_MCP_URL}"
      headers:
        Authorization: "Bearer {MSW_MCP_TOKEN}"
