beingdb-mcp
beingdb-mcp lets MCP-capable clients such as VS Code Copilot query aBeingDB database. The connected LLM uses itstools to discover the database's schema, write queries, check them and run them.beingdb-mcp contains no LLM itself; it passes requests to BeingDB and returnsBeingDB's answers.
For development and testing, BeingDB and the MCP server both run locally on yourmachine. You only need a deployed server when you want to make the service availableto other machines or users.
Quick start
You need Node.js 22+ and a BeingDB checkout(with its OCaml tools, opam and dune) next to this repository:
git/
beingdb/
beingdb-mcp/
In one terminal:
cd beingdb-mcp
npm install
npm run beingdb:local
npm run beingdb:local builds the BeingDB checkout next to this one and serves thebundled demo data on 127.0.0.1:8080.
In a second terminal:
npm run dev
This starts the MCP server at http://127.0.0.1:3000/mcp. Stop either with Ctrl-C.
VS Code
↓
beingdb-mcp
↓
BeingDB
↓
local data
Everything in this setup runs on your own machine.
Connect VS Code
This repository includes a workspace MCP configuration, .vscode/mcp.json, so youdon't need to change MCP settings used by unrelated projects:
{
"servers": {
"beingdb": {
"type": "http",
"url": "http://127.0.0.1:3000/mcp"
}
}
}
Open the project in VS Code, start the beingdb MCP server from that file (or withMCP: List Servers), and use Copilot in agent mode.
If you previously configured a global BeingDB MCP server, disable or remove it whenusing this workspace configuration to avoid having two beingdb servers configured.
What it provides
beingdb_list_predicates: discover the schemabeingdb_resolve: find the stored values the names in a question refer tobeingdb_about: list everything about one valuebeingdb_diagnose_query: check a query and get diagnostics and proven repairsbeingdb_query: execute a querybeingdb_validate_query: validate a querybeingdb_explain_query: inspect its planbeingdb_get_facts: retrieve a predicate's factsbeingdb_status: check the connection
A typical session:
discover schema
↓
resolve the names in the question
↓
write query
↓
diagnose if needed
↓
execute
See docs/tools.md for details.
Tests
npm test
This runs the normal test suite locally and starts and stops its own BeingDBinstance; you don't need the Quick start servers running. npm run test:unit runsonly the unit tests, without BeingDB.
Using your own data
npm run beingdb:local -- --pack /path/to/pack_store
This serves your own compiled BeingDB pack instead of the demo data.
Deployment
The local setup above is intended for development and testing.
beingdb-mcp can also be deployed to a server when you want other machines or usersto access it. The same MCP tools are used; the MCP server simply connects to adeployed BeingDB instead of localhost:
VS Code / MCP client
↓
hosted beingdb-mcp
↓
hosted BeingDB
See docs/deployment.md.
Documentation
- docs/tools.md: tools, outputs, schema metadata, diagnostics and repairs
- docs/prompting.md: prompting an LLM to use BeingDB carefully, including a REWIND example
- docs/development.md: local setup details, configuration, tests and troubleshooting
- docs/deployment.md: hosting BeingDB and the MCP server
License
MIT