mcp-combiner 0.20.0.dev3__tar.gz → 0.20.0.dev4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (98) hide show
  1. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/CHANGELOG.md +6 -0
  2. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/PKG-INFO +1 -1
  3. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/mcp_combiner/config.py +19 -3
  4. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/mcp_combiner/mockserver.py +33 -2
  5. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/pyproject.toml +1 -1
  6. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/tests/test_public_url.py +6 -0
  7. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/uv.lock +1 -1
  8. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/.gitignore +0 -0
  9. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/.python-version +0 -0
  10. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/LICENSE +0 -0
  11. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/README.md +0 -0
  12. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/mcp_combiner/__init__.py +0 -0
  13. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/mcp_combiner/__main__.py +0 -0
  14. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/mcp_combiner/asgi.py +0 -0
  15. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/mcp_combiner/auth.py +0 -0
  16. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/mcp_combiner/authprompt.py +0 -0
  17. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/mcp_combiner/backing.py +0 -0
  18. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/mcp_combiner/binding.py +0 -0
  19. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/mcp_combiner/connections.py +0 -0
  20. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/mcp_combiner/ctl.py +0 -0
  21. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/mcp_combiner/era.py +0 -0
  22. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/mcp_combiner/externalservers.py +0 -0
  23. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/mcp_combiner/fastvalidate.py +0 -0
  24. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/mcp_combiner/handover.py +0 -0
  25. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/mcp_combiner/heldcalls.py +0 -0
  26. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/mcp_combiner/inbound_auth.py +0 -0
  27. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/mcp_combiner/isolated.py +0 -0
  28. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/mcp_combiner/listen.py +0 -0
  29. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/mcp_combiner/meta_tools.py +0 -0
  30. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/mcp_combiner/middleware.py +0 -0
  31. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/mcp_combiner/mounts.py +0 -0
  32. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/mcp_combiner/notifications.py +0 -0
  33. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/mcp_combiner/nvim_channel.py +0 -0
  34. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/mcp_combiner/nvim_proxy.py +0 -0
  35. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/mcp_combiner/permissions.py +0 -0
  36. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/mcp_combiner/proxyfactory.py +0 -0
  37. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/mcp_combiner/py.typed +0 -0
  38. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/mcp_combiner/resume_transport.py +0 -0
  39. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/mcp_combiner/routes.py +0 -0
  40. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/mcp_combiner/runtime.py +0 -0
  41. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/mcp_combiner/schema.py +0 -0
  42. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/mcp_combiner/schemafix.py +0 -0
  43. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/mcp_combiner/server.py +0 -0
  44. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/mcp_combiner/sharedserver.py +0 -0
  45. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/mcp_combiner/status.py +0 -0
  46. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/mcp_combiner/toolcache.py +0 -0
  47. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/mcp_combiner/ui_host/__init__.py +0 -0
  48. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/mcp_combiner/ui_host/advertise.py +0 -0
  49. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/mcp_combiner/ui_host/holder.py +0 -0
  50. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/mcp_combiner/ui_host/routes.py +0 -0
  51. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/mcp_combiner/ui_host/sessions.py +0 -0
  52. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/mcp_combiner/ui_host/static/app-bridge.bundle.js +0 -0
  53. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/mcp_combiner/ui_host/templates.py +0 -0
  54. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/mcp_combiner/upstream_era.py +0 -0
  55. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/mcp_combiner/upstream_listen.py +0 -0
  56. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/mcp_combiner/upstream_session.py +0 -0
  57. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/pyrightconfig.json +0 -0
  58. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/tests/conftest.py +0 -0
  59. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/tests/fakes.py +0 -0
  60. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/tests/fixtures/servers.json +0 -0
  61. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/tests/test_advertised_origin.py +0 -0
  62. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/tests/test_app_meta.py +0 -0
  63. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/tests/test_auth.py +0 -0
  64. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/tests/test_authprompt.py +0 -0
  65. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/tests/test_binding.py +0 -0
  66. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/tests/test_combiner_reconnect.py +0 -0
  67. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/tests/test_config.py +0 -0
  68. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/tests/test_connections.py +0 -0
  69. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/tests/test_ctl_lifecycle.py +0 -0
  70. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/tests/test_elicit_e2e.py +0 -0
  71. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/tests/test_era.py +0 -0
  72. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/tests/test_externalservers.py +0 -0
  73. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/tests/test_handover.py +0 -0
  74. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/tests/test_inbound_auth.py +0 -0
  75. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/tests/test_isolated.py +0 -0
  76. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/tests/test_isolated_lifecycle_e2e.py +0 -0
  77. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/tests/test_isolated_stdio.py +0 -0
  78. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/tests/test_live_claude.py +0 -0
  79. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/tests/test_mockserver.py +0 -0
  80. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/tests/test_mounts.py +0 -0
  81. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/tests/test_notifications.py +0 -0
  82. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/tests/test_notifications_e2e.py +0 -0
  83. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/tests/test_nvim_channel.py +0 -0
  84. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/tests/test_nvim_e2e.py +0 -0
  85. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/tests/test_oauth_mock.py +0 -0
  86. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/tests/test_permissions.py +0 -0
  87. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/tests/test_reload_config.py +0 -0
  88. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/tests/test_resume_transport.py +0 -0
  89. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/tests/test_route_matrix.py +0 -0
  90. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/tests/test_schema_fixes.py +0 -0
  91. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/tests/test_session_filter.py +0 -0
  92. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/tests/test_session_independence.py +0 -0
  93. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/tests/test_sharedserver.py +0 -0
  94. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/tests/test_tool_fetch_wedge.py +0 -0
  95. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/tests/test_ui_host.py +0 -0
  96. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/tests/test_upstream_restart.py +0 -0
  97. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/tests/test_upstream_session.py +0 -0
  98. {mcp_combiner-0.20.0.dev3 → mcp_combiner-0.20.0.dev4}/tests/test_visibility_and_reset_e2e.py +0 -0
