NietzX developer documentation

Integrations & MCP tools

How NietzX routes a user task through a selected AI provider, exposes controlled computer capabilities through MCP, and returns tool results to the model until the task reaches a verified outcome.

Interface
REST + streaming adapters
Tool protocol
Model Context Protocol
Execution
Local-first, permission bounded

One orchestrator, replaceable model providers

NietzX treats the model as a planner and language interface. The desktop host owns credentials, permissions, tool execution, validation, and the persistent task record. Changing providers does not grant a model direct operating-system access.

Input User intent

A task and any files, pages, or constraints supplied by the user.

Host NietzX orchestrator

Builds context, selects a provider, and owns the task state.

Model Provider adapter

Normalizes REST, streaming, messages, and tool-call formats.

Policy Permission gate

Checks scope, approval requirements, and tool arguments.

Action MCP tool server

Reads, writes, browses, or accesses memory within the allowed scope.

Important separation

API-provider access and MCP-tool access are independent. A valid model API key does not automatically authorize filesystem, browser, memory, or external-write tools.

Request lifecycle

Every autonomous task is a bounded loop. NietzX can continue across multiple model and tool turns, but the host—not the model—decides what is executable and when the task is complete.

  1. Normalize the task

    Capture the goal, active workspace, device policy, selected provider, and allowed tool classes.

  2. Assemble context

    Load only relevant conversation state, permitted resources, and persistent-memory matches.

  3. Call the provider

    Translate the neutral request into the provider’s required headers, body, and tool schema.

  4. Validate a tool request

    Check the tool name, JSON Schema arguments, path or URL scope, and whether user approval is required.

  5. Execute through MCP

    Send the approved request to the corresponding local or remote MCP server and capture structured output.

  6. Return evidence

    Feed the bounded result back to the provider, continue if necessary, then verify and report the outcome.

Third-party provider APIs

Each provider has its own authentication and payload format. NietzX presents one internal interface and translates it at the network edge. Keys remain in the operating system’s credential store and are never inserted into prompts, tool arguments, analytics, or support messages.

Provider Primary REST endpoint Authentication NietzX adapter
Anthropic POST https://api.anthropic.com/v1/messages x-api-key + anthropic-version Messages content blocks and tool-use blocks
OpenAI POST https://api.openai.com/v1/responses Authorization: Bearer … Responses input/output items and function tools
DeepSeek POST https://api.deepseek.com/chat/completions Authorization: Bearer … OpenAI-compatible messages and function calls
Gemini POST …/v1beta/models/{model}:generateContent x-goog-api-key Content parts, function declarations, and function responses
Ollama POST http://localhost:11434/api/chat Local endpoint; do not expose it publicly Local chat messages and tool calls

Anthropic

Messages API

The direct Claude API requires an API key, an API-version header, and a JSON message body. Tool definitions are sent with the request; a tool-use content block is validated and dispatched through the NietzX permission layer.

cURL / minimal message
curl https://api.anthropic.com/v1/messages \
  -H "content-type: application/json" \
  -H "x-api-key: $ANTHROPIC_API_KEY" \
  -H "anthropic-version: 2023-06-01" \
  --data-binary @- <<JSON
{
  "model": "$NIETZX_ANTHROPIC_MODEL",
  "max_tokens": 1024,
  "messages": [{"role":"user","content":"Summarize this task."}]
}
JSON

OpenAI

Responses API

The Responses API is the preferred agentic interface for current OpenAI models. NietzX converts neutral messages and tools into response input items, then maps function-call output back into the common tool loop.

cURL / response
curl https://api.openai.com/v1/responses \
  -H "Authorization: Bearer $OPENAI_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @- <<JSON
{
  "model": "$NIETZX_OPENAI_MODEL",
  "input": "Summarize this task."
}
JSON

DeepSeek

Chat Completions compatible

DeepSeek accepts an OpenAI-compatible Chat Completions shape at its own base URL. Model aliases are provider-controlled; keep them in signed application configuration rather than hard-coding them into orchestration logic.

