Feature Request: Configurable Network Binding for MCP Server
Summary
Request for configuration options to bind the MCP server to specific network interfaces instead of only localhost.
Current Situation
The Nowledge Mem MCP server currently only listens on localhost:14242. While this is the secure default, it prevents legitimate use cases where users need to access the service from other devices on their network.
Current Workaround
I'm using Caddy as a reverse proxy with token-based authentication:
:14243 {
@authorized {
expression {query.token} == "your-secret-token" || {header.Authorization} == "Bearer your-secret-token"
}
handle @authorized {
reverse_proxy localhost:14242 {
flush_interval -1
}
}
handle {
respond "Unauthorized: Invalid or missing token" 401 {
close
}
}
}
Benefits of this approach:
- ✅ Production-grade reverse proxy with excellent stability
- ✅ Native SSE support (required for MCP streamableHttp)
- ✅ Simple token-based authentication built-in
- ✅ Easy to add HTTPS with automatic certificate management
- ✅ Cross-platform compatibility
Remaining limitations:
- Requires external service management
- Token is hardcoded in config (need Caddy restart to change)
- Additional complexity compared to native solution
- Need to maintain separate proxy configuration
Use Cases
- Multi-device development: Access the same knowledge base from desktop and laptop on the same network
- Remote workstation: Connect to a home server running Nowledge Mem from a remote location via VPN
- Flexible deployment: Run Nowledge Mem on a dedicated always-on machine while accessing from multiple clients
Proposed Solution
Add configuration options for network binding in Nowledge Mem settings:
Configuration Options
[server]
# Bind address: localhost (default), specific IP, or 0.0.0.0 for all interfaces
bind_address = "localhost" # Default for security
# Port configuration
port = 14242
Example Configurations
Default (current behavior):
bind_address = "localhost" # or "127.0.0.1"
Specific interface:
bind_address = "192.168.1.100" # Bind to specific private IP
All interfaces (for advanced users):
bind_address = "0.0.0.0" # Listen on all network interfaces
Security Considerations
- Default to localhost: Maintain current secure default
- Show warnings: Display security warning when binding to non-localhost addresses
- Documentation: Clearly document security implications in the settings UI
- Recommend authentication: Strongly recommend enabling authentication (see #5) when binding to non-localhost
Example Warning Message:
⚠️ Warning: Binding to non-localhost address exposes your knowledge base to network access.
Only do this on trusted private networks (VPN/Tailscale).
Consider enabling authentication for additional security.
Implementation Priority
P1 (High):
- Configuration option for bind address
- Input validation (valid IP addresses only)
- Security warnings in UI
P2 (Medium):
- Test mode to verify network accessibility
- Auto-detection of available network interfaces
- Platform-specific firewall guidance
Alternatives Considered
-
Reverse proxy (Caddy) ⭐ Current solution
- Pros: Battle-tested, native SSE support, can add authentication
- Cons: External service, additional complexity
-
Reverse proxy (Nginx)
- Pros: Widely used, highly configurable
- Cons: More complex config, additional service to manage
-
SSH tunneling
- Pros: Secure by design
- Cons: Complex setup, not user-friendly
-
socat/netcat (Previous workaround)
- Pros: Lightweight
- Cons: Platform-specific, no authentication, requires manual management
Related Issues
- #5 - Authentication Support (recommended companion feature for network-exposed deployments)
Willingness to Contribute
I'd be happy to help test this feature or contribute to the implementation if guidance is provided.
Environment:
- Nowledge Mem Version: 0.4.9
- Operating System: Linux (Arch Linux)
- Current Workaround: Caddy reverse proxy with token authentication
- Network: Tailscale private network (100.64.0.0/10)