npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@mb4it/bitrix-mcp

v0.6.0

Published

Local MCP server for Bitrix Framework references, LiveAPI indexing, and semantic documentation search.

Readme

Bitrix MCP

Русская документация

A local, token-free MCP server that indexes your Bitrix Framework / 1C-Bitrix project — PHP sources, templates, modules, install assets, and docs — so an AI assistant can search real project symbols and documentation. No Bitrix module to install, no runtime changes, no API token.

Works with any MCP-capable assistant: Cursor, Claude Code, Claude Desktop, PhpStorm/JetBrains AI, VS Code / GitHub Copilot, Windsurf, Cline, Roo Code, Continue, Gemini CLI, OpenAI Codex, and Kilo Code.

What it does

  • LiveAPI & symbol search — find functions, classes, methods, events, components, constants, and module include/check usage across your project and the Bitrix core.
  • Project, template & core indexing — index your own code, templates/components, and the Bitrix core separately and incrementally.
  • Documentation search — local Bitrix Framework docs as MCP resources, searched with SQLite full-text search (optional semantic search via a Python service).
  • Dependency graph & impact radius — query a Bitrix-aware graph of events, handlers, modules, agents, ORM entities, components, iblocks, options, and inheritance; see what a change affects.
  • Local & private — no token or Bitrix auth; access is just which local folders you expose.

Requirements

  • Node.js 22.12+ (uses node:sqlite) and npm 10+.
  • Linux, macOS, or Windows.
  • Disk access to the Bitrix project you want to index.
  • Network access for the first docs index (clones the official Bitrix docs; can be disabled).
  • Python 3.11+ only for optional semantic search.

Install

npm install -g @mb4it/bitrix-mcp
# or run without installing:
npx @mb4it/bitrix-mcp init

Windows / PowerShell

If PowerShell refuses to run the global bitrix-mcp command with cannot be loaded because running scripts is disabled on this system (UnauthorizedAccess / PSSecurityException), that is the Windows script execution policy blocking npm's bitrix-mcp.ps1 shim — not a problem with this package. Pick one:

# Recommended: allow local/signed scripts for your user (persistent, one-time)
Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy RemoteSigned

# Or bypass without installing / without changing policy:
npx @mb4it/bitrix-mcp init

# Or call the .cmd shim explicitly (works under the Restricted policy):
bitrix-mcp.cmd init

This only affects the one-time init you type yourself. The MCP server config that init writes already launches the server through cmd /c on Windows, so your MCP client (Cursor, Claude Code, …) starts it without any policy change.

Quick start

From the root of your Bitrix project:

# Configure your MCP client and build initial indexes.
# The client launches the server itself, so init doesn't start it.
npx @mb4it/bitrix-mcp init --agent cursor

init picks the current directory as the project root, configures the selected client(s), writes guidance/rule files, and indexes your project, templates, Bitrix core (if a local bitrix/ exists), and docs. Run it interactively to choose multiple clients, or pass --agent <id> / --all-agents / --yes.

Then open your AI client and ask it to use Bitrix MCP. A good first prompt:

Use Bitrix MCP to check index status, then find how this project registers sale module event handlers.

Everyday commands

bitrix-mcp index-all      # reindex everything: project, templates, core, install, docs
bitrix-mcp index-code     # reindex code only (no docs)
bitrix-mcp serve          # start the MCP server (your client normally does this)
bitrix-mcp status         # index counters and DB path
bitrix-mcp doctor         # health check and resolved paths

Index only specific Bitrix core modules for a much faster run:

bitrix-mcp index-bitrix --modules=main,iblock,sale,catalog

Skip the official docs download (offline / CI / first-run demos):

BITRIX_MCP_OFFICIAL_DOCS_ENABLED=0 bitrix-mcp index-all

→ Full command list, flags, and progress options: docs/cli.md.

How an AI agent should use it

