js/commands/mcp
js/commands/mcp.ts
fino:commands/mcp — serve the workspace tools to an MCP client.
fino mcp lets an MCP-compatible client — an editor, a desktop assistant,
another agent — use fino:ai/tools against one directory. It is a thin
binding: createWorkspaceTools() mounted on mcpServer() and served either
over this process's stdin and stdout with streamTransport(), or with
--http as a Streamable HTTP endpoint from httpHandler(). There is no
second server implementation behind either.
Boundaries
- Every tool is bounded by a filesystem grant of the workspace root
(
--root, default the current directory): reads and writes outside it are refused, andshellruns under the strict process sandbox with that root writable and network denied, failing closed where strict mode is unavailable. --read-onlyserves onlylist_files,read_fileandsearch_files;--no-shellkeeps the file-editing tools but omitsshell.- Tools run without fino's own approval step. MCP clients confirm tool calls themselves, and a client has no way to answer a fino approval suspension.
- Over HTTP every request must carry
Authorization: Bearer <token>, where the token isFINO_MCP_TOKENor, when that is unset, a random token printed at startup. Requests from a browser origin other than the endpoint's own are refused, and the server binds127.0.0.1unless--hostsays otherwise.
Over stdio, stdout carries protocol traffic only and the command exits when the client closes stdin or the process is interrupted. Over HTTP, stdout reports the endpoint and the command serves until interrupted.
fino mcp --root ~/src/project
fino mcp --read-only
fino mcp --http --port 3090Constants
const command
Serve the workspace tool set over MCP until the client disconnects or the command stops.