elan-cli 0.1.8__tar.gz → 0.1.9__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 (33) hide show
  1. {elan_cli-0.1.8 → elan_cli-0.1.9}/CHANGELOG.md +10 -0
  2. {elan_cli-0.1.8 → elan_cli-0.1.9}/PKG-INFO +2 -2
  3. {elan_cli-0.1.8 → elan_cli-0.1.9}/pyproject.toml +2 -2
  4. {elan_cli-0.1.8 → elan_cli-0.1.9}/src/elan_cli/main.py +20 -1
  5. elan_cli-0.1.9/src/elan_cli/mcp.py +47 -0
  6. {elan_cli-0.1.8 → elan_cli-0.1.9}/.gitignore +0 -0
  7. {elan_cli-0.1.8 → elan_cli-0.1.9}/LICENSE +0 -0
  8. {elan_cli-0.1.8 → elan_cli-0.1.9}/README.md +0 -0
  9. {elan_cli-0.1.8 → elan_cli-0.1.9}/src/elan_cli/__init__.py +0 -0
  10. {elan_cli-0.1.8 → elan_cli-0.1.9}/src/elan_cli/adk.py +0 -0
  11. {elan_cli-0.1.8 → elan_cli-0.1.9}/src/elan_cli/auth.py +0 -0
  12. {elan_cli-0.1.8 → elan_cli-0.1.9}/src/elan_cli/child.py +0 -0
  13. {elan_cli-0.1.8 → elan_cli-0.1.9}/src/elan_cli/client.py +0 -0
  14. {elan_cli-0.1.8 → elan_cli-0.1.9}/src/elan_cli/config.py +0 -0
  15. {elan_cli-0.1.8 → elan_cli-0.1.9}/src/elan_cli/deploy.py +0 -0
  16. {elan_cli-0.1.8 → elan_cli-0.1.9}/src/elan_cli/destroy.py +0 -0
  17. {elan_cli-0.1.8 → elan_cli-0.1.9}/src/elan_cli/doctor.py +0 -0
  18. {elan_cli-0.1.8 → elan_cli-0.1.9}/src/elan_cli/env.py +0 -0
  19. {elan_cli-0.1.8 → elan_cli-0.1.9}/src/elan_cli/files.py +0 -0
  20. {elan_cli-0.1.8 → elan_cli-0.1.9}/src/elan_cli/invoke.py +0 -0
  21. {elan_cli-0.1.8 → elan_cli-0.1.9}/src/elan_cli/logs.py +0 -0
  22. {elan_cli-0.1.8 → elan_cli-0.1.9}/src/elan_cli/manifests.py +0 -0
  23. {elan_cli-0.1.8 → elan_cli-0.1.9}/src/elan_cli/project.py +0 -0
  24. {elan_cli-0.1.8 → elan_cli-0.1.9}/src/elan_cli/projects.py +0 -0
  25. {elan_cli-0.1.8 → elan_cli-0.1.9}/src/elan_cli/prompt.py +0 -0
  26. {elan_cli-0.1.8 → elan_cli-0.1.9}/src/elan_cli/rollback.py +0 -0
  27. {elan_cli-0.1.8 → elan_cli-0.1.9}/src/elan_cli/scaffold.py +0 -0
  28. {elan_cli-0.1.8 → elan_cli-0.1.9}/src/elan_cli/scan.py +0 -0
  29. {elan_cli-0.1.8 → elan_cli-0.1.9}/src/elan_cli/secret.py +0 -0
  30. {elan_cli-0.1.8 → elan_cli-0.1.9}/src/elan_cli/stream.py +0 -0
  31. {elan_cli-0.1.8 → elan_cli-0.1.9}/src/elan_cli/tenant.py +0 -0
  32. {elan_cli-0.1.8 → elan_cli-0.1.9}/src/elan_cli/validate.py +0 -0
  33. {elan_cli-0.1.8 → elan_cli-0.1.9}/src/elan_cli/wallet.py +0 -0
@@ -3,6 +3,16 @@
3
3
  Versions follow the tag that published them — `cli/v*`. A version with no date
4
4
  has not been published yet.
5
5
 
6
+ ## 0.1.9 — 2026-11-19
7
+
8
+ ### Added
9
+
10
+ - `elan mcp token <server>`: a token for one of this project's public `auth: platform` MCP servers, printed alone on stdout so `$(elan mcp token tides)` is the whole of using it; the server's URL and when it expires go to stderr (ADR-0255). It reaches that one server and never the platform API.
11
+
12
+ ### Changed
13
+
14
+ - Needs contracts 0.3.2, so an upgrade brings `elan validate` the `server:` binding rules the build applies: a binding to one of the project's own MCP servers, and the end user's credential on a binding to an `auth: server` one.
15
+
6
16
  ## 0.1.8 — 2026-11-19
7
17
 
8
18
  ### Added
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: elan-cli
3
- Version: 0.1.8
3
+ Version: 0.1.9
4
4
  Summary: The command line a developer deploys an agent with
5
5
  Project-URL: Homepage, https://openelan.ai
6
6
  Project-URL: Documentation, https://openelan.ai/app/docs
@@ -16,7 +16,7 @@ Classifier: Programming Language :: Python :: 3.13
16
16
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
17
17
  Requires-Python: >=3.12
18
18
  Requires-Dist: certifi>=2024.2.2
19
- Requires-Dist: elan-agentkit-contracts>=0.3.0
19
+ Requires-Dist: elan-agentkit-contracts>=0.3.2
20
20
  Requires-Dist: elan-sdk
21
21
  Requires-Dist: httpx>=0.27
