Universal Config Generator¶
UniversalConfigGenerator
¶
Factory for producing an MCP host configuration JSON from a stack, dedicated to universal applications.
Deterministic
Reads from environment and StackConfig; does not mutate the stack.
Source code in src/MCPStack/core/mcp_config_generator/mcp_config_generators/universal_mcp_config.py
generate(stack, command=None, args=None, cwd=None, module_name=None, pipeline_config_path=None, save_path=None)
classmethod
¶
Create the configuration mapping and optionally persist it to disk.
Use with CLI
The mcpstack build command calls into this method.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
stack
|
An |
required | |
command
|
str | None
|
Executable used to launch the server; defaults to the active Python. |
None
|
args
|
List[str] | None
|
Arguments for the command; defaults to |
None
|
cwd
|
str | None
|
Working directory for the server process. |
None
|
module_name
|
str | None
|
Python module to run when using |
None
|
pipeline_config_path
|
str | None
|
Path to the pipeline JSON produced by |
None
|
save_path
|
str | None
|
If set, write the config JSON here. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
dict |
dict
|
Configuration mapping suitable for MCP-compatible hosts. |
Raises:
| Type | Description |
|---|---|
MCPStackValidationError
|
If |