@@ -32,6 +32,12 @@ tagged `vX.Y.Z`.
32
32
  raw tailnet IP, falling back to the IP. `oauth.public_url: "auto"` is
33
33
  `http://<magicdns name>:<port>`; `"https://{auto}"` suits `tailscale serve`.
34
34
  New `MCP_COMBINER_OAUTH_PUBLIC_URL` (a literal URL) overrides the setting.
35
+ - `MCP_COMBINER_OAUTH_PUBLIC_URL` (and a literal `public_url`) may be a bare
36
+ host: `http://` and, on plain http, the combiner's port are added. A bare
37
+ host used to become a redirect URI with no scheme, which broke the OAuth
38
+ connection outright.
39
+ - Mock server `--issuer` (`auto` = the tailnet name): the authorization server
40
+ URL it advertises, so a phone can complete the mock's OAuth flow.
35
41
  - An explicit advertised origin keeps its own port
36
42
  (`MCP_COMBINER_UI_ADVERTISE=http://host:443` gave `http://host:443:9741`),
37
43
  and a bare IPv6 host is bracketed.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: mcp-combiner
3
- Version: 0.20.0-dev.3
3
+ Version: 0.20.0-dev.4
4
4
  Summary: An MCP aggregator — fronts multiple MCP servers behind a single Streamable HTTP endpoint, shareable across clients.
5
5
  Project-URL: Homepage, https://github.com/georgeharker/mcp-companion
6
6
  Project-URL: Repository, https://github.com/georgeharker/mcp-companion
@@ -735,6 +735,22 @@ class OAuthConfig(BaseModel):
735
735
  PUBLIC_URL_ENV = "MCP_COMBINER_OAUTH_PUBLIC_URL"
736
736
 
737
737
 
738
+ def _complete_url(value: str) -> str:
739
+ """A bare host becomes a URL: ``http://`` when there's no scheme, and the
740
+ combiner's port on plain ``http`` with none (``https`` keeps 443)."""
741
+ if "://" not in value:
742
+ value = f"http://{value}"
743
+ scheme, _, rest = value.partition("://")
744
+ authority, slash, path = rest.partition("/")
745
+ from mcp_combiner.ui_host.advertise import _has_port
746
+
747
+ if scheme == "http" and not _has_port(authority):
748
+ from mcp_combiner.runtime import RUNTIME
749
+
750
+ authority = f"{authority}:{RUNTIME.serve_port or 9741}"
751
+ return f"{scheme}://{authority}{slash}{path}"
752
+
753
+
738
754
  def resolve_public_url(setting: str | None) -> str | None:
739
755
  """The concrete ``oauth.public_url``.
740
756
 
@@ -744,9 +760,9 @@ def resolve_public_url(setting: str | None) -> str | None:
744
760
  URL with ``{auto}`` as its host (``https://{auto}`` for ``tailscale
745
761
  serve``). No tailnet → ``None``: links use the loopback callback.
746
762
  """
747
- env = os.environ.get(PUBLIC_URL_ENV, "").strip()
763
+ env = os.environ.get(PUBLIC_URL_ENV, "").strip().rstrip("/")
748
764
  if env:
749
- return env.rstrip("/")
765
+ return _complete_url(env)
750
766
  from mcp_combiner.ui_host.advertise import AUTO, AUTO_HOST, tailnet_host
751
767
 
752
768
  value = (setting or "").strip().rstrip("/")
@@ -757,7 +773,7 @@ def resolve_public_url(setting: str | None) -> str | None:
757
773
  elif "://" not in value:
758
774
  value = f"http://{value}"
759
775
  if AUTO_HOST not in value:
760
- return value
776
+ return _complete_url(value)
761
777
  name = tailnet_host()
762
778
  if name is None:
763
779
  logger.info("oauth.public_url %s: no tailnet here — links use the loopback callback", value)
@@ -1391,6 +1391,21 @@ class MockOAuthProvider:
1391
1391
  await send({"type": "http.response.body", "body": body})
