@upstash/context7-mcp
Version:
MCP server for Context7
16 lines (15 loc) • 542 B
JavaScript
import { AsyncLocalStorage } from "node:async_hooks";
const operationScope = new AsyncLocalStorage();
export function runInMcpOperationScope(target, callback) {
return operationScope.run(target, callback);
}
export function markCurrentMcpOperationError(errorType = "tool_error") {
const target = operationScope.getStore();
if (target)
target.errorType = errorType;
}
export function markCurrentMcpToolOutcome(outcome) {
const target = operationScope.getStore();
if (target)
target.toolOutcome = outcome;
}