Config file formats
Global config files
Place in the application working directory (or paths searched by generated GraftConfig.init()):
| File | Format |
|---|---|
graftcode-config.json | JSON |
graftcode-config.yaml | YAML |
graftcode-config.txt | Key-value text |
JSON example
{ "host": "tcp://gateway:8990" }
YAML example
host: tcp://gateway:8990
Per-Graft config files
Replace {graft-name} with the package name (e.g. @graft/nuget-Orders → @graft-nuget-Orders-config.json):
| File pattern |
|---|
{graft-name}-config.json |
{graft-name}-config.yaml |
{graft-name}-config.txt |
Per-Graft config overrides global config for that Graft only.
Gateway CORS config (--corsConfig)
INI-style key=value file:
allowedOrigins=http://localhost:3000,https://app.example.com allowedMethods=GET,POST,PUT,PATCH,DELETE,OPTIONS allowedHeaders=content-type,authorization,MCP-Protocol-Version,Mcp-Session-Id exposedHeaders=Mcp-Session-Id,MCP-Protocol-Version allowCredentials=false
Alternative keys: origins, methods, headers, exposeHeaders, credentials.
Configuration precedence (Grafts)
Highest priority first:
- Runtime-specific environment variable
- Global environment variable
- Runtime-specific config file
- Global config file (
graftcode-config.*) - User code (
GraftConfig.host,setConfig) - Graft package default
- Hypertube default (in-memory)