@cnbcool/mcp-server
Version:
CNB MCP Server. A comprehensive MCP server that provides seamless integration to the CNB's API(https://cnb.cool), offering a wide range of tools for repository management, pipelines operations and collaboration features
25 lines (24 loc) • 992 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getBaseUrl = getBaseUrl;
exports.getToken = getToken;
/**
* baseUrl 降级获取
*
* 环境变量 API_BASE_URL(mcp 客户端配置)--不存在--> CNB 流水线提供的 CNB_API_ENDPOINT ---不存在--> 'https://api.cnb.cool'
*/
function getBaseUrl() {
var _a, _b;
const baseUrl = (_b = (_a = process.env.API_BASE_URL) !== null && _a !== void 0 ? _a : process.env.CNB_API_ENDPOINT) !== null && _b !== void 0 ? _b : 'https://api.cnb.cool';
return baseUrl;
}
/**
* token 降级获取
*
* token --不存在--> 环境变量 API_TOKEN(mcp 客户端配置)--不存在--> CNB 流水线提供的 CNB_TOKEN ---不存在--> ''
*/
function getToken(token) {
var _a, _b;
const newToken = (_b = (_a = token !== null && token !== void 0 ? token : process.env.API_TOKEN) !== null && _a !== void 0 ? _a : process.env.CNB_TOKEN) !== null && _b !== void 0 ? _b : '';
return newToken;
}