MCP server
This site hosts a Model Context Protocol server at /mcp, so an AI agent adding collaboration
with Bit.Bcrdt reads the library itself - the compiled API documentation of its four packages, its guide,
its real CRDT engine and decoders, and these demo pages - instead of guessing at an API it half remembers,
or at what a merge will decide. Every tool is read-only.
Connect a client
The endpoint is plain Streamable HTTP, so any MCP client connects with a URL and nothing else:
https://bcrdt.bitplatform.dev/mcp, or http://localhost:5560/mcp while the demo runs
locally.
// .mcp.json (Claude Code, VS Code, and anything else reading this shape)
{
"mcpServers": {
"bcrdt": {
"type": "http",
"url": "https://bcrdt.bitplatform.dev/mcp"
}
}
}
Or from the command line, in Claude Code:
claude mcp add --transport http bcrdt https://bcrdt.bitplatform.dev/mcp
The server introduces itself on connecting - its name, the library's version and a short set of instructions put in front of the model before it calls anything - and offers completions for every argument that takes a name from a fixed list (a guide heading, a type, a source path, a hosting model), so a client can type ahead.
Tools
| Tool | What it answers |
|---|---|
SearchBcrdt |
Everything at once - the guide, every public member of the four packages, the setup guides and the demo sources - each hit with the exact follow-up call. |
GetBcrdtSetupGuide |
The complete wiring for one hosting model - web-app, standalone-wasm, server, hybrid, websocket or console - or the index of them. |
GetBcrdtGuideSection |
One section of the reference guide, or the index of sections. |
GetBcrdtApi |
One public type with its constructors, parameters, properties and methods, their real defaults and their documentation - or the index of types. |
InspectBcrdtMerge |
Runs the real engine on concurrent edits by two to four replicas, delivered in every order, and reports each one's state before the merge, what they converge to, every update's size, and what was decided for each contested key, text, list or set - one value wins for a map key, both survive in a text. One operation per line, such as A: map meta set title "Draft", B: text notes insert 0 "Hi" or B: set tags add "urgent"; base: lines build the shared starting point. |
InspectBcrdtUpdate |
Decodes an update or a protocol message - its kind, the blocks per client, the delete set, the state vector it implies and its sizes - or says why the library rejects it. |
GetBcrdtSourceFile |
One demo file verbatim - every page here is a set of real replicas merging for real - or the index of files. |
Start with SearchBcrdt when you do not know where an answer lives: every hit names the exact call
that returns its full text. Every tool called without its argument returns its index - the hosting models, the
guide's sections, the public types, the demo's files - and the two inspectors run a sample.
Resources and prompts
The same material is exposed as resources a client can attach to a conversation:
| Resource | What it holds |
|---|---|
bcrdt://guide | The whole reference guide; bcrdt://guide/{heading} one section of it, and each top-level section is listed on its own. |
bcrdt://api | The index of public types; bcrdt://api/{typeName} one type with its members. |
bcrdt://setup | The index of setup guides, one per hosting model. |
bcrdt://source/{path} | One of the demo's files, verbatim. |
And three prompts walk an agent through the common jobs in the right order: add-bcrdt-to-app
wires the library into an app of a given hosting model, implement-bcrdt-feature builds a
collaborative feature - choosing its data types first - and debug-bcrdt-sync diagnoses a problem:
edits that never arrive, one person's typing lost, clients disconnecting, presence that lingers.
The same tools over plain HTTP
Every tool is also a GET under /api/mcp/...: open one in a browser tab to read
exactly what an agent is handed.
- /api/mcp/SearchBcrdt?query=concurrent map writes
- /api/mcp/GetBcrdtSetupGuide?hostingModel=server
- /api/mcp/GetBcrdtGuideSection?heading=Choosing a data type
- /api/mcp/GetBcrdtApi?typeName=BcrdtCollaborativeDocument
- /api/mcp/InspectBcrdtMerge (runs a sample merge)
- /api/mcp/InspectBcrdtMerge?operations=A: map meta set title "Draft"; B: map meta set title "Final" (two writes to one key)
- /api/mcp/InspectBcrdtUpdate (decodes a sample)
- /api/mcp/GetBcrdtSourceFile?path=Demo/Client/Pages/Live.razor