Skip to content

Commit 54ee366

Browse files
committed
feat: add MCP server and legacy code for reference
MCP Server: - Standalone Model Context Protocol server implementation - Enables Claude/AI agents to interact with CodeIntel - Python-based server with websocket support - Configuration via environment variables - Can run independently or alongside main backend Legacy Code: - Previous iteration implementations preserved for reference - Old indexer and repo manager versions - React component examples - Useful for understanding evolution of the codebase - Marked as legacy to avoid confusion with current implementation Note: MCP server is optional and not required for main application
1 parent d04b8fb commit 54ee366

7 files changed

Lines changed: 942 additions & 0 deletions

File tree

legacy/IndexingProgress.tsx

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
import { useEffect, useState } from 'react'
2+
3+
interface IndexingProgressProps {
4+
repoId: string
5+
apiUrl: string
6+
apiKey: string
7+
onComplete: () => void
8+
}
9+
10+
export function IndexingProgress({ repoId, apiUrl, apiKey, onComplete }: IndexingProgressProps) {
11+
const [progress, setProgress] = useState(0)
12+
const [status, setStatus] = useState('Starting...')
13+
const [stats, setStats] = useState({ processed: 0, total: 0, functions: 0 })
14+
15+
useEffect(() => {
16+
let interval: any
17+
18+
const checkProgress = async () => {
19+
try {
20+
const response = await fetch(`${apiUrl}/api/repos/${repoId}`, {
21+
headers: { 'Authorization': `Bearer ${apiKey}` }
22+
})
23+
const repo = await response.json()
24+
25+
if (repo.status === 'indexed') {
26+
setProgress(100)
27+
setStatus('✅ Indexing complete!')
28+
clearInterval(interval)
29+
setTimeout(onComplete, 1500)
30+
} else if (repo.status === 'indexing') {
31+
// Estimate progress based on function count growth
32+
const estimatedProgress = Math.min(95, (repo.file_count / 100) * 100)
33+
setProgress(estimatedProgress)
34+
setStatus(`📊 Indexing... ${repo.file_count} functions processed`)
35+
setStats({
36+
processed: repo.file_count,
37+
total: 100,
38+
functions: repo.file_count
39+
})
40+
}
41+
} catch (error) {
42+
console.error('Error checking progress:', error)
43+
}
44+
}
45+
46+
// Check immediately, then every 2 seconds
47+
checkProgress()
48+
interval = setInterval(checkProgress, 2000)
49+
50+
return () => clearInterval(interval)
51+
}, [repoId])
52+
53+
return (
54+
<div className="fixed inset-0 bg-black/50 flex items-center justify-center z-50">
55+
<div className="bg-white rounded-lg shadow-xl p-8 max-w-md w-full mx-4">
56+
<h3 className="text-xl font-semibold mb-6 text-gray-900">
57+
Indexing Repository
58+
</h3>
59+
60+
<div className="space-y-4">
61+
<div className="flex items-center justify-between text-sm mb-2">
62+
<span className="text-gray-600">{status}</span>
63+
<span className="font-semibold text-blue-600">{progress.toFixed(0)}%</span>
64+
</div>
65+
66+
{/* Progress Bar */}
67+
<div className="w-full bg-gray-200 rounded-full h-3 overflow-hidden">
68+
<div
69+
className="h-full bg-gradient-to-r from-blue-500 to-blue-600 transition-all duration-500 ease-out"
70+
style={{ width: `${progress}%` }}
71+
/>
72+
</div>
73+
74+
{/* Stats */}
75+
{stats.functions > 0 && (
76+
<div className="grid grid-cols-2 gap-3 mt-4 pt-4 border-t border-gray-200">
77+
<div>
78+
<div className="text-xs text-gray-500">Functions Found</div>
79+
<div className="text-2xl font-bold text-gray-900">{stats.functions}</div>
80+
</div>
81+
<div>
82+
<div className="text-xs text-gray-500">Status</div>
83+
<div className="text-sm font-semibold text-blue-600">Processing...</div>
84+
</div>
85+
</div>
86+
)}
87+
88+
<p className="text-xs text-gray-500 mt-4">
89+
Using batch processing for optimal performance
90+
</p>
91+
</div>
92+
</div>
93+
</div>
94+
)
95+
}

legacy/README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Legacy Code Archive
2+
3+
This folder contains old implementations that were replaced during development.
4+
5+
## Files:
6+
7+
### indexer_old.py
8+
- Original indexer implementation before batch processing optimization
9+
- Replaced by `indexer_optimized.py` which achieves 100x performance improvement
10+
- Kept for reference on the evolution from individual API calls to batch processing
11+
12+
### repo_manager_old.py
13+
- Original repository manager with in-memory storage
14+
- Replaced by current `repo_manager.py` with Supabase persistence
15+
- Shows the migration from ephemeral to production-grade storage
16+
17+
### IndexingProgress.tsx
18+
- Original indexing progress component using WebSocket
19+
- Replaced by integrated progress in `RepoOverview.tsx` using shadcn Progress component
20+
- Kept for reference on the WebSocket implementation approach
21+
22+
**Note:** These files are not imported or used anywhere in the active codebase.
23+
They're preserved for historical reference and to show the development evolution.

0 commit comments

Comments
 (0)