Treat non-empty MCP results as authoritative for project symbols, framework APIs, event handlers, ORM entities, and docs. Fall back to manual grep/file reads only when MCP returns nothing, reports a stale index, or you ask for a manual check. This saves tokens and avoids hallucinations from partial file scans. (init writes this guidance into each client's rule file automatically.)

Recommended flow: bitrix_index_statusbitrix_project_overviewbitrix_liveapi_search / bitrix_docs_searchbitrix_read_file_context / bitrix_read_symbol_context.

MCP tools

Grouped overview (full reference with parameters and examples in docs/tools.md):

  • Index / statusbitrix_index_project, bitrix_index_template, bitrix_index_all, bitrix_index_docs, bitrix_index_status
  • Symbol & LiveAPI searchbitrix_liveapi_search, bitrix_event_search, bitrix_module_usage_search, bitrix_inheritance_search
  • Source contextbitrix_read_file_context, bitrix_read_symbol_context
  • Components & ORMbitrix_component_search, bitrix_component_context, bitrix_orm_search, bitrix_orm_entity_map, bitrix_orm_usage_search
  • IBlock / HLBlock / Options / Agents / Mailbitrix_iblock_usage_search, bitrix_hlblock_usage_search, bitrix_option_search, bitrix_agent_search, bitrix_mail_event_search
  • Graph & impactbitrix_relation_search, bitrix_graph_neighbors, bitrix_graph_traverse, bitrix_impact_radius, bitrix_detect_changes
  • Docsbitrix_docs_search, bitrix_docs_for_symbol, bitrix_explain_api_usage, and optional bitrix_semantic_docs_search
  • Overview / autoloadbitrix_project_overview, bitrix_autoload_search

Configuration

Common settings are environment variables — paths, the Bitrix root, official docs, and semantic search. init writes the ones your client needs into its MCP config.

BITRIX_ROOT                       # Bitrix project root for core indexing
BITRIX_MCP_DATA_DIR               # where indexes are stored (default .bitrix-mcp)
BITRIX_MCP_OFFICIAL_DOCS_ENABLED  # 0 to skip the official docs repo
BITRIX_MCP_SEMANTIC_ENABLED       # 1 to enable semantic docs search

→ All variables, the per-client config table, init/configure flags, and troubleshooting: docs/configuration.md.

Live database access (opt-in)

Query your project's MySQL database directly via MCP tools — read connection info, explore schema, and run SELECT queries. Credentials are parsed from bitrix/.settings.php; no separate auth needed.

BITRIX_MCP_DB_ENABLED=1         # enable database tools (default off)
BITRIX_MCP_DB_ALLOW_WRITE=1     # additionally allow INSERT/UPDATE/DELETE (default off)

Tools: bitrix_db_connections (list active connections, passwords redacted), bitrix_db_schema (tables and columns), bitrix_db_query (read-only SQL). Writes are opt-in: bitrix_db_execute (INSERT/UPDATE/DELETE) when BITRIX_MCP_DB_ALLOW_WRITE=1. Passwords are never returned. Intended for local development only. init prompts whether to enable DB access (default yes) and writes (default no); use --no-db and --db-allow-write to control it non-interactively.

Runtime PHP execution (opt-in)

Execute arbitrary PHP with the Bitrix kernel fully loaded via the bitrix_tinker tool — an MCP analog of Laravel Tinker. Get real runtime behavior, ORM queries, options, and module APIs instead of static analysis.

BITRIX_MCP_TINKER_ENABLED=1     # enable the tool (default off)
BITRIX_MCP_PHP_BIN=php          # path to PHP CLI binary (default php; should match site PHP version)

bitrix_tinker runs a PHP CLI subprocess that bootstraps bitrix/modules/main/include/prolog_before.php, so the full D7 API, ORM, Loader::includeModule, Option::get, and all Bitrix runtime context is available. Return a value with return <expr>;; echoed output and thrown exceptions are captured structurally. This is full code execution and write access on the local machine and bypasses the read-only guard of bitrix_db_query entirely. Enable it only on a trusted local development environment — never on shared or production machines. init prompts whether to enable it (default no); use --tinker to enable it non-interactively.

Documentation

Development

npm test
npm run typecheck
npm run build

License

MIT