Connect MCP clients
Choose two independent things: who calls the model, and how the client connects.
Both host and executor work over stdio or HTTP. Start with host below, then switch to a configured API if needed. Tool registration does not intercept every message.
Standalone stdio
Complete installation. Codex registration is not required. Save intent.host.config.js in an ESM project, or use .mjs for a standalone file. Record its actual absolute path.
This trusted Node.js module imports no packages and can be saved independently. Choose the command for your installation location.
Global installation: run in a terminal to check startup, or have your MCP client start:
Project-local installation: run from the service project where you installed @devcodex/intent-runtime. This example uses a standalone .mjs configuration:
A local installation does not add the command to the system PATH. Install the package in the project first; --no-install prevents installing a missing package for this invocation, but you must still run from the correct service project.
Select STDIO in the client. With a global installation available on the client's PATH, clients supporting mcpServers can use:
With a project-local installation, use absolute paths to Node and the installed entry. This does not depend on the client's working directory or npm command PATH:
Find Node with node -p "process.execPath" and replace every placeholder with its actual absolute path. Enter each args item separately in client forms. Windows paths can use C:/Program Files/nodejs/node.exe and D:/Worker/my-service/...; use / or escaped \\ in JSON. Spaces inside a JSON path string do not require extra shell quotes.
For global commands missing from PATH, use the executable's absolute path as well. On Windows use .cmd if supported; otherwise use Node with the installed entry as above. Codex users can use setup. stdout carries protocol only; inspect stderr for logs.
executor instances require a model executor; host does not. --help/--version are supported. Invalid arguments exit 2, loading/startup failures exit 1, normal EOF or SIGINT/SIGTERM exits 0. Keep stdout for MCP and logs on stderr.
HTTP and a custom port
Reuse the same configuration. For a global installation:
For a project-local installation, run from the service project:
The remote deployment examples below use the global command. For a project-local installation, prefix it with npx --no-install and run from the service project.
Expect Intent MCP listening at http://127.0.0.1:3001/mcp. Keep the process running and add a Streamable HTTP client connection:
If the client uses a form instead, enter the same URL. Three host tools should appear. If the port is occupied, choose another and update the client URL. Stop with Ctrl+C.
These HTTP options belong to process startup, not Intent configuration. stdio rejects them. HTTP uses stateful Streamable HTTP with protocols 2025-06-18 / 2025-11-25; stdio also supports 2026-07-28. The client must support the selected protocol.
Retain the negotiated Mcp-Session-Id; prepare and accept need the same logical session. HTTP allows at most 128 sessions, reclaims sessions after 30 minutes without new requests, and limits bodies to 4 MiB. This is not durable business conversation storage. Default binding is local. Configure authentication, HTTPS, and public access in your deployment layer; the command does not manage OAuth or proxies.
Remote addresses and HTTPS proxies
--host binds the process; --public-origin identifies the origin the client actually accesses. They may differ. Binding 0.0.0.0 or :: requires a public origin; a wildcard bind address is not a client URL.
For a controlled LAN:
Replace the IP and connect to http://192.168.1.10:3001/mcp. This does not add encryption or authentication. Public deployment belongs behind configured TLS and access controls.
For https://mcp.example.com/mcp, with local process binding:
This Nginx route belongs inside an existing TLS/access-controlled server block. Your deployment supplies certificates, authentication, and the domain:
Clients use https://mcp.example.com/mcp. Preserve public Host, original Origin, MCP session/protocol headers, and streaming responses. Nondefault ports must match in public-origin and Host. Arbitrary X-Forwarded-* headers do not expand trust; do not rewrite an invalid Origin to bypass checks. Public Host must match the configured origin's Host; supplied Origin must match scheme, host, and port. Local diagnostic addresses remain available.
Validate connection, tool discovery, and prepare/accept in one session. Mismatching Host/Origin should return 403. Request-boundary tests do not replace validation of your actual proxy, certificates, authentication, and client.
Complete API-backed configuration
Use this instead of host configuration. Save in a project with Intent Runtime installed, set INTENT_API_KEY and INTENT_MODEL, and start with its absolute path. It selects no business fields by default.
Complete the first recognition
In a tool-capable AI client, ask: “Use intent-runtime to recognize 'Look up order 000123. Do not cancel the order.' Extract the order ID, show the goal and prohibition, and do not perform order operations.”
Host mode lists intent_runtime_prepare, intent_runtime_accept, intent_runtime_cancel and needs the client model to complete the handoff. A client that only lists tools does not finish recognition. See Host handoff. Codex setup installs the corresponding Skill.
Executor mode can call:
Without a Schema, do not select business fields. structuredContent should preserve the lookup and prohibition; read the result. Host makes no additional API call; executor uses the configured model.
Add tools to an existing service
Keep your SDK, transport, and tools; start with the four integration points. Existing HTTP services use the same adapter while retaining listener, authentication, and logical connections. Do not rebuild a host session for every HTTP request.
Parameter and protocol reference
See Adapter API, tool input, envelopes, protocols, and complete replies.
Structured replies
Send the Native clarification request to executor parse or host prepare and omit input. Executor returns the local IntentResult. Host returns {kind: 'local_result', result} without a lease. For text, host prepare returns a model task for accept. Both shapes use the same CLI configuration and tool names.