Skip to main content
Glama

Chat Context MCP

by aolshaun
config.ts2.72 kB
/** * Config Commands */ import { Command } from 'commander'; import chalk from 'chalk'; import { loadConfig, setConfigValue, resetConfig, getConfigPath } from '../utils/config.js'; import { printError, printSuccess, formatAsJSON, useColors } from '../utils/output.js'; import type { CLIConfig } from '../types.js'; export function createConfigCommand(): Command { const cmd = new Command('config'); cmd.description('Manage CLI configuration'); // config show cmd .command('show') .description('Show current configuration') .option('-f, --format <type>', 'Output format (table, json)', 'table') .action((options: { format?: string }) => { try { const config = loadConfig(); if (options.format === 'json') { console.log(formatAsJSON(config)); } else { const colors = useColors(); console.log('\nCurrent Configuration:\n'); console.log(` ${colors ? chalk.bold('Default Format:') : 'Default Format:'} ${config.defaultFormat}`); console.log(` ${colors ? chalk.bold('Default Limit:') : 'Default Limit:'} ${config.defaultLimit}`); console.log(` ${colors ? chalk.bold('Default Sort:') : 'Default Sort:'} ${config.defaultSort}`); console.log(` ${colors ? chalk.bold('Use Colors:') : 'Use Colors:'} ${config.useColors}`); if (config.cursorDBPath) { console.log(` ${colors ? chalk.bold('Cursor DB Path:') : 'Cursor DB Path:'} ${config.cursorDBPath}`); } if (config.metadataDBPath) { console.log(` ${colors ? chalk.bold('Metadata DB Path:') : 'Metadata DB Path:'} ${config.metadataDBPath}`); } console.log(`\nConfig file: ${colors ? chalk.gray(getConfigPath()) : getConfigPath()}\n`); } } catch (error: any) { printError(error.message); process.exit(1); } }); // config set cmd .command('set') .description('Set a configuration value') .argument('<key>', 'Configuration key') .argument('<value>', 'Configuration value') .action((key: string, value: string) => { try { setConfigValue(key as keyof CLIConfig, value); printSuccess(`Set ${key} = ${value}`); } catch (error: any) { printError(error.message); process.exit(1); } }); // config reset cmd .command('reset') .description('Reset configuration to defaults') .action(() => { try { resetConfig(); printSuccess('Configuration reset to defaults'); } catch (error: any) { printError(error.message); process.exit(1); } }); return cmd; }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/aolshaun/chat-context-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server