Skip to main content

Module mcp

Module mcp 

Source
Expand description

bynk mcp — a stdio Model Context Protocol server (#2466).

The same read-only answers the VS Code language-model tools give (#2463), for any agent that speaks MCP: diagnostics, a symbol’s type and definition, a unit’s documentation, the project’s architecture, a handler’s wire contract, a diagnostic’s explanation, a project check, and a search of the Book. Each answers in compact Markdown with path:line:column locations (1-based, relative to the workspace), and every result is capped with a note on how to ask for less.

Where it lives (DECISION A). In the driver, calling bynk-ide and the project model directly rather than through bynk-lsp: an agent has no editor to hold a language server open, and a process that analyses on demand needs neither the LSP’s transport nor its async runtime. The cost is that the answers come from the files on disk, not from unsaved buffers.

Read-only (DECISION C). No tool writes, runs the compiler’s emitter, or reaches the network, and a file argument cannot name anything outside the workspace root (Workspace::resolve_file), so an agent steered by text it read cannot point a tool at another project.

Transport (DECISION D). Hand-written JSON-RPC 2.0 over newline-delimited stdio, ~100 lines (Server::handle), with no MCP SDK: the driver is synchronous and carries no async runtime, the protocol surface used here (initialize, ping, tools/list, tools/call) is small and stable, and an SDK would add a runtime and its dependency tree to every bynk install for it. See the ADR in design/pending/bynk-mcp.md.

Standard output carries protocol messages only; anything for a human goes to standard error.

Functions§

run
Run bynk mcp over the process’s stdin and stdout, serving path.