MCPcopy Create free account
hub / github.com/MicrosoftDocs/mcp / clear

Method clear

cli/src/mcp/cache.ts:90–106  ·  view source on GitHub ↗
(endpoint: string)

Source from the content-addressed store, hash-verified

88 }
89
90 async clear(endpoint: string): Promise<void> {
91 const normalizedEndpoint = normalizeEndpoint(endpoint);
92 const cache = await this.readCacheFile();
93
94 if (!(normalizedEndpoint in cache.entries)) {
95 return;
96 }
97
98 delete cache.entries[normalizedEndpoint];
99
100 if (Object.keys(cache.entries).length === 0) {
101 await rm(this.cacheFilePath, { force: true }).catch(() => undefined);
102 return;
103 }
104
105 await this.writeCacheFile(cache);
106 }
107
108 private async readCacheFile(): Promise<CacheFileShape> {
109 try {

Callers

nothing calls this directly

Calls 3

readCacheFileMethod · 0.95
writeCacheFileMethod · 0.95
normalizeEndpointFunction · 0.85

Tested by

no test coverage detected