On1x / MuLIB knowledge for ChatGPT
A read-only remote MCP server with an optional, private local stdio VM mode. The remote endpoint is not a compiler or safe-binding generator. Python 3.11+ standard library; no API key, pip package, vector store, telemetry, or outbound network access. The startup index is built from current canonical repository sources, never a checked-in hand-maintained kernel inventory.
Official integration choice (researched 2026-11-19)
Official OpenAI sources:
- MCP server / Apps SDK quickstart: tools may run without a UI; Streamable HTTP supports stateless JSON responses.
- Build an MCP server: tool schemas, read-only annotations, instructions, deployment and company knowledge compatibility.
- Connect and test: ChatGPT web custom-server registration, HTTPS or Secure MCP Tunnel, workspace permissions, installation and metadata refresh.
- Authentication: anonymous read-only data is supported; private data needs OAuth 2.1 enforcement; OpenAI-managed mTLS can authenticate ChatGPT as the client.
- MCP search/fetch compatibility: standard query/ID shapes, structured results and citation URLs.
- Portable package format:
root
plugin.jsonandmcp.json, Agent Plugins schemas, remotestreamable-httptransport. - GPT Actions: another supported form for custom GPTs, deliberately not duplicated here.
- Privacy/security.
The current documentation calls this a custom MCP server/plugin, following
the Apps SDK path. This is not the retired 2023 ai-plugin.json plugin API:
no legacy descriptor is provided or served. Tool metadata is discovered through
initialize and tools/list; no OpenAPI file is required for MCP.
Compatibility: MCP 2025-06-18 and 2025-11-25, Streamable HTTP with
application/json responses, stateless, no SSE listener. Newer clients can
negotiate the supported version. MCP 2.0 server/discover, events, tasks, UI,
resources and prompts are not implemented. The official
MCP Events page
distinguishes the newer MCP 2.0 flow from the still-supported initialization
flow; this service advertises only the latter. Real ChatGPT account/plan and
workspace availability must be checked at deployment.
Local check and startup
From the MuLIB root:
python3 -B on1x/addons/mcp/test_chatgpt.py
python3 -B on1x/addons/mcp/server.py --root "$PWD" --check \
--revision "$(git rev-parse HEAD)" \
--libstone-revision "$(git -C on1x/third_party/libstone rev-parse HEAD)"
python3 -B on1x/addons/mcp/server.py --root "$PWD"
The operator's shell, not the service, invokes Git in the example.
The knowledge service never reads Git internals or invokes any subprocess. Omit revision
arguments to report unknown, never a fabricated revision. --check prints a
deterministic fingerprint/size report and exits. --describe prints the actual
tool descriptors (also requires --root syntactically; it does not read it).
By default the server binds only 127.0.0.1:8787, accepting exact
Host: 127.0.0.1:8787 or localhost:8787. Setting --allowed-host replaces
those defaults, not the loopback bind. No CORS origins are allowed by default.
Its index is an in-memory startup snapshot; restart to observe source changes.
Use an operator-controlled frozen/read-only checkout, not a concurrently edited
tree, for deployment. Startup rejects missing required sources and malformed
metadata instead of publishing a partially built index.
Local protocol check:
curl http://127.0.0.1:8787/mcp \
-H 'Content-Type: application/json' \
-H 'Accept: application/json, text/event-stream' \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-11-25","capabilities":{},"clientInfo":{"name":"local-check","version":"1"}}}'
Subsequent POSTs use MCP-Protocol-Version: 2025-11-25. A
notifications/initialized notification gets HTTP 202 with no body;
tools/list lists all tools. There are no sessions or session cookies.
Private local VM sessions
An MCP client that launches a local stdio server can opt in to real ArchVirt VMs. The public HTTP server never advertises or accepts VM tools. Provision the runtime directory for the dedicated unprivileged service user:
sudo install -d -m 0700 -o "$USER" /var/run/on1x-mcp-vmm
Use an ArchVirt-enabled On1x build (see build instructions)
and the installed libexec/on1x/on1x-archvirt-run or its build-tree counterpart.
For a local MCP client, configure the equivalent of this child process:
python3 -B /absolute/mulib/on1x/addons/mcp/server.py --stdio \
--root /absolute/mulib \
--on1xc /absolute/bin/on1xc \
--archvirt-runner /absolute/libexec/on1x/on1x-archvirt-run
This requires Linux x86-64, accessible /dev/kvm, bubblewrap, and
prlimit from util-linux. --vmm-root overrides the default for development.
The directory must already exist, be mode 0700, and belong to the user.
Use a tmpfiles.d
entry or equivalent to provision it again after reboot if necessary.
| Tool | Arguments | Result |
|---|---|---|
vm_compile | source: standalone On1x text | Compile inside bubblewrap, start the guest, return its session-scoped ID |
vm_send | id, parameters: array of decimal i64 strings | Queue up to 64 parameters on the same VM; not a guest-processing acknowledgment |
vm_read | id | Drain pending stdout/stderr and report exit status and truncation |
vm_list | none | List this stdio session's VMs, including stopped or completed VMs |
vm_kill | id | Stop a VM and retain its output and image |
vm_delete | id | Stop a VM, delete its output and image, release the slot |
vm_invalidate | none | Stop and delete all VMs in this session; the connection may compile new VMs |
An interactive source declares extern fn on1x_archvirt_read_i64() -> i64;
and calls it once per parameter. Source is limited to 8 KiB UTF-8 and may
not import libraries, use PPX or declaration extensions, or call host
externs. Parameters are JSON strings so clients can transmit the exact
signed 64-bit range. Session IDs are not interchangeable with the compiler's
replay-cache IDs. Nothing is registered in that cache.
A waiting guest stays alive across calls and has no idle or total deadline
while its stdio connection is open. It may still return, trap, exceed the
five-second active interval, or hit the 1 MiB total output cap. Each session
owns up to four VMs and retains the latest 2 KiB per output stream between
reads. Each keeps a non-executable ELF in
/var/run/on1x-mcp-vmm/session-*/ID/guest.elf. EOF, SIGTERM and normal server
shutdown kill and reap its VMs and remove its directory. A server killed
with SIGKILL cannot delete its files, but the kernel kills its runners on
parent death. Only remove such leftover directories after confirming their
server processes are gone. For scope and limitations, see SECURITY.md.
Private graphics and interactive documents
Start the server with --stdio --graphics --root /absolute/path/to/mulib
to opt into graphics for a local MCP client. These tools are not exposed by
the public HTTP profile.
render_graphics(program, format)accepts a declarative drawing. Usesvgfor colorful geometric shapes and labels, orhtmlfor a standalone document with an optional keyboard-sortable bar chart. The tool returns a connection-localdocument_id.measure_text(text, font, size)returns an estimate in CSS pixels, not browser- or font-engine-calibrated metrics.display_graphics(document_id)returns a text summary and an embedded resource with the generated SVG or HTML. The MCP client decides whether to preview or export it; automatic rendering is not required.
For example, call render_graphics with:
{
"format": "svg",
"program": {
"width": 200,
"height": 100,
"background": "#19233A",
"shapes": [
{"type": "circle", "cx": 100, "cy": 50, "r": 28, "fill": "#35D0BA"}
]
}
}
No submitted JavaScript or HTML is evaluated. The interactive chart uses
fixed bundled JavaScript and a restrictive content security policy. Preview
HTML only in an isolated frame without allow-same-origin; render SVG as
an image, not by injecting its markup into the host page. Documents stay in
memory and are limited to eight per connection; nothing is posted to a web URL.
File search and private On1x compilation
Use search_files(query, mode, limit) to search the server's allowlisted
snapshot by path or content, then fetch an excerpt ID. The tool cannot
read a new path, search outside the snapshot, or open private project files.
Pass --stdio --compiler-on1xc /absolute/path/to/on1xc on Linux to enable:
compile_on1x(source, profile?): generate C11 text without linking it.inspect_on1x(source, phase, profile?): return a real S-expression forast(pre-PPX),hir(checked), ormir(verified). This requires a compiler with--emit-hirfor the HIR phase.
These tools accept standalone On1x text only. They use fail-closed
bubblewrap isolation, run as a non-root user, and do not run the generated
program. An operator can mount required trusted shared libraries individually
with --compiler-runtime; callers cannot select compiler flags or paths.
Private Cephyr C inspection
On Linux, run as a non-root user with bubblewrap and seccomp available:
python3 server.py --root /path/to/mulib --stdio \
--cephyr-bindings /path/to/Cephyr/python/cephyr/__init__.py \
--cephyr-library /path/to/libcephyr.so \
--cephyr-resource-root /path/to/Cephyr \
--cephyr-archon-root /path/to/Archon
Call cephyr_extract with source (standalone C11, up to 8 KiB of UTF-8)
and operation: parse_c11 returns an AST S-expression,
emit_interface returns the resolved semantic interface S-expression, and
emit_mir returns Cephyr's Archon MachineIR text. The target is fixed to
x86_64-linux-gnu; requests cannot set flags, read project or system
headers, or execute code. The server invokes the Python bindings in an
isolated child and fails closed if isolation is unavailable.
Deploy and connect in ChatGPT web
A local folder/ZIP is not a direct ChatGPT web installation and does not deploy this Python server. Run the service yourself; ChatGPT needs a reachable endpoint or an explicitly configured Secure MCP Tunnel.
-
Audit every allowlisted source for publication. Choose a frozen checkout. Run the tests and
--check; preserve its hashes and actual revisions. -
To install the loopback service on a Linux systemd host with Python 3.11+, run from the MuLIB checkout (with the server's SSH host key already trusted):
bash on1x/addons/mcp/deploy.sh root@server.example.org knowledge.example.orgThe installer saves the committed
HEADarchive under${TMPDIR:-/tmp}and uses local Python 3 to check it before connecting over SSH.deploy.sh,deploy_probe.py,server.py, andcore.pymust be present in that archive and match the working-tree files. Staging changes in Git is not enough, and local edits or untracked files are never shipped. Use an audited checkout whose committed archive contains the deployment files before retrying. Passingknowledge.example.orgapproves the allowlisted data for anonymous publication and configures the exact Host accepted by the backend. Deploy checksinitialize,notifications/initialized, andtools/listover loopback with that Host before keeping the new service. This mode does not install DNS, a TLS certificate, or an HTTPS proxy. A normal deploy without a public hostname installs a local-only backend unless--cloudflaredis requested. -
Put a maintained HTTPS reverse proxy in front of the loopback service. Enforce OpenAI-managed mTLS at that proxy to limit clients to ChatGPT (validate the documented chain, client-auth use and SAN; do not pin a leaf). Do not expose this stdlib HTTP backend to the public internet.
-
To run the anonymous backend manually instead of using
deploy.sh, use:python3 -B on1x/addons/mcp/server.py --root /srv/mulib \ --public-data --allowed-host knowledge.example.orgForward
Host: knowledge.example.orgunchanged, route only/mcp, usehttps://knowledge.example.org/mcpexternally. Do not trust arbitrary forwarded-host headers. Set proxy request/header size limits, connection/ concurrency/rate limits, TLS, and slow-client deadlines. Block outbound connections from the backend process. No proxy response-body/query logging. -
Private or unpublished sources are unsupported by the bundled anonymous configuration. Before using them, supply an independently reviewed OAuth 2.1 resource-server gateway with protected-resource metadata, PKCE, issuer/audience/expiry/scope enforcement on every request and proper MCP challenges/tool security metadata. Keep this backend unreachable except through that gateway. Changing
mcp.jsonalone does not implement OAuth. There is no builtin OAuth server, API-key hack, or token verification here. -
Test your HTTPS endpoint with MCP Inspector (optional external development tool, not a runtime dependency). Select Streamable HTTP, inspect every schema, positive/negative case and both
content/structuredContent. -
In current ChatGPT web: Plugins → plus → Add custom MCP server → enter the public HTTPS
/mcpURL, name, and No authentication for this anonymous configuration. Review the risk warning; Create as a plugin, install, start a new chat, type@, and select it. Workspace permissions apply. Older UI deployments may expose this under Apps/Connectors settings and developer mode. -
Refresh the connection after schema/description changes. Re-run evaluation prompts and inspect the actual tool arguments/results. Public directory submission additionally requires a stable public deployment, domain/publisher verification, support details and a published operator-specific privacy policy; the bundled sample metadata is not a completed submission.
Secure MCP Tunnel is another official connection method for eligible clients;
its agent/authentication are not bundled or launched here. Local direct
localhost URLs are for protocol testing, not an assertion that ChatGPT cloud
can reach your machine.
Temporary Cloudflare Quick Tunnel
For testing with publication-audited public data only, install a current
cloudflared on the remote systemd host, then run:
bash on1x/addons/mcp/deploy.sh --cloudflared root@server.example.org
Do not pass PUBLIC_MCP_HOST in this mode. The flag explicitly approves
anonymous publication: anyone with the URL can call the tools. The installer
starts a separate, unprivileged on1x-knowledge-tunnel.service and keeps the
backend bound to 127.0.0.1:8787 with an exact tunnel-origin Host. On success it
prints https://<assigned-name>.trycloudflare.com/mcp after testing MCP discovery
over certificate-verified HTTPS. Use the full URL in ChatGPT with No
authentication. This test does not verify ChatGPT workspace registration.
Stop the public endpoint with sudo systemctl stop on1x-knowledge-tunnel.service
on the server. The tunnel does not restart automatically or start at boot; a
normal redeploy stops the previous tunnel and produces a new URL if requested. If
startup or HTTPS discovery fails, the installer stops the new tunnel and rolls
back the backend deployment; it cannot restore a stopped temporary URL. For
diagnostics, run journalctl -u on1x-knowledge-tunnel.service on the server.
Quick Tunnels are not a production proxy, do not support SSE, and are distinct from the Secure MCP Tunnel. The addon uses JSON response mode; for stable or authenticated access, use a separately configured production proxy or tunnel.
Redeploy only the backend
bash on1x/addons/mcp/deploy.sh --backend-only root@server.example.org
This requires an existing installer-managed backend. It preserves the current
Host setting on 127.0.0.1:8787 and restarts only the backend, leaving
cloudflared and other reverse proxies unchanged. Do not combine it with
--cloudflared or PUBLIC_MCP_HOST. Audit the new committed sources for the
existing exposure: any public endpoint remains public. The backend may be
briefly unavailable during restart, and the installer checks discovery on
loopback only, not through the public URL.
Optional portable distribution
Packaging does not deploy the service:
sh on1x/addons/mcp/package.sh \
--endpoint https://knowledge.example.org/mcp \
--output /tmp/opencode/on1x-knowledge.zip
This creates a reproducible ZIP from an explicit addon-only file list, rewrites
the remote URL in mcp.json, includes no source inventory, secrets, caches,
build outputs or hooks, and refuses to overwrite an existing archive.
mcp.json in the source tree intentionally uses a nonworking .invalid host.
plugin.json/mcp.json follow the current portable Agent Plugins format,
not legacy ai-plugin.json; custom-server web registration does not need a ZIP.
Copying/extracting this addon anywhere works with an explicit --root.
The checkout, including allowlisted docs/catalogs, must remain available.
Tools and evidence semantics
| Tool | Inputs | Result |
|---|---|---|
search | query | Standard search results with excerpt IDs, titles, URLs |
fetch | id | Complete bounded indexed excerpt, source path/lines/hash |
search_on1x | query, optional limit | Language docs, examples and metadata |
explain_feature | query, optional limit | Evidence for an explanation, not generated prose |
search_kernels | query, optional limit | Canonical manifest names/purposes |
inspect_kernel | exact name | Manifest entry, switch, dependencies, header/manual/contract excerpts, independent status fields |
list_headers | optional query, offset, limit | Paginated kernels/mulib-*.h paths, file hashes and optional manifest names |
inspect_header | exact path, optional query or line | Cited source excerpts restricted to that header |
inspect_capability | query, optional limit | Scoped status/verification/blocker records |
Capability lookup searches the On1x completion ledger, capability matrix, KernelBind manual and subsystem verification records when present in the indexed revision. It cites those records; it does not run the tests itself.
Search is deterministic keyword token matching, not semantic search.
Use short identifiers/keywords; results rank matching tokens, then source path
and line. Kernel search AND-matches literal name/purpose substrings.
fetch IDs identify complete excerpts, not entire files; this intentionally
keeps the standard search/fetch shapes bounded. Search can find signatures
(mulib_clamp_i64), contracts, diagnostics, language features and examples.
Header text is not a C parser, ABI probe, contract proof, or safe binding.
No unvalidated serialized CDecl/pointer data is loaded.
Each excerpt has a relative canonical source path, one-based inclusive lines,
SHA256 of the complete source file, and a source URL. Every result also
carries the complete allowlisted snapshot fingerprint, operator-supplied
repository/LibStone revisions (or unknown) and a separate hash of available
allowlisted LibStone README/STATUS files, not a full LibStone tree hash.
All hashes use SHA256 and deterministic path ordering.
GitHub URLs refer to the operator's revision, or master when unknown.
They are revision references, not a claim that dirty worktree bytes exist at
that URL. Indexed hashes/text are authoritative for the snapshot. Publish
only a clean committed deployment checkout for public citation URLs that
exactly match source content. The service never contacts GitHub.
inspect_kernel separates:
- Discovery: manifest presence, not a callable API.
- Implementation: source manifest claim, not test execution.
- ABI:
NOT_CHECKED; target checks never run. - Contract: present/absent, exact header-pin match, never a certificate.
- On1x admission:
NOT_ESTABLISHED; production review is never inferred.
Follow cited KernelBind/capability documentation for narrow raw/review-gated
profiles; no production review is shipped by this service. Historical status
rows are preserved verbatim and may describe superseded profiles. Do not
combine an old ABSENT row with a newer executable profile or promote
EXECUTABLE/PARTIAL to VERIFIED. Budget exhaustion is a distinct error, never
a proof, impossibility result or timeout-as-proof.
Example evaluation prompts
- “Using On1x knowledge, explain
taskgroup withinand whether this is async/ await. Cite current docs and blockers.” - “Find the canonical clamp kernel. Show its implementation switch, dependencies and declared signature; distinguish that from On1x admission.”
- “Find the diagnostic
ON1X-KERNEL-NOT-ADMITTEDand explain the review gate.” - “What does the current capability matrix say about recursive unique owners? Separate executable scope from unsupported MIR/FFI cases.”
- “Discover CDD registry documentation. Does extraction certify a safe import?”
- Negative: “Run this On1x/compiler/PPX/kernel”, “read
/etc/passwd”, “fetch this URL”, “install a module”, “approve this contract”, or “search with regex”: none is supported.
Limits / troubleshooting
See security boundaries and measured verification. Queries: 256 characters, 16 distinct tokens; results: 1–10 (default 5); files: 4,096, total bytes: 32 MiB, file bytes: 1 MiB; chunks: 40,000, 24 lines/~3,500 UTF-8 bytes normally (one source line may reach 8,192 characters); postings visited/query: 100,000. HTTP body: 8 KiB, accepted headers: 16 KiB, JSON depth: 48, full serialized response: 64 KiB including duplicated MCP text/structured content. No silent partial index is returned.
No results: use exact identifiers or fewer keywords. RESULT_LIMIT/
WORK_LIMIT: narrow query/result count; the service does not claim exhaustive
knowledge. Startup INVALID_MANIFEST/INVALID_JSON/INDEX_LIMIT: repair canonical
metadata or review budgets offline, never relax input handling through prompts.
UNSAFE_SOURCE: replace symlinks with canonical regular files in the deployment
checkout. If ChatGPT refuses the connection, first check that the installer
succeeded and that the public HTTPS URL answers MCP POSTs through the proxy (or
tunnel). A loopback probe does not test public DNS, TLS/mTLS, proxy routing, or
workspace permissions. 403: review exact Host and Origin; do not enable wildcard
CORS. With the hostname above, add -H 'Host: knowledge.example.org' to the local
curl probe.
406: supply both MCP Accept types. GET 405 is intentional: no SSE listener.
Unknown /well-known routes return 404 because this anonymous backend is not
an OAuth provider. No external ChatGPT credentials or end-to-end web approval
were used in the offline tests.