Skip to main content
Glama
danielrosehill

Daniel Rosehill's MCP Installer

sync_registry

Update the local registry cache from GitHub to access the latest MCP server list for installation and configuration across multiple clients.

Instructions

Update the local registry cache from GitHub. Use this to get the latest MCP list.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
forceNoForce refresh even if cache is fresh

Implementation Reference

  • The main handler for the 'sync_registry' tool call. It invokes syncRegistry() from registry.ts and formats the response as MCP content.
    case 'sync_registry': { const result = await syncRegistry(); return { content: [{ type: 'text', text: JSON.stringify({ status: 'success', message: 'Registry synced from GitHub', ...result }, null, 2) }] }; }
  • src/index.ts:131-144 (registration)
    Registers the 'sync_registry' tool in the tools array, including name, description, and input schema.
    { name: 'sync_registry', description: 'Update the local registry cache from GitHub. Use this to get the latest MCP list.', inputSchema: { type: 'object', properties: { force: { type: 'boolean', description: 'Force refresh even if cache is fresh', default: true } } } },
  • The core implementation of syncRegistry, which forces a registry refresh via getRegistry(true) and returns version, MCP count, and update time.
    export async function syncRegistry(): Promise<{ version: string; mcpCount: number; updated: string }> { const registry = await getRegistry(true); return { version: registry.version, mcpCount: registry.mcps.length, updated: registry.updated }; }
  • Supporting function getRegistry used by syncRegistry to fetch or load cached registry data, with forceRefresh option to bypass cache.
    export async function getRegistry(forceRefresh = false): Promise<Registry> { // Check cache first (unless forcing refresh) if (!forceRefresh) { const cached = readCache(); if (cached) { return cached; } } // Try to fetch from remote try { const registry = await fetchRemoteRegistry(); writeCache(registry); return registry; } catch (error) { console.error('Failed to fetch remote registry:', error); // Fall back to cache (even if expired) try { if (fs.existsSync(CACHE_FILE)) { const data = fs.readFileSync(CACHE_FILE, 'utf-8'); const cache: CacheEntry = JSON.parse(data); console.error('Using expired cache as fallback'); return cache.registry; } } catch { // Ignore cache read errors } // Fall back to local registry const local = loadLocalRegistry(); if (local) { console.error('Using local registry as fallback'); return local; } throw new Error('No registry available (remote fetch failed and no local fallback)'); } }

Latest Blog Posts

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/danielrosehill/My-MCP-Installer'

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