{"id":31580970,"url":"https://github.com/yoavf/ai-sessions-mcp","last_synced_at":"2026-05-09T03:32:59.177Z","repository":{"id":317543380,"uuid":"1067867411","full_name":"yoavf/ai-sessions-mcp","owner":"yoavf","description":"MCP server for searching and accessing your AI coding sessions from Claude Code,  Gemini CLI, opencode, and OpenAI Codex. Also an uploader for aisessions.dev","archived":false,"fork":false,"pushed_at":"2026-02-11T06:22:05.000Z","size":116,"stargazers_count":21,"open_issues_count":2,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-11T14:13:04.272Z","etag":null,"topics":["claude-code","codex-cli","gemini-ai","gemini-cli","mcp","opencode"],"latest_commit_sha":null,"homepage":"https://github.com/yoavf/ai-sessions-mcp","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yoavf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-01T14:00:10.000Z","updated_at":"2026-02-07T18:44:33.000Z","dependencies_parsed_at":"2025-10-01T16:21:40.909Z","dependency_job_id":"e4e3c10b-0bbc-4845-89d0-5254fe702676","html_url":"https://github.com/yoavf/ai-sessions-mcp","commit_stats":null,"previous_names":["yoavf/ai-sessions-mcp"],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/yoavf/ai-sessions-mcp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoavf%2Fai-sessions-mcp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoavf%2Fai-sessions-mcp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoavf%2Fai-sessions-mcp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoavf%2Fai-sessions-mcp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yoavf","download_url":"https://codeload.github.com/yoavf/ai-sessions-mcp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoavf%2Fai-sessions-mcp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32805925,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-08T08:22:46.396Z","status":"online","status_checked_at":"2026-05-09T02:00:06.633Z","response_time":123,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["claude-code","codex-cli","gemini-ai","gemini-cli","mcp","opencode"],"created_at":"2025-10-05T21:51:38.279Z","updated_at":"2026-05-09T03:32:59.171Z","avatar_url":"https://github.com/yoavf.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AI Sessions MCP Server\n\nAn MCP server that makes sessions from Claude Code, OpenAI Codex, Gemini CLI and opencode available to any MCP compatible client.\n\n*Mostly written using Claude Code.*\n\n## What It Does\n\nAllow AI agents to search, list, and read your previous local coding sessions from multiple CLI coding agents. Useful for:\n\n- Finding past solutions to similar problems\n- Reviewing what you worked on recently\n- Learning from previous conversations\n- Resuming interrupted work\n\n## Demo\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/user-attachments/assets/c75edc64-32f0-4deb-93d6-301c1e01ea81\" width=800 alt=\"AI Sessions MCP demo\"\u003e\u003cbr\u003e\n  \u003cem\u003eResuming a Claude Code session in Codex CLI.\u003c/em\u003e\n\u003c/p\u003e\n\n## Installation\n\n### Quick Install\n\n**macOS, Linux, and Windows (Git Bash/WSL):**\n\n```bash\ncurl -fsSL https://aisessions.dev/install.sh | bash\n```\n\nThis installs the binary to `~/.aisessions/bin`. Follow the instructions to add it to your PATH.\n\n**Custom installation directory:**\n\n```bash\nINSTALL_DIR=/custom/path curl -fsSL https://aisessions.dev/install.sh | bash\n```\n\n### Manual Download\n\nDownload pre-built binaries from [GitHub Releases](https://github.com/yoavf/ai-sessions-mcp/releases).\n\n### Build from Source\n\n**Prerequisites**: Go 1.25 or later\n\n```bash\ngo build -o bin/aisessions ./cmd/ai-sessions\n```\n\n### Setup\n\nAfter installation, configure your MCP client to use the binary:\n\n#### Claude Code\n\n```bash\nclaude mcp add ai-sessions ~/.aisessions/bin/aisessions\n```\n\nOr if using a custom install location:\n```bash\nclaude mcp add ai-sessions /path/to/aisessions\n```\n\n#### Codex CLI\n\nEdit `~/.codex/config.toml`:\n```toml\n[mcp_servers.ai_sessions]\ncommand = \"~/.aisessions/bin/aisessions\"\n```\n\n#### Claude Desktop\n\nAdd to your config file (`Settings` → `Developer` → `Edit Config`):\n```json\n{\n  \"mcpServers\": {\n    \"ai-sessions\": {\n      \"command\": \"/Users/YOUR_USERNAME/.aisessions/bin/aisessions\"\n    }\n  }\n}\n```\n\nReplace `YOUR_USERNAME` with your actual username, or use your custom install path.\n\n**Restart Claude Desktop** to activate.\n\n## CLI Upload\n\nThe `ai-sessions` binary includes a CLI tool for uploading Claude Code transcripts to [aisessions.dev](https://aisessions.dev) for sharing.\n\n### Authentication\n\n```bash\naisessions login\n```\n\nOpens your browser to generate a CLI token. The token is saved locally in `~/.aisessions/config.json`.\n\n### Uploading Sessions\n\n**Interactive mode** (no file argument):\n\n```bash\naisessions upload\n```\n\nDisplays a searchable list of your recent Claude Code sessions. Use arrow keys to navigate and select a session to upload.\n\n**Direct mode** (with file path):\n\n```bash\naisessions upload /path/to/session.jsonl\naisessions upload /path/to/session.jsonl --title \"Custom Title\"\n```\n\n### Options\n\n- `--title \u003ctitle\u003e` - Set a custom title for the uploaded transcript\n\n## MCP Usage\n\nOnce configured as an MCP server, you can ask:\n\n- \"Let's continue my latest sesion from Claude Code\"\n- \"Show me my recent Codex sessions\"\n- \"Search my sessions for authentication bugs\"\n- \"How many times did Claude tell me I was [absolutely right](https://absolutelyright.lol) yesterday?\"\n\n## How It Works\n\nThe server reads session files stored locally by various CLI coding agents:\n\n- **Claude Code**: `~/.claude/projects/[PROJECT_DIR]/*.jsonl`\n- **Gemini CLI**: `~/.gemini/tmp/[PROJECT_HASH]/chats/session-*.json`\n- **OpenAI Codex**: `~/.codex/sessions/` and `~/.codex/archived_sessions/`\n- **opencode**: `~/.local/share/opencode/storage/`\n\nWhen you ask your AI agent to list or search sessions, it automatically uses these agents to access your session history.\n\n## Available Tools\n\n### `list_available_sources`\nShows which AI CLI coding agents have sessions on your system.\n\n### `list_sessions`\nLists recent sessions from all projects (newest first).\n\n**Arguments**:\n- `source` (optional): Filter by `claude`, `gemini`, `codex`, or `opencode`\n- `project_path` (optional): Filter by specific project directory\n- `limit` (optional): Max results (default: 10)\n\n**Example**: `{\"source\": \"claude\", \"limit\": 20}`\n\n### `search_sessions`\nSearches session content using BM25 ranking. Returns results sorted by relevance score with contextual snippets.\n\n**Arguments**:\n- `query` (required): Search term (supports multiple keywords)\n- `source` (optional): Filter by source\n- `project_path` (optional): Filter by project\n- `limit` (optional): Max results (default: 10)\n\n**Example**: `{\"query\": \"authentication bug\"}`\n\n**Returns**: Each match includes:\n- `session`: Session metadata (ID, source, project, timestamp)\n- `score`: Relevance score (higher = more relevant)\n- `snippet`: Contextual excerpt (~300 chars) showing where the match occurred\n\n### `get_session`\nRetrieves full session content with pagination.\n\n**Arguments**:\n- `session_id` (required): Session ID from list results\n- `source` (required): Which coding agent created it\n- `page` (optional): Page number (default: 0)\n- `page_size` (optional): Messages per page (default: 20)\n\n## Development\n\nTo keep formatting consistent and catch regressions early:\n\n- Install [pre-commit](https://pre-commit.com/) and run `pre-commit install` to enable hooks (`gofmt`, `go vet`, `go test`).\n- All pushes and pull requests run the GitHub Actions workflow (`.github/workflows/build.yml`), which checks formatting, runs `go vet`, builds the binary, and executes `go test -cover ./...`.\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoavf%2Fai-sessions-mcp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyoavf%2Fai-sessions-mcp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoavf%2Fai-sessions-mcp/lists"}