AI Sessions MCP server enables AI agents to search, list, and access previous coding sessions from Claude Code, OpenAI Codex, Gemini CLI, and opencode. It benefits developers and operations teams by centralizing AI coding history, improving collaboration, and integrating with MCP-compatible clients.
git clone https://github.com/yoavf/ai-sessions-mcp.gitAI Sessions MCP server enables AI agents to search, list, and access previous coding sessions from Claude Code, OpenAI Codex, Gemini CLI, and opencode. It benefits developers and operations teams by centralizing AI coding history, improving collaboration, and integrating with MCP-compatible clients.
1. **Install the MCP Server:** Add the `ai-sessions-mcp` server to your MCP client (e.g., Cursor, Zed, or VS Code with MCP support). Configure it to point to your AI coding history directories. 2. **Run a Search:** Use the prompt template above in your MCP client or AI assistant. Replace [PROJECT_NAME], [TECHNOLOGY_STACK], and [TIME_RANGE] with your specific needs. 3. **Filter Results:** If the initial search returns too many results, refine it by adding more filters (e.g., `--author "Claude Code"` or `--session-id "sess_12345"`). 4. **Export for Collaboration:** Use the MCP server’s export feature (e.g., `--export json` or `--export markdown`) to share findings with your team. 5. **Integrate into Workflow:** Automate recurring searches (e.g., weekly) using your MCP client’s scripting capabilities to keep your team aligned on past learnings. **Tips:** - For large projects, use `--limit 50` to avoid overwhelming results. - Combine with `/mcp ai-sessions-mcp list` to browse sessions by date or tool before searching. - Use `--include-code` to extract full code snippets from sessions for reuse.
No install command available. Check the GitHub repository for manual installation instructions.
git clone https://github.com/yoavf/ai-sessions-mcpCopy the install command above and run it in your terminal.
Launch Claude Code, Cursor, or your preferred AI coding agent.
Use the prompt template or examples below to test the skill.
Adapt the skill to your specific use case and workflow.
Search for all coding sessions related to [PROJECT_NAME] or [TECHNOLOGY_STACK] from my AI coding history. Filter sessions by [TIME_RANGE] and summarize the key learnings, code snippets, and debugging steps. Highlight any recurring issues or solutions that could be reused. Provide a structured report with sections for: 1) Session Overview, 2) Key Insights, 3) Reusable Code, and 4) Action Items.
### AI Sessions MCP Report: React Native Authentication Flow (Last 30 Days)
#### Session Overview
- **Total Sessions Found:** 12
- **Time Range:** May 1-30, 2024
- **Primary Tools Used:** Claude Code (7 sessions), OpenAI Codex (5 sessions)
- **Topics Covered:** JWT token handling, Firebase integration, error boundary implementation
#### Key Insights
1. **JWT Token Refresh Logic:** 6 sessions focused on optimizing token refresh timings to avoid 401 errors. The most stable implementation used a 15-minute buffer before expiration.
2. **Firebase Auth State Persistence:** Sessions #4 and #8 revealed a race condition where `onAuthStateChanged` fired before the app was fully initialized. The solution was to wrap the auth listener in a `useEffect` with a dependency array.
3. **Error Boundaries:** Sessions #3 and #11 documented a common crash when the auth token expired mid-navigation. The fix involved adding a global error boundary with a retry mechanism.
#### Reusable Code
```javascript
// Token refresh utility (from Session #7)
const refreshToken = async (expiredToken) => {
try {
const response = await fetch('/api/refresh-token', {
method: 'POST',
headers: { 'Authorization': `Bearer ${expiredToken}` }
});
const { newToken } = await response.json();
return newToken;
} catch (error) {
console.error('Token refresh failed:', error);
throw error;
}
};
// Firebase auth setup with race condition fix (from Session #4)
useEffect(() => {
const unsubscribe = auth.onAuthStateChanged(async (user) => {
if (user) {
await initializeApp(user); // Wait for app to be ready
}
});
return () => unsubscribe();
}, []);
```
#### Action Items
1. **Document the JWT refresh logic** in the team’s internal wiki (from Session #7).
2. **Implement the race condition fix** in the staging branch by EOD (from Session #4).
3. **Add error boundary tests** to the CI pipeline (from Session #11).
4. **Schedule a team retro** to review all 12 sessions and identify patterns for the next sprint.
**Next Steps:** Use `/mcp ai-sessions-mcp search --project "React Native Auth" --export markdown` to generate a full report for the team.Google's multimodal AI model and assistant
AI assistant built for thoughtful, nuanced conversation
Advanced foundation models via API and ChatGPT
IronCalc is a spreadsheet engine and ecosystem
Enterprise workflow automation and service management platform
Automate your spreadsheet tasks with AI power
Take a free 3-minute scan and get personalized AI skill recommendations.
Take free scan