Skip to main content
Glama

Keyboard Shortcuts MCP Server

by jenova-marie
opus-client.integration.test.ts3.53 kB
import { describe, it, expect, beforeAll } from 'vitest'; import { OpusClient } from './opus-client.js'; import type { ShortcutData } from './types.js'; describe.skipIf(!process.env.ANTHROPIC_API_KEY)('OpusClient Integration Tests', () => { beforeAll(() => { console.log('✅ ANTHROPIC_API_KEY found - running integration tests'); }); it('should query tmux shortcuts from live Opus API', async () => { const opusClient = new OpusClient(); const mockShortcuts: ShortcutData[] = [ { os: 'ubuntu', desktop: null, application: 'tmux', file: 'tmux', categories: [ { name: 'Session Management', shortcuts: [ { keys: 'Prefix + D', description: 'Detach session' }, { keys: 'Prefix + S', description: 'List sessions' }, ], }, { name: 'Pane Management', shortcuts: [ { keys: 'Prefix + %', description: 'Split pane vertically' }, { keys: 'Prefix + "', description: 'Split pane horizontally' }, ], }, ], }, ]; const query = 'how do I split a tmux pane vertically?'; const result = await opusClient.queryShortcuts(query, mockShortcuts); // Verify response contains relevant information expect(result).toBeTruthy(); expect(result.length).toBeGreaterThan(0); expect(result.toLowerCase()).toContain('vertical'); expect(result).toContain('Prefix'); }); it('should query GNOME window management shortcuts', async () => { const opusClient = new OpusClient(); const mockShortcuts: ShortcutData[] = [ { os: 'ubuntu', desktop: 'gnome', application: null, file: 'window-management', categories: [ { name: 'Window Tiling', shortcuts: [ { keys: 'Super + Left', description: 'Tile window to left half' }, { keys: 'Super + Right', description: 'Tile window to right half' }, { keys: 'Super + Up', description: 'Maximize window' }, ], }, ], }, ]; const query = 'how do I tile a window to the left side of the screen?'; const result = await opusClient.queryShortcuts(query, mockShortcuts); expect(result).toBeTruthy(); expect(result.toLowerCase()).toContain('left'); expect(result).toContain('Super'); }); it('should handle multiple application shortcuts', async () => { const opusClient = new OpusClient(); const mockShortcuts: ShortcutData[] = [ { os: 'ubuntu', desktop: 'gnome', application: 'firefox', file: 'firefox', categories: [ { name: 'Tab Management', shortcuts: [ { keys: 'Ctrl + T', description: 'New tab' }, { keys: 'Ctrl + W', description: 'Close tab' }, { keys: 'Ctrl + Shift + T', description: 'Reopen closed tab' }, ], }, { name: 'Navigation', shortcuts: [ { keys: 'Ctrl + L', description: 'Focus address bar' }, { keys: 'Alt + Left', description: 'Back' }, ], }, ], }, ]; const query = 'what are the tab shortcuts in firefox?'; const result = await opusClient.queryShortcuts(query, mockShortcuts); expect(result).toBeTruthy(); expect(result.toLowerCase()).toMatch(/tab|ctrl/); }); });

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