SX

srijanshukla18/xray

Developer tools

Эта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал

52 stars 9 forks Качество 84 Тренд 8MIT

srijanshukla18/xray является кандидатом на сервер MCP, импортированным из https://github.com/srijanshukla18/xray.

Обзор

srijanshukla18/xray является кандидатом на сервер MCP, импортированным из https://github.com/srijanshukla18/xray.

Обзор (машинный перевод)

** Сервер MCP, который позволяет агентам кодирования видеть форму кодовой базы - макет, подписи, определения, ссылки - без чтения целых файлов.

Почему

Кодирующие агенты уже имеют считывания grep, glob и файлов. Где сжигается контекст:

Читая 1500-строчный файл для изучения трех функциональных сигнатур. read_interface возвращает API файла — каждый класс, метод, функцию и тип с его подписью, однострочный док и номер строки — поэтому агент читает только нужные ему строки. **Получение имени и прохождение через комментарии, строки и частичные совпадения. ** find_symbol возвращает только определения, ранжируется, нечетко. what_breaks возвращает ссылки на идентификаторы с комментариями и исключенными буквами строк.

| | grep / rg | XRAY | LSP [скрыто] [скрыто] [скрыто] [скрыто] [[Т3]] [[Настройка]] [[Настройка]] [[Настройка]] [[Настройка]] [[Настройка]]] [[Настройка]] Найти только определения | | ✓ | ✓ | | Комментарии и строки Skips | | ✓ | ✓ | Файл API без тел | the | ✓ | частичные (символы документов) | | Типовые ссылки | | (наименование) | ✓ |

XRAY находится между ними: синтаксис-осведомленность через древостоятель, нулевая настройка на языке и честность в отношении неразрешающих типов.

##Установка

Эта страница переведена автоматически. Технические детали смотрите в оригинале.

README

Показан фрагмент оригинального README. Открыть оригинал.

XRAY

An MCP server that lets coding agents see a codebase’s shape — layout, signatures, definitions, references — without reading whole files.

Why

Coding agents already have grep, glob and file reads. Where they burn context is:

  • Reading a 1,500-line file to learn three function signatures. read_interface returns the file’s API — every class, method, function and type with its signature, one-line doc and line number — so the agent reads only the lines it needs.
  • Grepping a name and wading through comments, strings and partial matches. find_symbol returns definitions only, ranked, fuzzy. what_breaks returns identifier references with comments and string literals excluded.
grep / rg XRAY LSP
Setup none uv tool install a server per language
Finds definitions only ✗ ✓ ✓
Skips comments & strings ✗ ✓ ✓
File API without the bodies ✗ ✓ partial (document symbols)
Type-aware references ✗ ✗ (name-based) ✓

XRAY sits between the two: syntax-aware via tree-sitter, zero per-language setup, and honest about not resolving types.

Install

uv tool install git+https://github.com/srijanshukla18/xray

Then register the xray-mcp command with your client.

Claude Code

claude mcp add xray -s user -- xray-mcp

Claude Desktop, Cursor, VS Code, others — add to the client’s MCP config:

{ "mcpServers": { "xray": { "command": "xray-mcp" } } }

To run without installing: uvx --from git+https://github.com/srijanshukla18/xray xray-mcp.

There is also install.sh, which installs uv if needed and then runs the command above.

Tools

All paths in results are absolute. root_path is the project directory.

explore_repo(root_path, max_depth=None, include_symbols=False, focus_dirs=None, max_symbols_per_file=5)

Directory tree honouring .gitignore (via git ls-files, or a .gitignore parser outside git). Directories cut off by max_depth show their file count. Output is capped at 1,000 lines.

explore_repo("/home/me/xray", max_depth=2)

/home/me/xray/
├── src/
│   └── xray/ (6 files)
├── tests/
│   ├── __init__.py
│   └── test_xray.py
├── pyproject.toml
└── README.md

focus_dirs takes paths relative to the root; with include_symbols=True each file lists its signatures:

explore_repo("/home/me/xray", focus_dirs=["src/xray/core"], include_symbols=True, max_symbols_per_file=3)

/home/me/xray/
└── src/
    └── xray/
        └── core/
            ├── files.py
            │   ├── def list_files(root: Path) -> List[str]  # Return POSIX paths, relative to root, of every non-ignored…
Открыть полный README на GitHub

Установка

This server does not publish a one-line install command.

Open the repository installation guide Новичок в MCP? Начните с руководства на mcpskill.org →

Конфигурация

{ "mcpServers": { "xray": { "command": "xray-mcp" } } }