bc-source-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@bc-source-mcp find the Customer table in Business Central v27"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
bc-source-mcp
Serveur MCP (Model Context Protocol) qui expose les sources de Microsoft Dynamics 365 Business Central — toutes versions (BC v23 -> v29), toutes localisations (W1 + 47 pays), avec et sans vNext — a des agents IA comme Claude Code et Claude Desktop.
Vous voulez juste l'installer pour l'utiliser ? Voir INSTALL.md.
Donnees pompees du depot communautaire StefanMaron/MSDyn365BC.Sandbox.Code.History. Le serveur fait un partial clone (~1,6 Go au lieu de 50-100 Go) puis indexe les objets AL dans une base SQLite locale, ce qui permet des lookups a <100 ms.
A quoi ca sert
Pour un agent IA qui code en AL, devoir deviner la signature d'une procedure standard, le nom exact d'un event publisher ou la liste des champs d'une table BC est une cause majeure d'hallucinations. Ce MCP donne a l'agent un acces structure et verifie au code source BC, sans dependre de sa memoire d'entrainement.
Exemples d'usages typiques :
Trouver les
IntegrationEventa souscrire dansApprovals Mgmt.en v27Recuperer la definition exacte de la table
Customeren localisation FR vs W1Chercher tous les usages d'un motif de code a travers la Base Application
Comparer la presence d'un objet entre plusieurs versions
Related MCP server: bcquality-mcp
Les 14 tools exposes
Categorie | Tool | Description |
Decouverte |
| Liste les 545 branches du repo upstream |
Decouverte |
| Versions BC (23 -> 29, avec ou sans vNext) |
Decouverte |
| 47 codes pays + W1 |
Decouverte |
| Apps top-level d'une branche |
Decouverte |
| Objets AL filtres (type / app / pattern) avec pagination |
Decouverte |
| Presence d'un objet a travers les branches indexees |
Lookup |
| Source AL d'un objet (avec |
Lookup |
| Events publies par un objet ( |
Lookup |
| Procedure ciblee avec signature, body, attributes |
Recherche |
| Recherche regex via ripgrep, scope par app/type (avec timeout de 30s) |
Recherche |
| Full-text FTS5 cross-branch, syntaxe FTS5 (tokens, phrases, prefix*) avec snippets |
Admin |
| Re-fetch + re-index d'une ou toutes les branches |
Admin |
| Disk usage + branches indexees |
Admin |
| Suppression selective de worktrees |
Note : apres une mise a jour vers une version qui introduit l'index FTS5, les branches deja indexees ne sont pas automatiquement re-indexees. Lancez
bc_refreshsur les branches que vous voulez voir apparaitre dansbc_search_fts.
Installation
Voie 1 — via NPM (recommande)
Claude Code :
powershell claude mcp add bc-source-mcp -s user -- npx -y bc-source-mcp
Claude Desktop — editez %APPDATA%\Claude\claude_desktop_config.json :
json { "mcpServers": { "bc-source-mcp": { "command": "npx", "args": ["-y", "bc-source-mcp"] } } }
Le binaire bc-source-mcp est expose par le bin de package.json. npx -y recupere la derniere version a chaque demarrage (cache npm); pour epingler une version, utilisez bc-source-mcp@0.1.0.
Voie 2 — clone GitHub (pour contribuer)
powershell git clone https://github.com/glachana/bc-source-mcp.git cd bc-source-mcp npm install npm run build .\scripts\setup.ps1 -ClaudeCode -ClaudeDesktop
Guide utilisateur complet : INSTALL.md.
Configuration
Variables d'environnement utilisables (toutes optionnelles) :
Variable | Defaut | Description |
|
| Cache local (partial clone + worktrees + SQLite). ~2-5 Go selon les versions indexees. |
| StefanMaron/MSDyn365BC.Sandbox.Code.History | URL du repo upstream -- override si vous avez un fork |
|
|
|
Pour les passer a Claude Code : ajoutez -e KEY=VALUE a la commande claude mcp add. Pour Claude Desktop : ajoutez une cle env a l'entree mcpServers.
Maintenance
Il y a deux choses distinctes a garder a jour :
MAJ du serveur
Installation NPM :
npm install -g bc-source-mcp@latest(ou retirer le cache npx)Installation depuis Git :
.\scripts\update.ps1
Ensuite redemarrez Claude Code/Desktop.
MAJ des donnees BC en cache (sources upstream)
Independamment du code du serveur, vous voulez parfois rafraichir les sources BC en cache pour recuperer les derniers commits upstream (par ex. quand Microsoft publie un nouveau cumulative update).
Dans votre client MCP, demandez a Claude :
Avec
bc_refresh, rafraichis l'index de la branche w1-26.
Ou pour toutes les branches indexees :
Avec
bc_refreshsans parametre, rafraichis toutes les branches.
Le tool bc_cache_status vous donne a tout moment la taille disque + la liste des branches en cache.
Developpement
powershell npm install npm run build # tsc -> dist/ npm test # vitest npm run inspector # MCP Inspector pour tester en interactif
Tests : 54 unit tests sur les parsers AL (object header, events, procedures) et le branch resolver.
Architecture
Le serveur maintient un cache local sous ~/.bc-source-mcp/ :
~/.bc-source-mcp/ +-- repo/ Partial clone Git unique (--filter=blob:none, ~1,6 Go) +-- worktrees/<branch>/ Worktrees Git checkout-es a la demande +-- index.db SQLite : branches, apps, objects, event_publishers
A la premiere requete sur une branche (ex. w1-26) :
git fetch origin <branch>(blobs telecharges a la demande grace au partial clone)git worktree adddu checkout complet de la brancheWalk recursif de tous les
*.al-> parsing header + events -> insert SQLiteLookups ulterieurs : tout en RAM/SQLite, <100 ms
Branches du repo upstream : 545 (47 localisations x 7 versions, avec ou sans vNext).
Sur w1-26 : ~15 000 objets AL et ~22 000 event publishers indexes en ~10 s.
Stack
TypeScript + Node.js 20+
@modelcontextprotocol/sdk(transport stdio)better-sqlite3(index local)simple-git(partial clone + worktrees)@vscode/ripgrep(recherche full-text)
Contribuer
Issues et PR bienvenues sur https://github.com/glachana/bc-source-mcp.
Le projet utilise Conventional Commits + release-please pour le versioning et la publication npm automatiques. Lire CONTRIBUTING.md avant d'ouvrir une PR.
Roadmap d'ameliorations en cours : IMPROVEMENTS.md.
Licence
MIT (c) 2026 Gabriel Lachana.
Available Tools
14 toolsbc_cache_statusCache disk usage and indexed branchesARead-onlyIdempotent
Reports the total disk usage of the bc-source-mcp cache, the number of indexed branches, their object counts, and last fetch/index dates.
Inputs: no named parameters. Returns: cache_root, repo_size_mb, worktrees_size_mb, total_size_mb, +1 more
bc_find_object_across_branchesFind an object across indexed branchesARead-onlyIdempotent
Searches for an AL object (by type and exact name) across all branches that have already been indexed in this MCP instance. Use this to compare presence/path of an object across versions or localizations. Does not trigger indexing — call bc_list_apps on a branch first if you want to include it.
Inputs: type (required), name (required), branches. Returns: type, name, total, results
bc_get_event_publishersGet event publishers of an AL objectARead-onlyIdempotent
Lists all event publishers ([IntegrationEvent], [BusinessEvent], [InternalEvent]) defined inside a specific AL object. Returns the event name, kind, full procedure signature, attribute, and source line. Useful for finding events to subscribe to.
Inputs: branch (required), source_type (required), source_name (required). Returns: branch, source_type, source_name, total, +1 more
bc_get_objectGet the source of an AL objectARead-onlyIdempotent
Returns the AL source of a specific object (table, page, codeunit, report, enum, query, xmlport, or any extension). Identifies the object by branch + type + name (case-insensitive on type, exact on name). Triggers indexing on first use of a branch. Use line_start/line_end to fetch only a slice (1-indexed, inclusive) — useful for large objects (~100k lines). Use include_source=false to skip the source and get only metadata (size, total_lines).
Inputs: branch (required), type (required), name (required), line_start, +2 more. Returns: branch, type, id, name, +8 more
bc_get_procedureGet a specific procedure from an AL objectARead-onlyIdempotent
Returns the signature, body, attributes, and modifier of a named procedure within an AL object. Useful when you only need a single procedure rather than the full object source.
Inputs: branch (required), object_type (required), object_name (required), procedure_name (required). Returns: branch, object_type, object_name, path, +1 more
bc_list_appsList apps in a branchARead-onlyIdempotent
Lists top-level application folders in a given branch (e.g. "Base Application", "System Application", "Business Foundation"). If the branch has not been indexed yet, this triggers a first-time fetch + sparse-checkout + indexing (can take 1-5 minutes the first time).
Inputs: branch (required). Returns: branch, apps
bc_list_branchesList branchesARead-onlyIdempotent
Lists all branches available in the upstream BC sources repository (Stefan Maron mirror). Each branch corresponds to a (localization, version) pair, e.g. "w1-26", "fr-27-vNext". By default, meta/internal branches (main, base, core, serena) are filtered out. Set include_meta=true to include them.
Inputs: include_meta. Returns: total, branches
bc_list_localizationsList supported BC localizationsARead-onlyIdempotent
Lists the country/region codes available as branches in the upstream repository, with their human-readable names. "w1" is the worldwide base.
Inputs: no named parameters. Returns: localizations
bc_list_objectsList objects in a branchARead-onlyIdempotent
Lists AL objects in a branch, with optional filters by type, app, and name pattern. Use "*" as wildcard in name_pattern (translated to SQL LIKE %). Triggers indexing on first use of a branch.
Inputs: branch (required), type, app, name_pattern, +2 more. Returns: branch, total, offset, limit, +1 more
bc_list_versionsList supported BC versionsARead-onlyIdempotent
Lists the Business Central major versions for which sources are available in this MCP. Set include_vnext=true to also list the preview/-vNext variants.
Inputs: include_vnext. Returns: versions
bc_prune_cachePrune cached worktrees and index entriesA
Removes worktrees and index entries for branches not matching the keep filters. Pass keep_branches (explicit allowlist) or keep_versions/keep_localizations to retain only certain version/loc combinations. The partial-clone Git repo itself is never deleted.
Inputs: keep_branches, keep_versions, keep_localizations, dry_run. Returns: removed, kept, freed_mb, dry_run
bc_refreshRefresh branch indexAIdempotent
Re-fetches a branch from upstream and re-indexes it. If branch is omitted, refreshes every already-indexed branch sequentially.
Inputs: branch. Returns: refreshed, errors
bc_search_codeFull-text search in BC AL source codeARead-onlyIdempotent
Searches AL source code in a branch using regular expressions (ripgrep). Returns matching lines with optional context. Filter by object_type (file suffix, e.g. "table" → "*.Table.al") or by app (top-level folder). Triggers indexing on first use of a branch (for the worktree).
Inputs: branch (required), pattern (required), object_type, app, +3 more. Returns: branch, pattern, total_matches, matches, +1 more
bc_search_ftsFull-text search via FTS5 (cross-branch capable)ARead-onlyIdempotent
Token-based full-text search across indexed AL sources using SQLite FTS5. Faster than bc_search_code (no disk re-scan) and supports cross-branch queries. Use FTS5 syntax: bare terms ("Customer Posting"), phrases (""Sales Header""), boolean (term1 AND term2), prefixes (Cust*). Returns ranked snippets with matched tokens wrapped in <<...>>. For regex patterns, prefer bc_search_code.
Inputs: query (required), branches, app, object_type, +2 more. Returns: query, total, offset, limit, +1 more
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 14 tools
Each tool has a clearly distinct purpose. bc_search_code (regex) and bc_search_fts (token-based) are differentiated, as are bc_find_object_across_branches (cross-branch) and bc_list_objects (single-branch listing). No overlapping or ambiguous tools.
All tools use the consistent prefix 'bc_', followed by a verb like list, get, search, find, prune, refresh. The pattern is uniform (verb_noun or verb_preposition_noun), with bc_cache_status being the only slight deviation but still clear.
14 tools is well-scoped for the domain of Business Central source code management. Each tool addresses a specific need (listing, searching, fetching, cache management) without unnecessary redundancy or overload.
The tool surface covers read-only operations comprehensively: listing branches/versions/localizations/objects/apps, fetching source and procedures, searching, and cache management. A minor gap is lack of a direct diff tool between branches, but the core workflow is fully supported.
Maintenance
Related MCP Connectors
Hosted code graph over MCP: exact callers, dependencies, and cross-repo blast radius for AI agents.
Code intelligence for coding agents: semantic, AST, graph, and full-text search. 279+ languages.
Make your knowledge agent-ready. One MCP endpoint, 5 connectors, 3 search modes.
An MCP server that gives your AI access to the source code and docs of all public github repos
Related MCP Servers
- FlicenseNot gradedqualityCmaintenanceEnables AI clients to interact with Microsoft Dynamics 365 Business Central through MCP, providing access to customers, items, sales orders, and allowing creation of new records via natural language.2-
- AlicenseAqualityBmaintenanceExposes Microsoft BCQuality repository (Business Central development best practices) as structured tools for AI agents, enabling rule discovery, search, and application via MCP protocol.1014 npm1MIT
- AlicenseAqualityCmaintenanceModel Context Protocol (MCP) server for Microsoft Dynamics 365 Business Central. Provides AI assistants with direct access to Business Central data through properly formatted API v2.0 calls.61,639 npm10MIT
- AlicenseAqualityBmaintenanceEnables AI assistants to search, analyze, and understand multi-language codebases by providing indexed code intelligence via MCP.16630 npm8MIT