Module telegram-bot-lua.mcp
MCP (model context protocol) JSON-RPC server for telegram bot tools.
Functions
| api.mcp.handle(request) | handle a single MCP JSON-RPC request and return the response string. |
| api.mcp.serve(opts) | run the MCP server over stdio. |
Functions
- api.mcp.handle(request)
-
handle a single MCP JSON-RPC request and return the response string.
Parameters:
- request string|table a JSON string or decoded request table
Returns:
-
string JSON-RPC response, or nil for notifications
- api.mcp.serve(opts)
-
run the MCP server over stdio.
reads JSON-RPC messages line by line from stdin and writes responses to stdout.
Parameters:
- opts table optional overrides for input/output streams
- input file input stream (default io.stdin)
- write function write function (default io.write)
- flush function flush function (default io.flush)
- opts table optional overrides for input/output streams