ids-enterprise-mcp-server
Version:
Model Context Protocol (MCP) server providing comprehensive IDS Enterprise Web Components documentation access via GitLab API. Use with npx and GitLab token for instant access.
44 lines • 1.38 kB
JavaScript
/**
* Configuration management for IDS Enterprise Web Components MCP Server
*/
export class ConfigManager {
static instance;
config;
constructor() {
this.config = this.loadConfig();
}
static getInstance() {
if (!ConfigManager.instance) {
ConfigManager.instance = new ConfigManager();
}
return ConfigManager.instance;
}
getConfig() {
return this.config;
}
loadConfig() {
// Get token from command line args or environment
const token = this.getToken();
if (!token) {
throw new Error('GitLab token is required. Use --token=<token> or set GITLAB_TOKEN environment variable.');
}
return {
token,
gitlabUrl: 'https://oxford.awsdev.infor.com',
projectId: 'infor-design/enterprise-wc',
examplesProjectId: 'infor-design/enterprise-wc-examples',
defaultBranch: 'development'
};
}
getToken() {
// Check command line arguments
const args = process.argv;
const tokenArg = args.find(arg => arg.startsWith('--token='));
if (tokenArg) {
return tokenArg.split('=')[1];
}
// Check environment variables
return process.env.GITLAB_TOKEN || process.env.IDS_GITLAB_TOKEN || '';
}
}
//# sourceMappingURL=index.js.map