Skip to main content

Configuration

Nibchat is configured through environment variables in server/.env and an optional agent.yaml file.

Environment variables

Required

VariableDescription
OPENAI_API_KEYYour API key. When set, it is used for all sessions and cannot be overridden by users.

Optional — LLM

VariableDefaultDescription
OPENAI_BASE_URLhttps://api.openai.com/v1Base URL for any OpenAI-compatible API (Groq, Ollama, etc.)
OPENAI_MODELUser-selectableLock all sessions to a specific model.

Optional — Built-in tools

VariableDescription
TAVILY_API_KEYEnables the web_search built-in tool. Get a key at tavily.com.
JINA_API_KEYEnables the fetch_page built-in tool. Get a key at jina.ai.
WEB_FETCH_MAX_TOKENSMax tokens returned by fetch_page (default: 2000).

Optional — Deployment

VariableDefaultDescription
PORT3000HTTP port the server listens on.
PUBLIC_URLhttp://localhost:3000Base URL used for OAuth redirect URIs. Must match your registered redirect URI.
AGENT_CONFIG_PATH./agent.yamlPath to the agent configuration file.

agent.yaml

The agent config file controls the system prompt, MCP server connections, and starter messages shown in the UI.

instructions: |
You are a helpful assistant.

starterMessages:
- "What can you help me with?"
- "Show me what tools you have."

mcpServers:
- url: https://my-mcp-server.example.com
name: myserver
headers:
Authorization: "Bearer my-token"

Fields

FieldDescription
systemPromptSystem prompt injected before every conversation.
starterMessagesList of suggested messages shown on the empty chat screen.
mcpServersArray of MCP server configurations (see below).
mcpServerLegacy single-server shorthand (use mcpServers instead).

MCP server fields

FieldRequiredDescription
urlYesServer-sent events endpoint URL.
nameNoDisplay name and tool prefix used on collision. Defaults to the hostname.
headersNoStatic HTTP headers (e.g. Authorization). Bypasses OAuth when set.
Tool name collisions

If two MCP servers expose a tool with the same name, Nibchat prefixes them as {name}__{toolName} using the name field.

Per-session settings

When OPENAI_API_KEY and OPENAI_MODEL are not set via environment variables, users can configure their own API key and model through the settings modal in the UI. These settings are stored per-session in the database.