1392
1392
 
1393
1393
 
1394
+ def _issuer_url(setting: str | None, local_host: str, port: int) -> str:
1395
+ """The mock's advertised issuer: *setting* (``auto`` = the tailnet name),
1396
+ else ``http://<local_host>:<port>``."""
1397
+ if setting is None:
1398
+ return f"http://{local_host}:{port}"
1399
+ if setting.strip().lower() == "auto":
1400
+ from mcp_combiner.ui_host.advertise import tailnet_host
1401
+
1402
+ name = tailnet_host()
1403
+ if name is None:
1404
+ raise SystemExit("--issuer auto: no tailnet on this machine")
1405
+ return f"http://{name}:{port}"
1406
+ return setting.rstrip("/")
1407
+
1408
+
1394
1409
  def pin_handshake_only(mcp_srv: FastMCP) -> None:
1395
1410
  """Answer server/discover with no supported versions, so a probing client
1396
1411
  (and the combiner's protocol: auto) uses the handshake. HTTP only: on an
@@ -1456,6 +1471,17 @@ def main(argv: list[str] | None = None) -> None:
1456
1471
  "mock__end_session and a visible session_id on mock__remember / mock__recall."
1457
1472
  ),
1458
1473
  )
1474
+ parser.add_argument(
1475
+ "--issuer",
1476
+ default=None,
1477
+ metavar="URL",
1478
+ help=(
1479
+ "With --oauth: the authorization server URL the mock advertises, where "
1480
+ "browsers are sent to log in (default: http://<host>:<port>). 'auto' = "
1481
+ "this machine's tailnet name on --port, so a phone can authorize; bind "
1482
+ "--host to every interface (or the tailnet address) to serve it."
1483
+ ),
1484
+ )
1459
1485
  parser.add_argument(
1460
1486
  "--oauth",
1461
1487
  action="store_true",
@@ -1479,8 +1505,13 @@ def main(argv: list[str] | None = None) -> None:
1479
1505
  parser.error("--oauth requires --transport http")
1480
1506
  import uvicorn
1481
1507
 
1482
- issuer = f"http://{args.host}:{args.port}"
1483
- provider = MockOAuthProvider(resource_url=f"{issuer}/mcp", issuer_url=issuer)
1508
+ from mcp_combiner.binding import WILDCARDS
1509
+
1510
+ local = "127.0.0.1" if args.host in WILDCARDS else args.host
1511
+ issuer = _issuer_url(args.issuer, local, args.port)
1512
+ provider = MockOAuthProvider(
1513
+ resource_url=f"http://{local}:{args.port}/mcp", issuer_url=issuer
1514
+ )
1484
1515
  mcp_srv, _state = build_server(
1485
1516
  args.name, args.transport, specs, state_dir, provider, args.sessions
1486
1517
  )
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "mcp-combiner"
3
- version = "0.20.0-dev.3"
3
+ version = "0.20.0-dev.4"
4
4
  description = "An MCP aggregator — fronts multiple MCP servers behind a single Streamable HTTP endpoint, shareable across clients."
5
5
  requires-python = ">=3.12"
6
6
  license = "MIT"
@@ -30,6 +30,9 @@ def _tailnet(monkeypatch: pytest.MonkeyPatch) -> None:
30
30
  ("https://auto", "https://auto"), # a host named auto is just a host
31
31
  ("https://combiner.example.com/", "https://combiner.example.com"),
32
32
  ("combiner.example.com:9741", "http://combiner.example.com:9741"),
33
+ ("combiner.example.com", "http://combiner.example.com:9741"),
34
+ ("http://[fd7a::1]", "http://[fd7a::1]:9741"),
35
+ ("http://[fd7a::1]:80", "http://[fd7a::1]:80"),
33
36
  ("", None),
34
37
  (None, None),
35
38
  ],
@@ -44,6 +47,9 @@ def test_the_env_var_is_a_literal_url_and_wins(monkeypatch: pytest.MonkeyPatch)
44
47
  assert OAuthConfig.from_dict({}).public_url == "https://auth.example.com"
45
48
  monkeypatch.setenv(PUBLIC_URL_ENV, "https://{auto}") # not special in the env
46
49
  assert resolve_public_url(None) == "https://{auto}"
50
+ # A bare host (as easily typed into a shell profile) is completed.
51
+ monkeypatch.setenv(PUBLIC_URL_ENV, "box.example.ts.net")
52
+ assert resolve_public_url(None) == "http://box.example.ts.net:9741"
47
53
 
48
54
 
49
55
  def test_auto_without_a_tailnet_means_loopback_links(monkeypatch: pytest.MonkeyPatch) -> None:
@@ -712,7 +712,7 @@ wheels = [
712
712
 
713
713
  [[package]]
714
714
  name = "mcp-combiner"
715
- version = "0.20.0-dev.3"
715
+ version = "0.20.0-dev.4"
716
716
  source = { editable = "." }
717
717
  dependencies = [
718
718
  { name = "fastmcp" },