22
22
  Requires-Dist: keyring>=25.0
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "elan-cli"
3
- version = "0.1.8"
3
+ version = "0.1.9"
4
4
  description = "The command line a developer deploys an agent with"
5
5
  readme = "README.md"
6
6
  requires-python = ">=3.12"
@@ -29,7 +29,7 @@ dependencies = [
29
29
  # so `uv tool install elan-cli` no longer pulls a token verifier, a
30
30
  # database layer and a Pub/Sub broker onto a developer's laptop to read one
31
31
  # YAML file.
32
- "elan-agentkit-contracts>=0.3.0",
32
+ "elan-agentkit-contracts>=0.3.2",
33
33
  # THE SHARED CLIENT CODE, ONE WAY (ADR-0104). `text_of` and the certifi
34
34
  # context live there now; this re-exports them. The dependency runs
35
35
  # elan-cli -> elan-sdk and never back: the SDK must not import `elan_cli`,
@@ -36,6 +36,7 @@ from elan_cli import destroy as destroy_cmd
36
36
  from elan_cli import doctor as doctor_cmd
37
37
  from elan_cli import invoke as invoke_cmd
38
38
  from elan_cli import logs as logs_cmd
39
+ from elan_cli import mcp as mcp_cmd
39
40
  from elan_cli import projects as projects_cmd
40
41
  from elan_cli import scan as scan_cmd
41
42
  from elan_cli.auth import AuthError
@@ -64,7 +65,7 @@ from elan_cli.wallet import WalletError
64
65
  #: positive predicate over an open set is a sampling method rather than a guard.
65
66
  REFUSALS = (ProjectError, ConfigError, AuthError, ApiError, SecretError,
66
67
  WalletError, FilesError, ManifestError, StreamError,
67
- scan_cmd.ScanError)
68
+ scan_cmd.ScanError, mcp_cmd.McpError)
68
69
 
69
70
 
70
71
  def version_line() -> str:
@@ -260,6 +261,14 @@ def build_parser() -> argparse.ArgumentParser:
260
261
  scan_schedule.add_argument("--project", dest="schedule_project", default="",
261
262
  help="defaults to the project in elan.yaml")
262
263
 
264
+ mcp = sub.add_parser("mcp", help="this project's MCP servers")
265
+ mcp_sub = mcp.add_subparsers(dest="mcp_command")
266
+ mcp_token = mcp_sub.add_parser(
267
+ "token", help="a token for one public MCP server, printed to stdout")
268
+ mcp_token.add_argument("server", help="the MCP server's slug")
269
+ mcp_token.add_argument("--project", default="",
270
+ help="defaults to the project in elan.yaml")
271
+
263
272
  # PLATFORM STAFF ONLY, enforced by the service rather than here. A CLI that
264
273
  # refused locally would be a second rule to keep in step with the one that
265
274
  # actually holds the credential.
@@ -549,6 +558,16 @@ def _dispatch(args, parser) -> int:
549
558
  finally:
550
559
  api.close()
551
560
 
561
+ if args.command == "mcp":
562
+ if args.mcp_command != "token":
563
+ parser.parse_args(["mcp", "--help"])
564
+ return 2
565
+ api = Api(Config.load())
566
+ try:
567
+ return mcp_cmd.token(api, args.server, mcp_cmd.project_of(args.project))
568
+ finally:
569
+ api.close()
570
+
552
571
  if args.command == "agents":
553
572
  config = Config.load()
554
573
  api = Api(config)
@@ -0,0 +1,47 @@
1
+ """`elan mcp token <server>`: a token for one of this project's public MCP servers.
2
+
3
+ WHAT IT IS FOR. A public `auth: platform` server takes a token minted for it
4
+ and for nothing else (ADR-0255) — paste it into an MCP client, or send it from
5
+ a script, as `Authorization: Bearer <token>`. It reaches that one server and
6
+ never the platform API, which is why it is not the token this CLI holds.
7
+
8
+ THE TOKEN GOES TO STDOUT AND NOTHING ELSE DOES, so `$(elan mcp token tides)`
9
+ is the whole of using it. Where it works and when it expires go to stderr.
10
+
11
+ A MACHINE DOES NOT NEED THIS. A backend holding a service user's credential
12
+ asks `POST /v1/token` with `grant_type=client_credentials&resource=<url>`,
13
+ the standard grant, and gets the same token.
14
+ """
15
+
16
+ from __future__ import annotations
17
+
18
+ import sys
19
+ from urllib.parse import quote
20
+
21
+ from elan_cli.client import Api
22
+ from elan_cli.project import ProjectError, find
23
+
24
+
25
+ class McpError(Exception):
26
+ """An MCP command that cannot be sent, already phrased for the developer."""
27
+
28
+
29
+ def project_of(explicit: str) -> str:
30
+ """The project to act in: what was asked for, or what `elan.yaml` says."""
31
+ if explicit.strip():
32
+ return explicit.strip()
33
+ try:
34
+ return find().spec.project
35
+ except ProjectError as exc:
36
+ raise McpError("which project? run this inside one, or pass --project "
37
+ f"({exc})") from exc
38
+
39
+
40
+ def token(api: Api, server: str, project: str) -> int:
41
+ answer = api.request(
42
+ "POST", f"/v1/projects/{quote(project)}/mcp-servers/{quote(server)}/token")
43
+ print(answer["access_token"])
44
+ minutes = max(1, int(answer.get("expires_in", 0)) // 60)
45
+ print(f"for {answer.get('resource', server)}; expires in {minutes} minutes",
46
+ file=sys.stderr)
47
+ return 0
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes