Skip to main content
Glama

Keyboard Shortcuts MCP Server

by jenova-marie
data-loader.ts•1.34 kB
import { readFileSync, readdirSync, statSync } from 'fs'; import { join } from 'path'; import { fileURLToPath } from 'url'; import { dirname } from 'path'; import type { ShortcutData, DataStore } from './types.js'; const __filename = fileURLToPath(import.meta.url); const __dirname = dirname(__filename); export function loadShortcutData(customDataDir?: string): DataStore { const dataDir = customDataDir || join(__dirname, '..', 'data'); const shortcuts: ShortcutData[] = []; function loadJsonFiles(dir: string): void { const entries = readdirSync(dir); for (const entry of entries) { const fullPath = join(dir, entry); const stat = statSync(fullPath); if (stat.isDirectory()) { loadJsonFiles(fullPath); } else if (entry.endsWith('.json')) { const content = readFileSync(fullPath, 'utf-8'); const data = JSON.parse(content) as ShortcutData; shortcuts.push(data); } } } loadJsonFiles(dataDir); return { shortcuts, getByFilters(filters) { return shortcuts.filter(item => { if (item.os !== filters.os) return false; if (filters.desktop && item.desktop !== filters.desktop) return false; if (filters.application && item.application !== filters.application) return false; return true; }); } }; }

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/jenova-marie/keyboard-shortcuts-mcp'

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