• Жильцов Дмитрий Андреевич's avatar
    Mcp: the machines ask God, and the Temple answers in HolyC
    · 6ea526ef
    The machines of the age want to talk to God too.  HtServ now takes
    POST /mcp, the Model Context Protocol, JSON-RPC 2.0 over Streamable
    HTTP without the stream.  Two tools:
    
      oracle      a verse of the KJV, picked by the Holy Spirit from the
                  moment the question arrives, or the verse you name
      god_words   words from Terry's God vocabulary, like F7
    
      claude mcp add --transport http temple http://temple.pushamp.com/mcp
    
    Written in HolyC, in Adam, Adam/Net/Mcp.HC.  The JSON parser is fifty
    lines, depth capped at 32 so a stranger's thousand brackets do not eat
    the stack.  initialize, ping, tools/list, tools/call.  Notifications get
    202, GET /mcp gets 405, God has no news feed.  No sessions, no batches,
    no password: both tools only read, and what they read is public domain
    since 1611.  No HTTPS, so claude.ai cannot come in.  Claude Code can.
    
    god_words does not use GodBits.  When God's fifo runs dry GodBits pops
    up a window and waits for a keystroke, and nobody sits at a web server
    to press it.  Each word comes from the timer at the moment it is picked.
    
    The oracle's Bible is now shared.  OracleInit takes a lock and keeps
    verses at 0 until the index is whole, two MCP sessions asking at once
    would otherwise divide by zero.  OracleFindRef reads "John 3:16".
    
    HtServ learned POST for /mcp only, Content-Length, 411 and 413 above
    16 KB.  OPTIONS and friends used to be refused once per header line,
    each line taken for a new request.  Now once, with a 405.
    
    DD_OS_NAME_VERSION is a DolDoc define, not a string.  Put in code it
    became bare words, TempleOS V5.1 EE, and the boot stopped in the
    debugger with Invalid lval.  Define("DD_OS_NAME_VERSION") is the string.
    
    Tested in QEMU: the full ISO boots with Mcp in Adam.  A test client
    covered initialize with known and unknown versions, notifications,
    ping, tools/list, random and named verses, unknown verses, god_words
    with 1, 3, 64, 1000 and -5, unknown tools and methods, batches, parse
    errors, deep nesting, escaped strings, 413, 405 for GET and OPTIONS.
    The MCP Inspector CLI went 9 for 9 on tools/list and both tools.
    
    QEMU's user networking resets the second of two connections opened in
    the same millisecond before the Temple ever sees it.  The capture shows
    those SYNs never arrive.  MCP clients open a GET and a POST at once, so
    locally they go through a proxy.  The server on the internet takes both.
    6ea526ef