- add Docker deployment for independent jarca-ledger container - enable FastMCP streamable-http runtime configuration - document dcy-013, REQ-019, and BAT-015 verification evidence - update structure/runtime baselines and deployment runbook
1.9 KiB
1.9 KiB
BAT-015 Implementation
Code changes
jarca_ledger_mcp/adapters/mcp/server.py- Added
McpRuntimeConfigdataclass. - Added env parsing for
JARCA_MCP_TRANSPORT,JARCA_MCP_HOST,JARCA_MCP_PORT,JARCA_MCP_STREAMABLE_HTTP_PATH,JARCA_MCP_SSE_PATH,JARCA_MCP_MESSAGE_PATH,JARCA_MCP_STATELESS_HTTP. - Instantiates FastMCP with configured host/port/path values.
- Calls
mcp.run(transport=_runtime_config.transport).
- Added
tests/test_mcp_http_runtime.py- Added config tests for default stdio, streamable-http env, and invalid transport rejection.
Deployment files
Dockerfile- Builds
jarca-ledger:latestfrompython:3.12-slim. - Installs
.[dashboard]dependencies. - Exposes port 8000 and runs
jarca-ledger-mcp. - Adds TCP healthcheck against
127.0.0.1:${JARCA_MCP_PORT}.
- Builds
.dockerignore- Excludes
.env, DBs, financial source files, tests/docs/scripts not needed in image, and local artifacts.
- Excludes
docker-compose.yml- Defines
container_name: jarca-ledger. - Maps
8000:8000. - Mounts
/volume1/docker/jarca-ledger/data:/data. - Sets streamable-http MCP env.
- Uses
restart: unless-stopped.
- Defines
Data migration implementation
- Created a consistent source snapshot inside the old
jarcacontainer using SQLite backup API. - Copied snapshot to the host temp path.
- Backed up the initial empty
jarca-ledgerDB under/data/backups/pre_migration_empty_20260705152129.sqlite3. - Stopped
jarca-ledger, removed WAL/SHM sidecars, copied the snapshot to/data/ledger.sqlite3, normalized permissions, and restarted. - Waited for Docker health to become
healthy.
Documentation changes
- Added
docs/runbooks/docker-network-mcp-deploy.md. - Added this StagePilot post-implementation trace: dcy-013, REQ-019, BAT-015.
- Updated
docs/project-structure.mdanddocs/runtime-flows.mdto include Docker/network MCP runtime.