[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-81654":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":15,"subscribersCount":15,"size":15,"stars1d":15,"stars7d":16,"stars30d":16,"stars90d":15,"forks30d":15,"starsTrendScore":15,"compositeScore":17,"rankGlobal":9,"rankLanguage":9,"license":9,"archived":18,"fork":18,"defaultBranch":19,"hasWiki":20,"hasPages":18,"topics":21,"createdAt":9,"pushedAt":9,"updatedAt":22,"readmeContent":23,"aiSummary":24,"trendingCount":15,"starSnapshotCount":15,"syncStatus":16,"lastSyncTime":25,"discoverSource":26},81654,"lexis","R0MADEV\u002Flexis","R0MADEV","Lexical + structural code search MCP server for Claude Code, Cursor, Windsurf and any MCP client. Gives AI assistants 28 precise search tools so they find the right code fast 80% fewer tokens per task. No vectors, no embeddings, just ripgrep.",null,"TypeScript",23,5,21,4,0,2,40.53,false,"main",true,[],"2026-06-12 04:01:34","# lexis-mcp\n\nA code-search MCP server that gives AI coding assistants 28+ specialized tools to navigate large codebases — without burning tokens.\n\n**Result: ~80% fewer tokens per complex task** (measured on real bug investigations in a 500k-line PHP codebase: ~15,000 tokens → ~3,000).\n\n> **Status:** Validated on **Claude Code** (the only client tested in real workflows so far). Should work with any standard MCP client (Cursor, Windsurf, Continue, Cline, Zed, etc.) but those are **untested**. Issues and contributions welcome.\n\nNo vectors. No embeddings. No external services. Just ripgrep + AST symbol extraction + smart ranking.\n\n---\n\n## Install\n\n```bash\nnpm install -g lexis-mcp\n```\n\nThat's it. The postinstall:\n- Registers Lexis with Claude Code automatically (user scope, works in any project)\n- Writes usage hints to `~\u002F.claude\u002FCLAUDE.md` so Claude prefers Lexis over `Read`\u002F`Grep`\n- Bundles ripgrep — no extra dependencies\n\nFor other clients (Cursor, Windsurf, OpenCode, etc.):\n```bash\nlexis setup --global --client cursor      # prints the JSON to paste into your client config\nlexis setup --global --all                # prints config for all 10 supported clients\n```\n\n---\n\n## Why it exists\n\nLLMs are smart but not omniscient. When you ask Claude Code about a bug in a 100k-line codebase, it has two options:\n1. **Read whole files blindly** — burns tokens, often misses the cause\n2. **Use search tools** — fast and precise, but only if those tools exist\n\n`lexis-mcp` provides those tools. Claude Code calls them autonomously through MCP, gets exactly what it needs, and answers with a fraction of the context.\n\n---\n\n## Example: how a session looks\n\n**You** (in Claude Code, after `npm install -g lexis-mcp`):\n\n> *\"There's a bug — config files aren't being regenerated after updating the database records. The fix is somewhere around `ServiceClient::reloadCache`.\"*\n\n**What Claude does internally** (visible as tool calls in your session):\n\n```\n1. mcp__lexis__notes(query=\"reloadCache\")\n   → Recovers prior findings on this branch (none yet, first session)\n\n2. mcp__lexis__search_code(query=\"reloadCache\", context=\"bug\")\n   → Returns 3 ranked results in .\u002Fsrc and .\u002Fscripts\u002F\n   (~150 tokens vs 2,500 if Claude had read the files)\n\n3. mcp__lexis__get_symbol(name=\"reloadCache\")\n   → Returns just the function body (~120 tokens, no surrounding boilerplate)\n\n4. mcp__lexis__call_chain(symbol=\"reloadCache\", direction=\"upstream\")\n   → Identifies the lifecycle hook that triggers it\n\n5. mcp__lexis__find_writes(target=\"config\u002Fruntime.cfg\")\n   → Returns: a deploy-time script that writes the file\n   → \"config is written at deploy, not at runtime\"\n\n6. Claude reasons → root cause found\n```\n\n**What Claude tells you:**\n\n> The branch name suggests it fixes the config issue, but `reloadCache()` only reloads the in-memory cache via RPC — it does NOT regenerate the config file. The config is written by a deploy-time script, not at runtime. Two distinct mechanisms.\n\n**Then Claude saves the finding:**\n\n```\nmcp__lexis__note(\n  content=\"reloadCache() only reloads in-memory state, not the on-disk config.\n           Config is written by deploy script, no runtime regeneration path exists.\",\n  tags=[\"bug\", \"root-cause\"],\n  files=[\"src\u002F...\u002FServiceClient.php\", \"scripts\u002Fdeploy\u002Fconfig-writer\"]\n)\n```\n\nSix months later you reopen the branch — Claude reads that note immediately on session start. **Zero re-investigation.**\n\n**Token totals for this session:** ~2,800 tokens with Lexis vs ~14,000 if Claude had read those files directly.\n\n> *(Numbers measured on a real ~500k LOC PHP\u002Ftelecom codebase. Names anonymized.)*\n\n---\n\n## Supported clients\n\n> **Honest status:** Lexis is **validated on Claude Code** (real bug-fix and feature sessions in production projects). The other clients listed below should work because Lexis implements the standard MCP protocol — but **they have not been tested by us yet**. If you use one and it works (or breaks), please open an issue.\n\n| Client | Auto-register on install | Validation status |\n|---|---|---|\n| Claude Code | ✅ | ✅ Tested in real workflows |\n| Cursor | Manual (one config paste) | ⚠️ Untested — should work |\n| Continue.dev | Manual | ⚠️ Untested — should work |\n| Cline \u002F Claude Dev | Manual | ⚠️ Untested — should work |\n| Roo Code | Manual | ⚠️ Untested — should work |\n| Goose (Block) | Manual | ⚠️ Untested — should work |\n| Zed | Manual | ⚠️ Untested — should work |\n| OpenCode | Manual | ⚠️ Untested — should work |\n| Gemini CLI | Manual | ⚠️ Untested — should work |\n| Windsurf (Codeium) | Manual | ⚠️ Untested — should work |\n\n```bash\nlexis clients              # list all\nlexis setup --global --client \u003Cid>\n```\n\n---\n\n## What the AI gets\n\n28 tools across 8 output modes. Every tool is designed to return only what's relevant — never whole files unless asked.\n\n### Search & navigation\n\n| Tool | What it does |\n|---|---|\n| `search_code` | Smart search with ranking: exact-name matches first, src\u002F before tests\u002F |\n| `get_symbol` | Get a function\u002Fclass\u002Fvariable definition by name. Falls back to ripgrep for unsupported languages |\n| `find_references` | Find all usages of a symbol |\n| `find_file` | Locate files. Supports camelCase ↔ kebab-case ↔ snake_case equivalence and globs (`*.controller.ts`) |\n| `read_file` | Read a file slice (offset + limit). Shows the enclosing function\u002Fclass as header |\n| `list_symbols` | List symbols in a file. Falls back to ripgrep for non-supported languages |\n| `pattern_search` | Multi-pattern grep with AND\u002FOR logic |\n| `find_writes` | Find where a variable, field, or file path is mutated |\n\n### Architecture & flow\n\n| Tool | What it does |\n|---|---|\n| `call_chain` | Trace upstream\u002Fdownstream callers |\n| `list_entrypoints` | Discover routes, CLI commands, event listeners, crons |\n| `event_handlers` | Find event\u002Fhook\u002Fsubscriber registrations |\n| `interface_implementations` | Find classes that implement an interface or extend a base |\n| `impact_analysis` | Show what would break if a symbol changed |\n| `dead_code` | Find exported symbols with no references |\n\n### Context & history\n\n| Tool | What it does |\n|---|---|\n| `git_context` | Recent commits + diff for a file |\n| `recent_changes` | Files changed in the last N days |\n| `hot_files` | Files with the most commits (churn signal) |\n| `tests_for` | Find test files related to a source file |\n| `config_lookup` | Find config keys \u002F env vars by name |\n| `explain` | Summarize what a file or symbol does |\n\n### Persistence\n\n| Tool | What it does |\n|---|---|\n| `note` | Save a finding so future sessions inherit it |\n| `notes` | Recall past findings, filter by tag\u002Ffile\u002Fcontent |\n| `forget` | Delete a note |\n| `reindex` | Force a re-index — Claude can call this if results seem stale |\n\n### Output modes\n\n| Mode | Tokens\u002Fresult | Use when |\n|---|---|---|\n| `snippet` | ~15 | Orient yourself — match line ± 1 |\n| `compact` | ~50 | Default — signature + first body line |\n| `signatures` | ~20 | Browse an API without reading bodies |\n| `files` | ~5 | Just file paths |\n| `count` | ~3 | How many matches exist |\n| `content` | ~500 | Full implementation, when really needed |\n| `trace` | ~80 | Follow a call chain |\n| `arch` | ~30 | Architecture-level overview |\n\n---\n\n## Indexed languages and DSLs\n\n**General-purpose languages** (full AST symbol extraction):\nTypeScript, JavaScript, Python, Go, Rust, Ruby, Java, Kotlin, C#, PHP, C\u002FC++, Swift, Dart, Scala, Elixir, Perl, Bash\u002FShell.\n\n**Telecom DSLs** (built-in parsers — useful for VoIP\u002Fbilling backends):\n- **Kamailio** (`.cfg`) — `route[NAME]`, `failure_route[NAME]`, `event_route[NAME]`, etc.\n- **Asterisk dialplan** (`.conf`) — `[context]` blocks\n- **CGRates** (scoped JSON) — Profile IDs (`ATTR_*`, `FLTR_*`, `THD_*`, `RTE_*`...)\n\n**Framework awareness**: Symfony Routes (PHP attributes), React\u002FVue, Next.js, Laravel, Spring, Django\u002FFlask, Express, Nuxt.\n\n**Anything else**: tools that depend on the symbol graph fall back to ripgrep with universal definition patterns (`def`, `fn`, `class`, `module`, etc.) so they still return useful results in unsupported languages.\n\n---\n\n## How it compares to other MCPs\n\nHonest comparison — not every MCP is trying to do the same thing.\n\n| MCP | Approach | Best for | Limit |\n|---|---|---|---|\n| **lexis-mcp** | Lexical + structural via ripgrep + AST. Pre-builds a symbol index. 28 specialized tools. | Searching, navigating, and understanding existing code. Bug investigation, feature planning. | Matches by names\u002Ftokens, not concepts — finds \"AuthService\" but won't infer \"user identity\" without keyword overlap |\n| **filesystem MCP** (official) | Generic read\u002Fwrite of files | Reading\u002Fwriting files where the AI already knows the path | No search, no symbol extraction, no ranking |\n| **Serena** | Uses LSP (Language Server Protocol) per language | Maximum precision (real type info, real refs) | Requires LSPs installed and running per language; heavier setup |\n| **Repomix** | Bundles the entire repo into one big file for the LLM | Small repos that fit in context | Opposite of token-efficient on large repos |\n| **Context7** | Remote SSE server for library documentation | Looking up API docs of public packages | Doesn't index your project code |\n\n**When to use Lexis:**\n- Large codebases where reading whole files is wasteful\n- Multi-language \u002F multi-stack projects (e.g., PHP + Asterisk + Kamailio)\n- You want zero per-project setup once installed globally\n- You don't want native dependencies or embedding databases\n\n**When NOT to use Lexis:**\n- Tiny codebases — Repomix or just `Read` is fine\n- You need real type-checked references — Serena (LSP) is more precise\n- You only need to look up library docs — use Context7\n\n---\n\n## How it works\n\n1. **Index** — `lexis` scans the project, extracts symbols using language-specific parsers, stores a compact JSON in `~\u002F.lexis\u002Fprojects\u002F\u003Cslug>\u002Findex.json`.\n2. **Auto-refresh** — every 30 seconds the MCP server checks file mtimes; if anything changed it re-indexes incrementally (sub-second on most projects).\n3. **Search** — when a tool is called, results are ranked: exact-name matches first, `src\u002F`\u002F`lib\u002F`\u002F`app\u002F` over `tests\u002F`\u002F`vendor\u002F`\u002F`docs\u002F`, shorter paths over longer ones.\n4. **Cache** — recent results are LRU-cached for 5 min to avoid re-running expensive searches across iterative calls. Cache is wiped automatically on re-index.\n\n**Modular parsers**: each language lives in `src\u002Fcore\u002Fparsers\u002F\u003Clang>.ts`. Adding a new DSL is 3 lines: a regex file, an import, an extension. See `src\u002Fcore\u002Fparsers\u002Fkamailio.ts` for the simplest example.\n\n---\n\n## Persistent memory across sessions\n\nLexis remembers context between sessions through **notes** — markdown files\nauto-organized by git branch. When you open Claude Code on a feature\u002Fbug\nbranch, Lexis injects the relevant past notes directly into the AI's\ninstructions, so it inherits your previous conclusions without you typing them.\n\n### Folder structure\n\nNotes are categorized automatically by the current branch name:\n\n```\n~\u002F.lexis\u002Fprojects\u002F\u003Cyour-project>\u002F\n  bugs\u002F\n    fix-cache-invalidation.md\n    JIRA-1234-payment-flow.md\n  features\u002F\n    feature-multi-tenant-auth.md\n    feature-new-billing-flow.md\n  others\u002F\n    no-branch.md          ← when not in a git repo\n    legacy-notes.md       ← migration of pre-0.6.0 flat notes\n```\n\n| Branch pattern | Goes to |\n|---|---|\n| `fix\u002F...`, `bugfix\u002F...`, `hotfix\u002F...`, `JIRA-1234`, `BUG-...` | `bugs\u002F` |\n| `feature\u002F...`, `feat\u002F...` | `features\u002F` |\n| `main`, `master`, `develop` | **No notes saved** (active work hasn't started) |\n| Anything else | `others\u002F` |\n\n### Two types of notes\n\n**1. Manual notes** — created when Claude or you call `note(content, tags, files)`.\nThese hold curated knowledge: root causes, design decisions, ruled-out hypotheses.\nStrong MCP instructions push Claude to save these at decisive moments.\n\n```markdown\n## 2026-05-04 18:49 · mch8wy\n**Branch:** fix\u002Fcache-invalidation\n**Tags:** root-cause, bug\n\nThe fix branch is misleading — it does NOT regenerate the on-disk config.\nOnly reloads the in-memory cache via reloadCache(). The config file is\nwritten by a deploy-time script, only at service startup, not at runtime.\n```\n\n**2. Auto-session log** — written by Lexis automatically when the MCP server\nshuts down (Claude Code closes, Ctrl+C, SIGTERM, or unexpected crash). Captures\nmechanical activity: queries searched, symbols inspected, files read. Zero AI\ninvolvement, zero tokens consumed.\n\n```markdown\n## 2026-05-04 22:30 · auto-x9j2\n**Branch:** feature\u002Fmulti-tenant-auth\n**Tags:** auto-session\n\nDuration: 47 min · 43 tool calls\n\n**Searched:** `AuthService`, `tenantContext`, `RoleResolver`\n**Symbols inspected:** TenantManager, AuthService.login\n**Files read:**\n- src\u002FAuth\u002FAuthService.php\n- src\u002FTenant\u002FTenantContext.php\n```\n\n### When notes are loaded\n\n- **Session start (`initialize`)**: Lexis detects the current git branch, loads\n  the corresponding notes file, and injects up to 5 manual notes + 2 auto-session\n  logs into the MCP `instructions` field. Claude sees them on first response,\n  no manual recall needed.\n- **On demand**: `notes(query)` searches across all branches and categories.\n\n### Caveats and limits\n\n- Notes are saved on graceful shutdown (close, SIGINT, SIGTERM, SIGHUP).\n  `kill -9` or sudden power loss may drop the auto-session log of that session.\n- Manual notes are saved immediately when `note()` is called, so they survive\n  any kind of shutdown.\n- Notes belong to YOUR machine — they live in `~\u002F.lexis\u002F`, never in the repo,\n  never synced anywhere unless you choose to.\n\n---\n\n## Storage\n\nEverything lives in `~\u002F.lexis\u002F` — **never** inside your project repo:\n\n```\n~\u002F.lexis\u002F\n  projects\u002F\n    Users-you-myproject\u002F\n      index.json        ← symbol index (~300 KB for 1500 symbols)\n      bugs\u002F             ← see \"Persistent memory\" above\n      features\u002F\n      others\u002F\n```\n\nThe index migrates automatically if a legacy `.lexis-index.json` is found inside\nthe project. Likewise, pre-0.6.0 flat `notes.md` is migrated to\n`others\u002Flegacy-notes.md` on first access — no data loss.\n\n---\n\n## CLI reference\n\n```bash\n# Setup (one-time)\nlexis setup --global              # user-scope MCP, works in every project\nlexis setup --global --auto       # also auto-register with Claude Code\nlexis setup \u003Cpath>                # per-project setup (alternative)\nlexis setup \u003Cpath> --client cursor\n\n# Indexing (mostly automatic)\nlexis index \u003Cpath>                # incremental re-index\nlexis index \u003Cpath> --full         # full re-scan\n\n# Inspection\nlexis clients                     # list supported MCP clients\n\n# Optional\nlexis init \u003Cpath>                 # write CLAUDE.local.md (gitignored) with hints\nlexis ask \"\u003Cquestion>\" -p \u003Cpath>  # ask via CLI (requires API key)\n```\n\n---\n\n## Configuration\n\nLexis works with zero configuration. Optional environment variables:\n\n| Var | Purpose |\n|---|---|\n| `LEXIS_NO_AUTOSETUP=1` | Skip postinstall auto-registration |\n| `LEXIS_TOOL_RESULT_LIMIT` | Max results per tool (default: 20) |\n| `LEXIS_DEBUG=true` | Verbose logging on stderr |\n\n---\n\n## Requirements\n\n- Node.js 18+\n- ripgrep (bundled — no extra install needed)\n- An MCP-compatible AI client (Claude Code, Cursor, Windsurf, etc.)\n\nNo API key is required for MCP mode — the AI client provides the model.\n\n---\n\n## Quality\n\n- 68 tests covering parsers, indexer, MCP tools, ranking\n- CI on Linux, macOS, and Windows × Node 18 \u002F 20 \u002F 22\n- TypeScript strict mode\n- Zero runtime dependencies beyond bundled ripgrep + the official Anthropic \u002F OpenAI \u002F commander \u002F dotenv packages\n\n---\n\n## Contributing\n\nAdding a new language or DSL:\n1. Create `src\u002Fcore\u002Fparsers\u002F\u003Cname>.ts` exporting a `ParserPattern[]`\n2. Import + spread it in `src\u002Fcore\u002Fparsers\u002Findex.ts`\n3. Add the file extension to `SUPPORTED_EXTENSIONS` in `src\u002Fcore\u002Findexer.ts`\n4. Add a test in `src\u002F__tests__\u002Findexer.test.ts`\n\nSee `kamailio.ts` (10 lines) for a minimal example.\n\n---\n\n## License\n\nMIT\n","Lexis 是一个为AI编码助手设计的代码搜索MCP服务器，提供了28种以上的专业工具来高效地在大型代码库中导航，显著减少了每项任务所需的token数量约80%。该项目使用TypeScript编写，核心功能包括基于ripgrep的快速文本搜索、AST符号提取以及智能结果排序，不依赖向量或嵌入技术。它特别适用于需要对大规模代码库进行高效查询和分析的场景，如调试复杂问题时。目前主要验证了与Claude Code的兼容性，但理论上支持所有标准MCP客户端。","2026-06-11 04:05:50","CREATED_QUERY"]