@chainlink/mcp-server
Version:
Prototype MCP Server for CLL
72 lines • 2.77 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getProjectRoot = getProjectRoot;
exports.getDataDir = getDataDir;
exports.getExternalDocsDir = getExternalDocsDir;
exports.getCcipSourceDir = getCcipSourceDir;
exports.getCcipConfigDir = getCcipConfigDir;
exports.getCcipCombinedConfigPath = getCcipCombinedConfigPath;
exports.getDataFeedsDir = getDataFeedsDir;
exports.getDataFeedsIndexPath = getDataFeedsIndexPath;
const path_1 = require("path");
/**
* @fileoverview Centralized filesystem path helpers used across scripts and runtime code.
*
* All paths are resolved relative to the package root, so the MCP server can find
* its bundled data files regardless of where it's executed from.
*/
/**
* Get absolute path to the project root directory.
* When running as an installed package (via npm/npx), this resolves to the package installation directory.
* When running in development, this resolves to the project directory.
*/
function getProjectRoot() {
// __dirname in compiled JS will be dist/utils. Go up 2 levels to reach the project root.
return (0, path_1.resolve)(__dirname, "..", "..");
}
/**
* Get absolute path to the top-level data directory used by the MCP server.
*/
function getDataDir() {
return (0, path_1.join)(getProjectRoot(), "data");
}
/**
* Get absolute path to the external documentation repository directory.
*/
function getExternalDocsDir() {
return (0, path_1.join)(getProjectRoot(), "external", "documentation");
}
/**
* Get absolute path to the CCIP configuration source directory within the external docs repo.
* Example: external/documentation/src/config/data/ccip/v1_2_0
*/
function getCcipSourceDir() {
return (0, path_1.join)(getExternalDocsDir(), "src", "config", "data", "ccip", "v1_2_0");
}
/**
* Get absolute path to the CCIP configuration directory inside the top-level data directory.
* Example: data/external/documentation/src/config/data/ccip/v1_2_0
*/
function getCcipConfigDir() {
return (0, path_1.join)(getDataDir(), "external", "documentation", "src", "config", "data", "ccip", "v1_2_0");
}
/**
* Get absolute path to the combined CCIP config file for the given environment.
* @param environment - Either "mainnet" or "testnet"
*/
function getCcipCombinedConfigPath(environment) {
return (0, path_1.join)(getCcipConfigDir(), environment, "ccip-config.json");
}
/**
* Get absolute path to the Data Feeds directory inside the top-level data directory.
*/
function getDataFeedsDir() {
return (0, path_1.join)(getDataDir(), "feeds");
}
/**
* Get absolute path to the Data Feeds index.json file.
*/
function getDataFeedsIndexPath() {
return (0, path_1.join)(getDataFeedsDir(), "index.json");
}
//# sourceMappingURL=paths.js.map