UNPKG

@cyanheads/git-mcp-server

Version:

An MCP (Model Context Protocol) server enabling LLMs and AI agents to interact with Git repositories. Provides tools for comprehensive Git operations including clone, commit, branch, diff, log, status, push, pull, merge, rebase, worktree, tag management,

51 lines 1.75 kB
import { logger } from "./logger.js"; // Import utils from the main barrel file (generateUUID from ../security/idGenerator.js) import { generateUUID } from "../index.js"; // Direct instance for request context utilities const requestContextServiceInstance = { config: {}, /** * Configure service settings * @param config New configuration * @returns Updated configuration */ configure(config) { this.config = { ...this.config, ...config, }; logger.debug("RequestContext configuration updated", { config: this.config, }); return { ...this.config }; }, /** * Get current configuration * @returns Current configuration */ getConfig() { return { ...this.config }; }, /** * Create a request context with unique ID and timestamp * @param additionalContext Additional context properties * @returns Request context object */ createRequestContext(additionalContext = {}) { const requestId = generateUUID(); // Use imported generateUUID const timestamp = new Date().toISOString(); return { requestId, timestamp, ...additionalContext, }; }, // generateSecureRandomString function removed as it was unused and redundant }; // Export the instance directly export const requestContextService = requestContextServiceInstance; // Removed delegate functions and default export for simplicity. // Users should import and use `requestContextService` directly. // e.g., import { requestContextService } from './requestContext.js'; // requestContextService.createRequestContext(); //# sourceMappingURL=requestContext.js.map