Skip to main content
Glama

MCP Prompts Server

catalog-sync.ts1.34 kB
import { SQSEvent, SQSHandler } from 'aws-lambda'; import { DynamoDBAdapter } from '../adapters/aws/dynamodb-adapter'; import { S3CatalogAdapter } from '../adapters/aws/s3-adapter'; import { PromptIndexingService } from '../core/services/prompt-indexing.service'; // Initialize adapters const promptRepository = new DynamoDBAdapter(process.env.PROMPTS_TABLE!); const catalogRepository = new S3CatalogAdapter(process.env.PROMPTS_BUCKET!); const indexingService = new PromptIndexingService(promptRepository, catalogRepository); export const handler: SQSHandler = async (event: SQSEvent): Promise<void> => { console.log('Processing catalog sync event:', JSON.stringify(event, null, 2)); for (const record of event.Records) { try { const messageBody = JSON.parse(record.body); const repoUrl = messageBody.repoUrl || process.env.GITHUB_REPO_URL || 'https://github.com/sparesparrow/mcp-prompts-catalog'; console.log(`Syncing catalog from: ${repoUrl}`); // Sync catalog from GitHub to S3 await catalogRepository.syncFromGitHub(repoUrl); // Sync prompts from catalog to DynamoDB await indexingService.syncFromCatalog(); console.log('Catalog sync completed successfully'); } catch (error) { console.error('Error processing catalog sync:', error); throw error; } } };

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/sparesparrow/mcp-prompts'

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