Skip to content

Add configurable HTTP host support and worker provider presets#32

Open
hotwa wants to merge 8 commits intoMartian-Engineering:mainfrom
hotwa:main
Open

Add configurable HTTP host support and worker provider presets#32
hotwa wants to merge 8 commits intoMartian-Engineering:mainfrom
hotwa:main

Conversation

@hotwa
Copy link

@hotwa hotwa commented Mar 8, 2026

Summary

This PR adds two small but useful capabilities for running maniple as a persistent MCP service and for integrating Claude-compatible provider wrappers without hard-coding local secrets into
the repository.

1. Configurable HTTP host and host allowlist

maniple can now run streamable HTTP on a configurable bind address instead of always using 127.0.0.1.

Added CLI options:

  • --host
  • --allow-host
  • --allow-origin
  • --disable-dns-rebinding-protection

This makes it possible to run the MCP server on a LAN/Tailscale address while still keeping FastMCP host/origin protection configurable.

2. Worker provider presets and per-worker command/env overrides

Workers can now be launched with either:

  • a named provider preset from ~/.maniple/config.json, or
  • direct command / env overrides

This keeps the core orchestration logic generic while allowing users to plug in local Claude-compatible wrappers.

The repo also adds a small example wrapper script:

  • scripts/claude-maniple-switch

The documented pattern is:

  • main config: ~/.maniple/config.json
  • provider credentials: ~/.maniple/.env
  • wrapper executable: ~/bin/claude-maniple-switch

This avoids baking user-specific .env paths, credentials, or provider naming conventions into the repository.

Why

I wanted a minimal approach that:

  • works well for persistent HTTP deployment
  • supports multiple Claude-compatible providers
  • keeps secrets out of the repo
  • does not tightly couple maniple to any one local provider management setup
  • remains easy to rebase onto upstream changes

Implementation Notes

  • HTTP transport creation now accepts explicit transport security settings.
  • spawn_workers resolves named provider presets from config.
  • provider cannot be mixed with direct command / env overrides on the same worker.
  • Claude wrapper commands can still receive --settings when appropriate so stop-hook based idle detection continues to work.
  • The example wrapper loads provider-specific credentials from ~/.maniple/.env after sourcing the local provider switch script, so maniple-specific credentials can override shell defaults
    cleanly.

Tests

Added/updated tests for:

  • HTTP CLI host/security flags
  • config parsing and persistence for provider presets
  • CLI backend command override behavior
  • spawn_workers provider resolution and validation
  • wrapper dispatch and .maniple/.env loading

Test command used:

uv run pytest tests/test_config.py tests/test_cli_backends.py tests/test_spawn_workers_defaults.py tests/test_claude_maniple_switch.py tests/test_server_http_cli.py tests/
test_server_terminal_backend_fallback.py

## PR Checklist

- [x] Backend parity: tmux + iterm
- [x] Tests cover both backends where applicable
- [x] uv run pytest passes for the targeted changed areas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant