DeepContext is an MCP server that adds symbol-aware semantic search to Claude Code, Codex CLI, and other agents for faster, smarter context on large codebases.
DeepContext is an MCP server that provides symbol-aware semantic search for large codebases, enabling AI coding agents to find relevant code chunks us...
60const resolvedPath = path.resolve(codebasePath);// Exploitable if MCP is exposed to untrusted prompts (network_exposed).
81const normalizedPath = path.resolve(codebasePath);// Exploitable if MCP is exposed to untrusted prompts (network_exposed).
28const safeKey = operationKey.replace(/[^a-zA-Z0-9-_]/g, '_');// Exploitable if MCP is exposed to untrusted prompts (network_exposed).
384private getFileMetadataPath(codebasePath: string): string {
385 const dataDir = process.env.CODEX_CONTEXT_DATA_DIR || path.join(process.env.HOME || '~', '.codex-context');
386 const pathHash = crypto.createHash('md5').update(codebasePath).digest('hex').substring(0, 8);
387 return path.join(dataDir, `${pathHash}-file-metadata.json`);
388}// Exploitable if MCP is exposed to untrusted prompts (network_exposed).
185async clearIndexedCodebases(codebasePath?: string): Promise<{
186 success: boolean;
187 message: string;
188 namespacesCleared: string[];
189}> {
190 const namespacesCleared: string[] = [];
191
192 try {
193 if (codebasePath) {
194 // Clear specific codebase
195 const resolvedPath = path.resolve(codebasePath);
196 const indexed = this.indexedCodebases.get(resolvedPath);
197
198 if (indexed) {
199 // Clear the vector store namespace
200 await this.codebaseOperations.clearNamespace(indexed.namespace);
201 namespacesCleared.push(indexed.namespace);
202
203 // Remove from tracking
204 this.indexedCodebases.delete(resolvedPath);
205 this.logger.info(`🗑️ Cleared codebase: ${resolvedPath} (${indexed.namespace})`);
206 } else {
207 return {
208 success: false,
209 message: `Codebase not found: ${codebasePath}`,
210 namespacesCleared: []
211 };
212 }
213 } else {
214 // Clear all codebases
215 for (const indexed of this.indexedCodebases.values()) {
216 await this.codebaseOperations.clearNamespace(indexed.namespace);
217 namespacesCleared.push(indexed.namespace);
218 }
219 this.indexedCodebases.clear();
220 this.logger.info(`🗑️ Cleared all indexed codebases (${namespacesCleared.length} namespaces)`);
221 }
222
223 // Save the updated state
224 await this.saveIndexedCodebases();
225
226 return {
227 success: true,
228 message: codebasePath
229 ? `Cleared codebase: ${codebasePath}`
230 : `Cleared all ${namespacesCleared.length} indexed codebases`,
231 namespacesCleared
232 };// Exploitable if MCP is exposed to untrusted prompts (network_exposed).
122// Validate path exists and is accessible
123await fs.access(codebasePath);// Exploitable if MCP is exposed to untrusted prompts (network_exposed).
267private async processSingleFile(
268 filePath: string,
269 codebasePath: string,
270 options: FileProcessingOptions = {}
271): Promise<CodeChunk[]> {
272 try {
273 // Create a minimal IndexingRequest for single file processing
274 const indexingRequest: IndexingRequest = {
275 codebasePath,
276 forceReindex: false,
277 enableContentFiltering: options.enableContentFiltering !== false,
278 enableDependencyAnalysis: options.enableDependencyAnalysis !== false
279 };
280
281 // Use the IndexingOrchestrator to process the file
282 const chunks = await this.indexingOrchestrator.processFile(filePath, indexingRequest);// Exploitable if MCP is exposed to untrusted prompts (network_exposed).
384const normalizedPath = path.resolve(codebasePath);
385// Check if path exists
386const fs = await import('fs/promises');
387await fs.access(normalizedPath);// Exploitable if MCP is exposed to untrusted prompts (network_exposed).
22console.log(`[BACKGROUND] Using Wildcard API`);
23console.log(`[BACKGROUND] Wildcard API Key: ${process.env.WILDCARD_API_KEY?.substring(0, 10)}...`);
24console.log(`[BACKGROUND] Wildcard API URL: ${process.env.WILDCARD_API_URL}`);// Exploitable if logs are accessible to unauthorized parties.