cURL / chat completion
curl https://api.deepseek.com/chat/completions \
  -H "Authorization: Bearer $DEEPSEEK_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @- <<JSON
{
  "model": "$NIETZX_DEEPSEEK_MODEL",
  "messages": [{"role":"user","content":"Summarize this task."}],
  "stream": false
}
JSON

Gemini

Generate Content adapter

Gemini REST requests represent conversation content as parts. The adapter maps NietzX’s neutral text and tool contracts into Google function declarations and returns function responses as content parts.

cURL / generate content
curl "https://generativelanguage.googleapis.com/v1beta/models/${NIETZX_GEMINI_MODEL}:generateContent" \
  -H "x-goog-api-key: $GEMINI_API_KEY" \
  -H "Content-Type: application/json" \
  -X POST \
  -d '{"contents":[{"parts":[{"text":"Summarize this task."}]}]}'
Do not rely on marketing names

Displayed product names and callable API model IDs are not always identical. NietzX should resolve a configured provider model ID at runtime and surface unsupported or retired models as configuration errors.

Provider-neutral adapter contract

The orchestrator should never branch throughout the application on a provider name. One adapter boundary contains authentication, request translation, streaming events, usage accounting, and provider errors.

TypeScript / conceptual interface
type ProviderRequest = {
  model: string;
  messages: NeutralMessage[];
  tools: NeutralTool[];
  signal?: AbortSignal;
};

type ProviderEvent =
  | { type: "text_delta"; text: string }
  | { type: "tool_call"; id: string; name: string; arguments: unknown }
  | { type: "usage"; inputTokens: number; outputTokens: number }
  | { type: "complete"; stopReason: string };

interface ProviderAdapter {
  stream(request: ProviderRequest): AsyncIterable<ProviderEvent>;
  validateModel(model: string): Promise<void>;
}

Adapter responsibilities

  • Read a key reference from the secure credential service; never accept a raw key from a prompt.
  • Apply the provider’s base URL, headers, API version, timeouts, and request identifier.
  • Normalize streaming deltas, tool calls, usage, stop reasons, and retryable errors.
  • Preserve the provider request ID in diagnostic logs without recording prompt secrets.
  • Return a typed failure when a model ID, parameter, or tool feature is unsupported.

MCP architecture inside NietzX

Model Context Protocol is a JSON-RPC-based standard for connecting an AI host to tools, resources, and prompt templates. NietzX is the host; it creates an MCP client connection for each approved server.

MCP host NietzX desktop

Owns user consent, model access, lifecycle, and the final task result.

MCP server Filesystem

Scoped files, directories, and edits.

MCP server Browser

Visible page state and bounded interaction.

MCP server Memory

User-controlled durable context and retrieval.

Model controlled

Tools

Executable operations described by a name, purpose, and JSON Schema input. NietzX validates every call before execution.

Application controlled

Resources

Addressable context such as files, records, or generated state that a host can list and read without treating it as an action.

User controlled

Prompts

Reusable interaction templates exposed by a server and selected explicitly through the host’s user experience.

Transport selection

stdio is appropriate for local child-process servers: messages travel through standard input and output without opening a network port. Streamable HTTP is appropriate for remote servers: clients send JSON-RPC messages with HTTP POST, with optional Server-Sent Events for streaming.

At initialization, the client and server negotiate a protocol version and capabilities. NietzX should terminate the connection when no compatible protocol version can be negotiated.

JSON / illustrative MCP tool declaration
{
  "name": "filesystem.read_text",
  "description": "Read UTF-8 text from an allowed workspace file.",
  "inputSchema": {
    "type": "object",
    "properties": {
      "path": { "type": "string", "description": "Workspace-relative path" }
    },
    "required": ["path"],
    "additionalProperties": false
  }
}

NietzX MCP tool surface

These logical capability names document the public behavior expected from a NietzX build. Exact server and tool identifiers may vary by release, but the permission boundary must remain equivalent.

filesystem.read

Reads an explicitly scoped file or directory. Read-only and bounded to an approved root.

filesystem.write

Creates or edits a named file. The host previews or records changes and blocks paths outside the workspace.

browser.snapshot

Returns the current visible or semantic page state without reading browser credentials or unrelated profile data.

browser.navigate

Loads a permitted URL. External side effects remain subject to policy and user approval.

browser.interact

Clicks or types against a uniquely resolved element after the host confirms the page state is current.

memory.search

Retrieves the smallest relevant set of user-approved persistent-memory records.

memory.store

Writes a durable memory only when the content and retention policy permit persistence.

task.report

Records structured progress, verification evidence, failures, and the final outcome for the active task.

Security boundaries

Autonomy is useful only when authority is explicit. NietzX separates model selection, credential access, tool discovery, and tool execution so a compromised prompt cannot silently widen its permissions.

  • Credential isolation

    Store provider secrets with Windows DPAPI or Apple Keychain. Resolve them only inside the provider adapter.

  • Least-privilege tools

    Expose only the servers and tool classes required for the active task; start with read-only access.

  • Argument validation

    Validate every tool payload against JSON Schema, canonicalize paths and URLs, and reject additional properties.

  • Approval gates

    Require confirmation for destructive changes, external publication, purchases, messages, and new authority.

  • Prompt-injection resistance

    Treat web pages and files as untrusted data. Their instructions cannot override host policy or user intent.

  • Bounded logs

    Keep request IDs, timing, tool names, and errors; redact keys, private content, recovery phrases, and raw credentials.

  • Remote MCP security

    Use TLS, authenticate the remote server, scope tokens, validate Origin where applicable, and do not expose local servers publicly.

  • Result verification

    Check file existence, page state, response status, or other direct evidence before reporting that an action succeeded.

Llama 3.1 8B through Ollama

Local inference keeps prompts and model execution on the user’s device and removes per-token cloud-provider billing. The trade-off is local storage, memory pressure, and lower generation speed on CPU-only systems.

Parameters8B
Ollama artifact4.9 GB
Published context128K
Local API:11434
Shell / install and test
ollama run llama3.1:8b

curl http://localhost:11434/api/chat \
  -d '{
    "model": "llama3.1:8b",
    "messages": [{"role":"user","content":"Describe the active task."}],
    "stream": false
  }'

NietzX deployment guidance

Ollama publishes model size and supported hardware, but it does not publish one universal minimum-RAM number for this model. The following figures are operational guidance, not vendor guarantees; memory use grows with context length and concurrent workloads.

ProfileMemory guidanceExpected useNotes
Tight minimum8 GB system or unified memoryShort prompts, small context, one taskMay fall back to CPU and compete heavily with the operating system.
Recommended16 GB system or unified memoryNormal desktop-agent useLeaves practical headroom for the app, browser, model runtime, and context cache.
GPU accelerationApproximately 8 GB usable VRAMFaster quantized 8B inferenceSupported Nvidia, AMD, Apple Metal, or Vulkan hardware depends on the Ollama platform matrix.
Longer context32 GB+ system or unified memoryLarge documents or multitaskingA 128K model capability does not mean every device can hold a 128K runtime context efficiently.
Keep the local API local

Ollama’s default local API is suitable for loopback access. Do not bind it to an untrusted network interface without adding authentication, transport security, and network policy.

Errors, retries, and observability

A provider response or MCP result is evidence, not an unconditional success signal. The runtime preserves enough structured information to retry safely, diagnose failures, and avoid duplicate side effects.

ConditionNietzX behaviorDo not
429 or transient 5xxRespect retry headers, use capped exponential backoff with jitter, and preserve cancellation.Retry indefinitely or duplicate a completed external action.
Invalid model or parameterFail configuration clearly and direct the user to the provider catalog.Silently switch to an unapproved model.
Malformed tool argumentsReject before execution and return a structured validation error to the model.Repair dangerous paths or URLs by guessing.
MCP connection lostMark the tool result unknown, reconnect only when safe, and re-read state before another write.Assume the previous action failed or succeeded without verification.
User cancellationAbort the provider stream and cancellable tool work; retain a concise task record.Start another model turn after cancellation.

Official sources

The protocol, endpoints, authentication headers, model artifacts, and hardware-support statements above were checked against primary documentation. Provider model availability should still be resolved at runtime.