Forge
csharpc0b81713
1using System.Net;
2
3namespace AgentNotesMcp.Status;
4
5internal static class AgentNotesStatusBind
6{
7 internal const string Loopback = "127.0.0.1";
8
9 internal static (string Host, string? Warning) Resolve(string? configuredBind)
10 {
11 var bind = string.IsNullOrWhiteSpace(configuredBind) ? Loopback : configuredBind.Trim();
12 if (bind is Loopback or "localhost" or "::1")
13 return (Loopback, null);
14
15 return (Loopback, $"Status bind '{bind}' is not allowed in v1; using {Loopback} (loopback only).");
16 }
17
18 internal static string BuildBaseUrl(string host, int port) =>
19 $"http://{host}:{port}";
20}
21
View only · write via MCP/CIDE