judgevet.adapters.inbound.mcp_entrypoint
Status: draft.
judgevet.adapters.inbound.mcp_entrypoint
MCP stdio entry point for judgevet.
This module provides the composition root for the MCP stdio server. It reads Settings once, configures stderr logging, builds the HTTP adapter, and runs the MCP server over stdio. It closes the acquired HTTP adapter when serving ends.
Examples:
from judgevet.adapters.inbound import mcp_entrypoint as entry
assert callable(entry.main)
See Also
- judgevet.adapters.inbound.settings: Settings for configuration
- judgevet.adapters.outbound.http: HTTP adapter
- judgevet.adapters.inbound.mcp: MCP server factory
- judgevet.ports: Port protocol
Attributes:
| Name | Type | Description |
|---|---|---|
__all__ |
list
|
Public API exports. |
build_adapter(settings)
Resolve one wrapped credential and apply host-selected gateway configuration.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
settings
|
Settings
|
The Settings instance. |
required |
Returns:
| Type | Description |
|---|---|
HTTPSystemOneAdapter
|
HTTPSystemOneAdapter configured with settings. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If credential resolution or connection configuration fails. |
main()
MCP stdio server entry point.
Reads Settings once, configures logging, selects a credential source and runs MCP, and ensures adapter cleanup.
Returns:
| Type | Description |
|---|---|
int
|
Exit code: 0 for success, 2 for configuration failures. |
Raises:
| Type | Description |
|---|---|
SystemExit
|
If startup or serving raises an IO, runtime, value, type, or grouped exception. Its details are omitted from the diagnostic. |
run_stdio(port)
async
Run MCP stdio server with the given port.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
port
|
SystemOnePort
|
The port used for API calls. |
required |
Raises:
| Type | Description |
|---|---|
RuntimeError
|
If MCP runtime is not available. |