Skip to content

Configuration

ToolMesh is configured entirely via environment variables and YAML files.

VariableDefaultDescription
TOOLMESH_PORT8123Host port (Docker mapping; internally always 8080)
TOOLMESH_TRANSPORThttpTransport: http or stdio
TOOLMESH_CORS_ORIGINS(empty)Allowed CORS origins
TOOLMESH_AUTH_PASSWORD(empty)Single-user OAuth password
TOOLMESH_API_KEY(empty)Static API key
VariableDefaultDescription
AUDIT_STOREloglog (slog) or sqlite
AUDIT_RETENTION_DAYS90Retention for SQLite store
VariableDefaultDescription
OPENFGA_API_URLhttp://localhost:8080OpenFGA API endpoint
OPENFGA_STORE_ID(empty)OpenFGA store ID
OPENFGA_MODEbypassbypass (no authz) or restrict (enforced)
VariableDefaultDescription
TOOLMESH_MCP_TIMEOUT120HTTP client timeout for MCP backends (seconds)
TOOLMESH_EXEC_TIMEOUT120Tool execution timeout (seconds)
VariableDefaultDescription
LOG_LEVELdebug / infoLog verbosity
LOG_FORMATjsonjson or text
DEBUG_BACKENDS(empty)Comma-separated backend names for debug logging
DEBUG_FILE(empty)Path to debug log file

Credentials are set as env vars with CREDENTIAL_ prefix:

Terminal window
CREDENTIAL_GITHUB_TOKEN=ghp_xxxxx
CREDENTIAL_STRIPE_KEY=sk_live_xxxxx
CREDENTIAL_MEMORIZER_API_KEY=sk-mem-xxxxx

Defines which backends ToolMesh connects to:

backends:
# MCP backend
- name: memorizer
transport: http
url: "https://memorizer.example.com/mcp"
api_key_env: "MEMORIZER_API_KEY"
# REST backend via DADL
- name: github
transport: rest
dadl: /app/dadl/github.dadl
url: "https://api.github.com"

Tools are automatically exposed with a backend prefix (e.g., memorizer_retrieve_knowledge, github_list_repos).

Multi-user configuration for OAuth:

users:
- username: alice
password: "$2a$12$..."
company: acme
plan: pro
roles: [admin]

API key definitions:

keys:
- key_hash: "$2a$12$..."
username: ci-bot
company: acme
plan: standard
roles: [read]
caller_id: github-actions

Maps caller IDs to trust classes:

classes:
trusted:
- claude-code
- claude-desktop
standard:
- partner-*
# Everything else → "untrusted"