Metadata MCP Server
The BimlFlex Metadata MCP Server is a Model Context Protocol (MCP) server over a BimlFlex file-mode metadata store. It speaks MCP over stdio and exposes read tools an agent can use to explore the store (entity enumeration, addressed lookup, text search, store-level settings and conventions, lineage traversal, and full store validation) plus exactly one guarded write path, propose_changes, which records a validated batch of edits as a new git branch for human review and never touches your checkout.
Two properties define the server:
- It is a deterministic metadata tool surface. The server makes no LLM calls and no network calls of any kind at runtime; its only I/O is the store directory it is pointed at and its own stdin/stdout. It has no drafting intelligence of its own: it is tooling that an agent (or any MCP client) drives.
- Your checkout is never written. The read tools write nothing at all.
propose_changeswrites exactly one thing: a new git branch (objects plus one ref) inside the store repository's.gitdirectory. The working tree, index, and checked-out branch are byte-identical before and after every call, including every failure path.
All store parsing, validation, and identity derivation goes through the BimlFlex metadata file-format engine: the server never re-implements format rules, and it surfaces the engine's own diagnostics.
The server targets file-mode metadata stores by design, not as an interim limitation: file mode is the direction for BimlFlex metadata, and this tool surface is built for it.
Connecting a client
The server ships inside the BimlFlex x64 installer, which installs it in the Mcp folder of the BimlFlex application as BimlFlex.Mcp.exe, and as a dotnet tool package that you build yourself from the repository. The installation page covers both channels. Building the tool package requires the repository and its documented prerequisites. From the repository root:
dotnet pack src/BimlFlex.Mcp -c Release -o ./artifacts
dotnet tool install Varigence.BimlFlex.Mcp --tool-path ~/.bimlflex-mcp --add-source ./artifacts
That places a self-contained bimlflex-mcp executable at ~/.bimlflex-mcp/bimlflex-mcp (the metadata engine assemblies ride inside the package).
Point your MCP client at the absolute path to the executable, BimlFlex.Mcp.exe in the Mcp folder or the bimlflex-mcp tool, with the store root (the directory containing bimlflex.json) as the --store argument. For example, in an .mcp.json client registration:
{
"mcpServers": {
"bimlflex": {
"command": "/path/to/.bimlflex-mcp/bimlflex-mcp",
"args": ["--store", "/path/to/metadata-store"]
}
}
}
The tools
Nine tools, in the order an exploration usually runs:
list_entities: enumerate the store's entities, optionally by kind, with identity and parent.get_entity: one full entity document by name or uid: every property, references resolved.search_metadata: case-insensitive text search over entity names and text-valued properties.get_settings: the store'sSettingentities as full documents.get_conventions: the store manifest's header and conventions block.validate: re-read the store from disk and return the engine's full diagnostic report (the edit-then-recheck loop).get_lineage: traverse the authored-reference graph upstream or downstream from one entity (downstream is the impact set of a change).propose_changes: apply a validated batch of edits as a new git branch in the store repository for human review; the checkout is never touched.render_rules_sql: render the view SQL of a View object's rule set through the BimlFlex rules library, the SQL the Rules Editor shows; read-only, and a licensed capability.
Every tool returns a single JSON document with stable field names, and orderings are deterministic throughout.
The edit-then-recheck loop
The read tools serve a catalog loaded once at startup. Changes made to the store files while the server is running are not observed by them; restart the server to refresh the catalog.
The validate tool is the deliberate exception: it re-reads the store from disk on every call and always reflects the current on-disk state. That is what makes the edit-then-recheck loop work: change files on disk, call validate, fix what it reports, and call it again; no restart needed for validation, only for the other read tools to see the new state.
validate returns the engine's own diagnostics at every severity (errors, warnings, and infos, not just errors) with structured attribution fields (code, severity, file, and related file where relevant). A store the engine refuses to load does not take the server down: the read tools return an error result carrying the load diagnostics, while validate answers a refused store with the full report, because a refused store is exactly what it exists to diagnose.
Diagnostic code values (BFXF…) come from the engine's catalog, which can grow over time. Treat codes as opaque stable identifiers, and never depend on message wording.
Proposing changes for review
propose_changes is the server's single write path, and it fails closed. It applies a batch of change operations (upsert and delete) to a fresh snapshot of the on-disk store, validates the result through the engine, and, only on clean validation, commits the emitted store to a new git branch in the store repository. The batch is whole-batch-atomic: any refused operation rejects the entire batch, and a proposal that would not validate is never committed anywhere. The branch's parent is the repository's current HEAD commit, and the snapshot's file layout is preserved so the branch diff reads as the change.
The review workflow is ordinary git: the agent proposes, a human reviews the branch diff, and merges or deletes the branch with normal git tooling.
One review caveat: the proposal branch carries the store alone. Non-store files committed in the repository (a README, .gitignore, CI configuration) are absent from the branch tree, so a raw branch-vs-HEAD diff shows them as deletions, and a plain git merge of the branch would delete them from the checkout. Review the store paths and apply them selectively (for example git checkout <branch> -- <store paths>, or a cherry-pick) rather than merging the branch wholesale when the repository carries such files.
Modeled business rules
The render_rules_sql tool renders the view SQL of a View object's rule set, the SQL the Rules Editor shows, and writes nothing. Its entity input names the View object, an Object whose object type is TBV, by name or by uid. The rule set is read from the rule records under the View object: the rule-sets collection, and under each rule set its rules and references collections. The dialect input is optional. Without it, the SQL is rendered for the system type code of the View object's connection. A named dialect is a preview and is rendered as given. FBRLH and every other code, and a connection with no system type, answer DIALECT_UNSUPPORTED in diagnostics. The codes that render, by family:
- T-SQL:
MSSQL,SQLDB,SQLMI,SQLDW,PDW,FBRDWandRDSMSSQL. - Snowflake:
SFLDW. - Spark SQL:
DBRandDBRDL.
Rendering is a licensed capability. It needs the BimlFlex product license, and reading the rule records with the read tools does not. The server loads the product key once at start from the Licensing settings file under the Varigence folder of the local application data root, and the VARIGENCE_LOCAL_APP_DATA variable overrides that root. When no entitled product key is found, the server licenses rendering from the entitlement of the person signed in to BimlStudio, read from the BimlStudio folder under the same Varigence folder, the way BimlStudio builds are licensed. An unlicensed server answers rules_unlicensed with no sql and the license reading in license. A server whose product key did not load answers rules_license_unread.
The answer carries the members of the product API's render response: sql, outputColumns, the references and misses, diagnostics, fingerprint, and the fork state in isForked and lastGeneratedSql. When the model cannot render, sql and fingerprint are null and diagnostics carries the findings, and that answer is not an error. When a rule is attached to a library rule, the answer also carries libraryRules, one entry per attached rule.
A propose_changes batch that creates, updates or deletes a rule set, rule or rule reference record under a View object saves that object's rule set as the product API's apply saves it, in the proposed branch. The same license gate applies: without an entitled key or a BimlStudio sign-in the whole batch is refused with rules_unlicensed or rules_license_unread, and nothing is written. The view SQL goes into the object's Source Create Sql under the fork rule. An object whose Source Create Sql was changed by hand since the last generate is marked forked, its SQL is not overwritten, and the rule records are written beside it. A forked object takes rule records only until a batch with returnToRules: true returns it to its rules. A model that renders no SQL saves nothing for that object, and the save answers RULES_NOT_SAVED in its diagnostics.
File-mode metadata stores
The server works against a BimlFlex file-mode metadata store: metadata stored as files on disk, with bimlflex.json at the store root. A git repository is a requirement of the propose_changes write path only, which records proposals as branches in the store repository. File mode is the direction for BimlFlex metadata, and the Metadata MCP Server is part of that direction: it is built for file-mode projects by design.