> Fetch clean Markdown by appending `.md` to any page URL under https://signalwire.com/docs or requesting it with the HTTP header `Accept: text/markdown`. The root index at https://signalwire.com/docs/llms.txt lists the available documentation indexes. # ConfigLoader > JSON configuration loading with environment variable substitution. [securityconfig]: /docs/server-sdks/reference/python/agents/configuration/security-config [mcp-gateway]: /docs/server-sdks/reference/python/agents/cli/mcp-gateway [findconfigfile]: /docs/server-sdks/reference/python/agents/configuration/config-loader/find-config-file [get]: /docs/server-sdks/reference/python/agents/configuration/config-loader/get [getconfig]: /docs/server-sdks/reference/python/agents/configuration/config-loader/get-config [getconfigfile]: /docs/server-sdks/reference/python/agents/configuration/config-loader/get-config-file [getsection]: /docs/server-sdks/reference/python/agents/configuration/config-loader/get-section [hasconfig]: /docs/server-sdks/reference/python/agents/configuration/config-loader/has-config [mergewithenv]: /docs/server-sdks/reference/python/agents/configuration/config-loader/merge-with-env [substitutevars]: /docs/server-sdks/reference/python/agents/configuration/config-loader/substitute-vars `ConfigLoader` loads JSON configuration files and substitutes environment variables using `${VAR|default}` syntax. It is used internally by [`SecurityConfig`][securityconfig] and the [`mcp-gateway`][mcp-gateway] service, and can be used directly for custom configuration needs. ```python from signalwire.core.config_loader import ConfigLoader ``` ## **Properties** **`config_paths`** `list[str]` List of file paths checked during initialization. The first existing file is loaded. --- ## **Methods** #### [find\_config\_file](/docs/server-sdks/reference/python/agents/configuration/config-loader/find-config-file) Static method to locate a config file without loading it. #### [get](/docs/server-sdks/reference/python/agents/configuration/config-loader/get) Get a configuration value by dot-notation path. #### [get\_config](/docs/server-sdks/reference/python/agents/configuration/config-loader/get-config) Get the raw configuration dictionary before environment variable substitution. #### [get\_config\_file](/docs/server-sdks/reference/python/agents/configuration/config-loader/get-config-file) Get the path of the loaded config file. #### [get\_section](/docs/server-sdks/reference/python/agents/configuration/config-loader/get-section) Get an entire configuration section with environment variables substituted. #### [has\_config](/docs/server-sdks/reference/python/agents/configuration/config-loader/has-config) Check whether a configuration file was successfully loaded. #### [merge\_with\_env](/docs/server-sdks/reference/python/agents/configuration/config-loader/merge-with-env) Merge configuration with environment variables matching a prefix. #### [substitute\_vars](/docs/server-sdks/reference/python/agents/configuration/config-loader/substitute-vars) Recursively substitute environment variables in configuration values. ## **Example** ```python {4,8} from signalwire.core.config_loader import ConfigLoader # Auto-discover config file loader = ConfigLoader() print(f"Config loaded: {loader.has_config()}") # Explicit config file path loader = ConfigLoader(["./my-config.json", "/etc/myapp/config.json"]) print(f"Config file: {loader.get_config_file()}") ``` > JSON configuration loading with environment variable substitution. ## Docs - [find_config_file](https://signalwire.com/docs/server-sdks/reference/python/agents/configuration/config-loader/find-config-file.md): Static method to locate a config file without loading it. - [get](https://signalwire.com/docs/server-sdks/reference/python/agents/configuration/config-loader/get.md): Get a configuration value by dot-notation path. - [get_config](https://signalwire.com/docs/server-sdks/reference/python/agents/configuration/config-loader/get-config.md): Get the raw configuration dictionary before environment variable substitution. - [get_config_file](https://signalwire.com/docs/server-sdks/reference/python/agents/configuration/config-loader/get-config-file.md): Get the path of the loaded config file. - [get_section](https://signalwire.com/docs/server-sdks/reference/python/agents/configuration/config-loader/get-section.md): Get an entire configuration section with environment variables substituted. - [has_config](https://signalwire.com/docs/server-sdks/reference/python/agents/configuration/config-loader/has-config.md): Check whether a configuration file was successfully loaded. - [merge_with_env](https://signalwire.com/docs/server-sdks/reference/python/agents/configuration/config-loader/merge-with-env.md): Merge configuration with environment variables matching a prefix. - [substitute_vars](https://signalwire.com/docs/server-sdks/reference/python/agents/configuration/config-loader/substitute-vars.md): Recursively substitute environment variables in configuration values.