Skip to main content
Glama
cameronsjo

MCP Server Template

by cameronsjo
index.ts2.82 kB
/** * Shared utilities exports */ // Logging export { Logger, createLogger } from './logger.js'; // Errors export { McpServerError, NotFoundError, ValidationError, RateLimitError, ExternalApiError, TimeoutError, CacheError, AuthenticationError, AuthorizationError, formatErrorResponse, } from './errors.js'; // Rate limiting export { RateLimiter, getRateLimiter, resetRateLimiter } from './rate-limiter.js'; // PII sanitization export { sanitizePii, sanitizeObject, containsPii, detectPiiTypes, isSensitiveField, maskSensitiveValue, } from './pii-sanitizer.js'; // Tracing export { withSpan, withSpanSync, getCurrentSpan, getTraceContext, addSpanAttributes, recordSpanError, createToolSpan, createApiSpan, createDbSpan, } from './tracing.js'; // Retry export { withRetry, createRetryHandler, RetryableErrors, type RetryOptions, } from './retry.js'; // Deduplication export { dedupe, createDedupedFn, isInFlight, getInFlightCount, clearInFlight, dedupeWithTtl, invalidateCache, clearTimedCache, } from './dedup.js'; // HTTP client export { httpRequest, http, HttpError, type HttpRequestOptions, type HttpResponse, } from './http-client.js'; // Crypto export { encrypt, decrypt, encryptWithKey, decryptWithKey, deriveKey, generateKey, generateSecureToken, secureCompare, hashForLookup, SecretsManager, getSecretsManager, resetSecretsManager, type EncryptedData, } from './crypto.js'; // Problem Details (RFC 9457) export { createProblemDetails, createValidationProblem, createRateLimitProblem, createAuthProblem, createNotFoundProblem, createExternalApiProblem, problemToMcpError, isProblemDetails, problemDetailsMiddleware, type ProblemDetails, } from './problem-details.js'; // Timeout utilities export { withTimeout, timeoutPromise, raceTimeout, createTimeoutSignal, combineSignals, } from './timeout.js'; // Audit logging export { auditToolInvoke, auditToolComplete, auditAuth, auditSession, type AuditEntry, } from './audit-logger.js'; // Constants export { Timeouts, CacheTtl, RateLimits, RetryDefaults, Pagination, Security, McpProtocol, HttpStatus, } from './constants.js'; // JWT validation export { JwtValidator, extractBearerToken, createJwtValidatorFromEnv, type JwtConfig, type ValidatedClaims, } from './jwt.js'; // Zero Trust Architecture export { ZtaPolicyEngine, createZtaMiddleware, withZtaVerification, type ZtaRequestContext, type ZtaPolicyDecision, type ZtaPolicyRule, } from './zta.js'; // Health checks export { getHealthRegistry, registerHealthCheck, mountHealthEndpoints, CommonHealthChecks, type HealthCheck, type HealthCheckResult, type HealthResponse, } from './health.js';

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/cameronsjo/mcp-server-template'

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