Skip to content

feat: add --host CLI option for remote access#77

Merged
cablate merged 1 commit intomainfrom
feat/host-option
Apr 21, 2026
Merged

feat: add --host CLI option for remote access#77
cablate merged 1 commit intomainfrom
feat/host-option

Conversation

@cablate
Copy link
Copy Markdown
Owner

@cablate cablate commented Apr 21, 2026

Summary

Closes #76

  • Adds --host CLI argument to control which network interface the HTTP server binds to
  • Supports MCP_SERVER_HOST environment variable with fallback to 0.0.0.0 (all interfaces)
  • BaseMcpServer.startHttpServer(port, host) now accepts an optional host parameter
  • Log messages display actual bound host instead of hardcoded localhost
  • Updated README (EN + zh-TW) with usage examples and env var documentation

Usage

# Bind to all interfaces (default, enables remote access)
npx @cablate/mcp-google-map --host 0.0.0.0 --port 3000

# Bind to localhost only
npx @cablate/mcp-google-map --host 127.0.0.1 --port 3000

# Via environment variable
MCP_SERVER_HOST=0.0.0.0 npx @cablate/mcp-google-map --port 3000

Test plan

  • npm run build passes
  • npm test — 185 passed, 0 failed
  • --host 127.0.0.1 binds to localhost only (verified via log output)
  • --host 0.0.0.0 binds to all interfaces (verified via log output)
  • MCP_SERVER_HOST env var works correctly
  • --help shows the new --host option with description and default

🤖 Generated with Claude Code

Adds --host CLI argument and MCP_SERVER_HOST env var to control
which network interface the HTTP server binds to. Defaults to
0.0.0.0 (all interfaces) for remote access support.

- BaseMcpServer.startHttpServer now accepts host parameter
- CLI: --host option with MCP_SERVER_HOST env var fallback
- Log messages show actual bound host instead of hardcoded localhost
- Updated README (EN + zh-TW) with --host examples and env var docs

Closes #76

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@cablate cablate merged commit e507db3 into main Apr 21, 2026
1 check passed
@cablate cablate deleted the feat/host-option branch April 21, 2026 16:23
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.

support listenning on a given hostname

1 participant