Skip to content

Environment Variables ​

IGraph follows a zero-hardcoded-credentials principle — all sensitive information can only be injected via environment variables.

Variable List ​

VariableDescriptionRequired
IGRAPH_API_KEYShared key for LLM / EmbeddingRequired for online commands (LLM summary / vectorization)
IGRAPH_EMBEDDING_BASE_URLOverrides embedding.baseURL configOptional
IGRAPH_LLM_BASE_URLOverrides llm.baseURL configOptional

Priority ​

Environment variables > Project config file

When both an environment variable and a config file value exist, the environment variable takes precedence.

Setting Up ​

Temporary (Current Terminal Session) ​

bash
export IGRAPH_API_KEY="sk-..."
export IGRAPH_EMBEDDING_BASE_URL="http://localhost:8080/v1"

Persistent ​

Add environment variables to your shell config file:

bash
# ~/.bashrc or ~/.zshrc
export IGRAPH_API_KEY="sk-..."

WARNING

Never write API Keys to:

  • .igraph/config.json config files
  • Any file in the code repository
  • MCP config files (.mcp.json, etc.)

IGraph actively scans for and rejects configs containing credential fields.

Behavior Without API Key ​

CommandBehavior
igraph buildAdd --no-llm to run (skips summary and vectorization)
igraph rebuildAdd --no-llm to run
igraph queryAutomatic fallback to FTS5-only full-text search
igraph evalAutomatic fallback to FTS5-only full-text search
igraph serveMCP Server starts normally; igraph_explore falls back to FTS5-only
igraph initNo API Key needed
igraph statusNo API Key needed
igraph registerNo API Key needed

Credential Passing in MCP Server ​

When using igraph register, no env field is written to the MCP config. The API Key is inherited from the user's shell environment.

This means:

  • Ensure you've run export IGRAPH_API_KEY in your terminal before starting the AI assistant
  • Or add it to your shell config file for persistence

Released under the MIT License