lmmcp

lmmcp is a pure-Go Model Context Protocol (MCP) bridge and LMScript host exposing stdio, Streamable HTTP, and HTTP+SSE MCP servers over REST, CLI, and JSON-lines stdio. It provides typed _lmcode_ functions (mcp_server, mcp_call, mcp_read) alongside the 226 standard lmcode_std_v3 REST and CLI interfaces.

Quick reference

git clone https://github.com/lmctl-ai/lmmcp.git
cd lmmcp && CGO_ENABLED=0 go build -o lmmcp ./cmd/lmmcp
./lmmcp --version
./lmmcp --lmcode-schema
./lmmcp --lmcode-signatures
Interface or flagSignature or syntaxPurpose
CLI host bytecodelmmcp --config config.json --lmcode prog.dslbExecute compiled LMScript bytecode against configured MCP servers with dry-run preview and LMCODE_RETURN support.
CLI schema and signatureslmmcp --lmcode-schema [--json] | --lmcode-signaturesPrint embedded JSON schema or all 242 canonical host and lmcode_std_v3 signatures.
CLI MCP client actionslmmcp servers|tools|call|resources|read|templates|prompts|prompt (--config FILE | --url ORIGIN)Discover and invoke MCP tools, resources, templates, and prompts in-process or against a running lmmcp serve gateway.
CLI REST and stdio serverslmmcp serve --config FILE [--listen 127.0.0.1:8080] | lmmcp stdio --config FILE | lmmcp openapiServe the loopback HTTP REST gateway, concurrent JSON-lines REST over stdio, or print the OpenAPI 3.1 document.
MCPServer handlemcp_server(name: string) -> MCPServerAcquire a typed handle to a configured MCP server with .tools(), .call(), .resources(), .templates(), .read(), .prompts(), and .prompt() methods.
Global MCP functionsmcp_servers() | mcp_tools(s) | mcp_call(s, tool, Json) | mcp_resources(s) | mcp_templates(s) | mcp_read(s, uri) | mcp_prompts(s) | mcp_prompt(s, name, Json) -> JsonDispatch MCP discovery, tool execution, resource reads, and prompt rendering directly from _lmcode_ and receive {ok, data|error} Json envelopes.
Standard REST and CLIRestGet..RestOptions, RestHandler, CliCommand, CliOptionExpose _lmcode_ functions as HTTP routes (:param) or stateless CLI flags and commands via rest_serve and rest_cli.
p = _lmcode_ schema="examples/schema.json";
let srv = mcp_server("fixture");
let tools = srv.tools();
let reply = srv.call("echo", json_parse("{\"text\":\"hello from lmcode\"}"));

@"/call/:tool"
fn get_call(x: RestExchange) -> void implements RestGet {
  let res = mcp_call("fixture", x.param("tool"), json_parse("{\"text\":\"hi\"}"));
  x.json(res.to_json());
}

rest_config("session", "global");
let route_out = rest_cli(str_split("/call/echo", " "));
$return = json_parse("{\"direct\":" + reply.to_json() + ",\"route\":" + route_out + "}");
end _lmcode_
r = run_lmcode(p, {command: ["lmmcp", "--config", ARGV[0], "--lmcode", "$DSLFILE"]});
require(r.ok, json_stringify(r));

Documentation pages

Source repository and releases