Skip to content

Feature Request: Support custom base URL / domain in ResolveEndpoints (for private Feishu deployments) #31

Description

@rayw-lab

Summary

internal/core/types.go:8 has this comment:

// Any other string is treated as a custom base URL.
type LarkBrand string

However, the current ResolveEndpoints implementation (L24-39) only handles "lark" and defaults everything else to open.feishu.cn:

func ResolveEndpoints(brand LarkBrand) Endpoints {
    switch brand {
    case BrandLark:
        return Endpoints{Open: "https://open.larksuite.com", ...}
    default:
        return Endpoints{Open: "https://open.feishu.cn", ...}  // custom URL not implemented
    }
}

Use Case

Many enterprises deploy private Feishu instances with custom domains (e.g., open.xfchat.iflytek.com). These instances use the same Open API protocol as open.feishu.cn, but with a different base URL.

Currently, lark-openapi-mcp supports this via the --domain parameter. It would be very helpful if lark-cli also supported custom domains, enabling the full CLI + 19 Skills experience on private deployments.

Proposed Solution

Minimal change (~4 lines) in ResolveEndpoints:

func ResolveEndpoints(brand LarkBrand) Endpoints {
    switch brand {
    case BrandLark:
        return Endpoints{...larksuite.com...}
    case BrandFeishu, "":
        return Endpoints{...feishu.cn...}
    default:
        // Treat brand as custom base URL
        base := string(brand)
        return Endpoints{
            Open:     base,
            Accounts: strings.Replace(base, "open.", "accounts.", 1),
            MCP:      strings.Replace(base, "open.", "mcp.", 1),
        }
    }
}

Then in config init, users could set brand: "https://open.xfchat.iflytek.com" to target their private instance.

Impact

This would unlock the entire 19-Skill ecosystem for private Feishu deployments without any architectural changes. The comment on L8 already describes this intent -- this PR would implement it.

Environment

  • lark-cli v1.0.0
  • Go 1.23+
  • Windows 11 / macOS

Metadata

Metadata

Assignees

No one assigned

    Labels

    domain/coreCLI framework and core librariesenhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions