Skip to main content

Agent and MCP server

The agent is the built-in agent of FINOS Workspace. It runs as two processes: the agent itself, and an MCP server that offers it tools. Both read their settings from the environment. On a local stack, the file agent/.env supplies the settings, and a deployment supplies the same variables through its own configuration. The file agent/.env.example is a template of that file.

Variables​

The table lists every variable that the code under agent/src and agent/mcp-server/src reads, in the groups of the registry in agent/src/lib/env-reference.ts. Each row shows which of the two processes reads the variable, its type, its default, the condition under which it is required, and what it does. A variable that takes one of a few values lists them, and a variable that names a model lists the providers that it accepts.

A test reads the source of both processes and fails when the code reads a variable that the registry lacks, when the registry lists a variable that the code does not read, or when an entry has no description. The registry is the only source of this page, so the page cannot describe a variable that does not exist or leave out one that does.

Models and providers

  • DEFAULT_MODEL<provider>:<model>, with provider "openai" | "openrouter" | "groq" | "nvidia" | "ollama"always

    The model that every call of the agent uses unless the user picks another of the offered models in the Workspace: chat, titles, prompt enhancement and table extraction. It is written <provider>:<model>, where <model> is the name that the provider gives it. No model is built into the agent, so a request that names none fails while this is unset. Changing it needs a restart.

    Read by
    agent
  • AGENT_MODELScomma-separated <provider>:<model>, with provider "openai" | "openrouter" | "groq" | "nvidia" | "ollama"

    More models that users may choose, comma-separated and written like DEFAULT_MODEL. The agent offers DEFAULT_MODEL and these models and refuses any other, so a user cannot spend the provider keys on a model that the operator did not choose. The roles in the Workspace (Admin, Roles) choose among them.

    Read by
    agent
  • OPENAI_API_KEYsecret

    API key of OpenAI. With it, models written openai:<model> work, and so do OpenAI transcription models (agent) and embedding models (MCP server). Without a key, the models of that provider are not available.

    Read by
    agent and mcp-server
  • OPENROUTER_API_KEYsecret

    API key of OpenRouter, which offers Claude, Gemini, DeepSeek and many other models. With it, models written openrouter:<model> work, and so do OpenRouter embedding models (MCP server).

    Read by
    agent and mcp-server
  • GROQ_API_KEYsecret

    API key of Groq. With it, models written groq:<model> work, and so do Groq transcription models.

    Read by
    agent
  • NVIDIA_API_KEYsecret

    API key of NVIDIA NIM at integrate.api.nvidia.com. With it, models written nvidia:<model> work, and so do NVIDIA speech models (agent) and embedding models (MCP server).

    Read by
    agent and mcp-server
  • OLLAMA_BASE_URLurldefault http://localhost:11434/api

    Address of the Ollama API, for models written ollama:<model> (agent) and Ollama embedding models (MCP server). In Docker, use host.docker.internal instead of localhost: inside a container, localhost is the container itself and cannot reach an Ollama on the host.

    Read by
    agent and mcp-server
  • AGENT_TRANSCRIBE_MODEL<provider>:<model>, with provider "groq" | "openai" | "nvidia"

    The model that turns a dictated recording into the text of a question, written <provider>:<model>, for example groq:whisper-large-v3-turbo, openai:gpt-4o-mini-transcribe or nvidia:openai/whisper-large-v3. The provider needs its API key. Unset, the chat has no microphone.

    Read by
    agent
  • AGENT_EMBED_MODEL<provider>:<model>, with provider "openai" | "openrouter" | "nvidia" | "ollama"

    The embedding model of document search, written <provider>:<model>. The provider needs its API key or, for Ollama, its address. There is no default: unset, the tools query_documents and list_documents are turned off.

    Read by
    mcp-server
  • AGENT_INLINE_TOOL_CALLS"on" | "off"default on

    A model without native tool calling writes its calls into its text, as <tool_call>{...}</tool_call>, <function=...> or [TOOL_CALLS]. With on, the agent reads them as tool calls. Only the value off turns this off; any other value leaves it on.

    Read by
    agent

Who can use the agent

  • AGENT_AUTH"workspace" | "none"default workspace

    How callers are admitted. With workspace, every caller signs in with the Workspace API, which owns the users, their roles and their usage limits. With none, the agent runs without users and counts nothing, which is for a development machine only.

    Read by
    agent and mcp-server
  • WORKSPACE_API_URLurlwith AGENT_AUTH=workspace

    Address of the Workspace API as the agent and the MCP server reach it, which is not necessarily the address that a browser uses; inside a deployment, it is the address of the API service. Signed file links of the Workspace are fetched through it.

    Read by
    agent and mcp-server
  • WORKSPACE_ORIGINoriginwith AGENT_AUTH=workspace or WORKSPACE_PUBLIC_URL

    The origin of the web app, without a path, for example https://workspace.example.com. Every call to the Workspace API carries it as its Origin, and the API refuses the calls of an origin that it does not allow, so it must be one of the API's BACKEND_CORS_ORIGINS.

    Read by
    agent and mcp-server
  • WORKSPACE_PUBLIC_URLurl

    The address at which browsers reach the Workspace API, without a path, as it appears in the links to uploaded files (/app/files/...). The agent and the MCP server rewrite such a link to WORKSPACE_API_URL and fetch it with WORKSPACE_ORIGIN as its Origin, so that an API on a private network can serve files to them. Unset, those links are fetched like any other address and are refused when it is internal.

    Read by
    agent and mcp-server
  • AGENT_CORS_ORIGINSlistwith AGENT_AUTH=workspace

    The origins of the web app that may call the agent from a browser, comma-separated, each like https://workspace.example.com. An * allows every origin.

    Read by
    agent
  • AGENT_METERING_TOKENsecretwith AGENT_AUTH=workspace

    The token with which the agent reports usage to the Workspace API; python -m scripts.create_metering_token in backend-api/backend mints it. It runs out after a year, and the API refuses one that never runs out. Until a new one is set, usage is not counted and the API answers 403.

    Read by
    agent
  • AGENT_SCOPE_SECRETsecretwith AGENT_AUTH=workspace

    At least 16 characters. The secret with which the agent signs the chat scope that the MCP tools receive, and the addresses that the model may fetch. The agent and the MCP server must have the same value; it keeps one user's chat from another's.

    Read by
    agent and mcp-server
  • AGENT_AUTH_CACHE_SECONDSintegerdefault 30

    How long, in seconds, a signed-in user is remembered before the Workspace API is asked about them again. The least is 0.

    Read by
    agent
  • AGENT_FETCH_ANY_URLbooleandefault false

    The tool fetch_webpage fetches only an address that was in the conversation, given by the user or listed by a search, a page or a widget, so that text in a page cannot make the agent fetch an address with the user's data in it. With true, it fetches any address.

    Read by
    mcp-server

Limits

  • AGENT_MAX_BODY_MBintegerdefault 64

    The largest request that the agent accepts, in megabytes. The least is 1.

    Read by
    agent
  • AGENT_MAX_CONCURRENT_QUERIESintegerdefault 4

    How many questions one user may have running at once. The least is 1.

    Read by
    agent
  • AGENT_MAX_TOTAL_QUERIESintegerdefault 200

    How many questions the whole agent runs at once. Past it, the agent answers 503. The least is 1.

    Read by
    agent
  • AGENT_MAX_TURN_REQUESTSintegerdefault 60

    How many requests one question may be made of: a turn is several requests, one for each tool that the browser runs. The least is 1.

    Read by
    agent
  • AGENT_HELPER_CALLS_PER_MINUTEintegerdefault 60

    How many helper calls, such as titles and rewritten prompts, one user may make in a minute. The least is 1.

    Read by
    agent
  • AGENT_INVALID_REQUESTS_PER_MINUTEintegerdefault 20

    How many requests that are not questions (not JSON, or of the wrong shape) one user may send in a minute. Past it, their questions are turned away unread. The least is 1.

    Read by
    agent
  • LLM_STREAM_TIMEOUT_MSintegerdefault 240000

    How long, in milliseconds, a model call may take before the agent stops it. A value that is not a number, or is 0, leaves the default.

    Read by
    agent
  • AGENT_SQL_TIMEOUT_MSintegerdefault 10000

    How long, in milliseconds, one SQL query on the data of a chat may run before the agent stops it. A value below 100 leaves the default.

    Read by
    agent
  • AGENT_ISOLATED_CONCURRENCYintegerdefault 4

    How many child processes may run at once for work on a stranger's bytes: SQL, spreadsheets, PDF and Word text, and web pages. A value that is not a number, or is 0, leaves the default; a smaller number than 1 counts as 1.

    Read by
    agent and mcp-server
  • AGENT_INGEST_CHUNKS_PER_HOURintegerdefault 20000

    How many chunks of documents one chat may add to document search in an hour. A value that is not a positive number leaves the default.

    Read by
    mcp-server
  • AGENT_SHUTDOWN_GRACE_SECONDSintegerdefault 25

    How long, in seconds, the agent waits for the questions in progress to finish after it is told to stop, before it exits.

    Read by
    agent

Processes and storage

  • PORTintegerdefault 7777

    The port on which the agent listens.

    Read by
    agent
  • MCP_PORTintegerdefault 8787

    The port on which the MCP server listens.

    Read by
    mcp-server
  • MCP_PUBLIC_BASE_URLurldefault http://127.0.0.1:<MCP_PORT>

    The address at which browsers reach the MCP server, which it gives to the Workspace tabs that connect to its bridge.

    Read by
    mcp-server
  • MCP_BRIDGE_COMMAND_TIMEOUT_MSintegerdefault 15000

    How long, in milliseconds, the MCP server waits for a Workspace tab to answer a bridge command.

    Read by
    mcp-server
  • COMPANION_TOOLS_ENABLEDbooleandefault false

    With true, the MCP server offers the tools, prompts and app-builder resources that drive a Workspace browser tab through its bridge at /bridge/ws. Any other value leaves them off.

    Read by
    mcp-server
  • REDIS_URLurl

    A Redis or Valkey address, for example redis://valkey:6379. What the agent keeps between the requests of one turn (who is signed in, how much of a user's share is left, which turn is under way, a chat's rows), and what the MCP server keeps for the documents of a chat, lives there when this is set and in the process when it is not. Shared, every replica gives the same answer; without it, run one replica, and a chat's tables are not kept.

    Read by
    agent and mcp-server

Logs, metrics and traces

  • NODE_ENVstring

    With production, logs default to level info in JSON, and LIVE_DEBUG_TRACES is ignored unless AGENT_ALLOW_DEBUG_TRACES is true. Any other value, or none, selects the defaults of development: level debug and the pretty format.

    Read by
    agent and mcp-server
  • LOG_LEVEL"trace" | "debug" | "info" | "warning" | "error" | "fatal"default info in production, otherwise debug

    The least severe level that is logged, whatever the case; the value warn is accepted as warning. Logs go to stdout, cleaned of secrets, session tokens, file bytes, signed file URLs and email addresses.

    Read by
    agent and mcp-server
  • LOG_FORMAT"json" | "pretty"default json in production, otherwise pretty

    The format of the logs, whatever the case: one JSON object per line, or text for a person to read.

    Read by
    agent and mcp-server
  • AGENT_METRICS_PORTintegerdefault 9464

    The port on which the agent serves its Prometheus metrics at /metrics. The port is not published by the deployment. The value 0 turns the metrics off.

    Read by
    agent
  • MCP_METRICS_PORTintegerdefault 9465

    The port on which the MCP server serves its Prometheus metrics at /metrics. The value 0 turns the metrics off.

    Read by
    mcp-server
  • OTEL_EXPORTER_OTLP_ENDPOINTurl

    The base address of an OpenTelemetry collector. With it, the agent exports its traces to <address>/v1/traces. Without it, and without the other trace settings, tracing is off.

    Read by
    agent
  • OTEL_EXPORTER_OTLP_TRACES_ENDPOINTurl

    The full address that traces are exported to. It takes the place of OTEL_EXPORTER_OTLP_ENDPOINT for traces.

    Read by
    agent
  • OTEL_TRACES_CONSOLEbooleandefault false

    With true, the agent prints its spans to the console. Any other value leaves this off.

    Read by
    agent
  • OTEL_RECORD_PROMPTSbooleandefault false

    With true, the traces of the agent contain the prompts and answers of the model. Any other value leaves them out.

    Read by
    agent
  • OTEL_SERVICE_NAMEstringdefault agent

    The name under which the agent's traces are exported.

    Read by
    agent
  • OTEL_SERVICE_VERSIONstringdefault dev

    The version that the agent's traces and the metric agent_build_info report.

    Read by
    agent and mcp-server

Debugging

  • LIVE_DEBUG_TRACES"0" | "1" | "2"default 0

    Writes the course of each question to the log while it runs. The value 1 writes a clean trace, and 2 also writes the whole input and output of the model as JSON. A value of 1 or more writes whole conversations to the log, so the agent ignores it in production unless AGENT_ALLOW_DEBUG_TRACES is true.

    Read by
    agent
  • AGENT_ALLOW_DEBUG_TRACESbooleandefault false

    With true, LIVE_DEBUG_TRACES takes effect when NODE_ENV is production. Any other value leaves it ignored there.

    Read by
    agent