@maanster/dreamaan-mcp 0.4.0 → 0.5.2

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,29 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.5.2] - 2026-10-09
4
+
5
+ - Publish maintained skill files and ZIP through HTTP with version, compatibility, SHA-256 checksums and conditional downloads.
6
+ - Expose the same manifest through workflow_get and the MCP production_manifest resource.
7
+ - Derive skill metadata directly from SKILL.md to prevent version drift.
8
+
9
+ ## [0.5.1] - 2026-10-09
10
+
11
+ - Skill 0.3.1 explains endpoint-specific asset-link roles, direction, pinned files, collections and frame/video examples.
12
+ - Category metadata guidance avoids duplicating native prompts, generation costs, media/version facts and review/assignment state; preserves existing values on updates.
13
+ - Clarify link and metadata tool descriptions and refresh the shared downloadable skill.
14
+
15
+ ## [0.5.0] - 2026-10-09
16
+
17
+ - Dreamaan production skill 0.3.0: screenplay structure, reusable assets, frame-to-video continuity, assignments/reviews and budgets.
18
+ - Free workflow_get tool, production_workflow prompt and nine workflow resources expose the same maintained skill to different MCP clients.
19
+ - Reproducible skill bundle export for web downloads and client setup.
20
+
21
+ ## [0.4.1] - 2026-10-09
22
+
23
+ - Standalone public installation, login, MCP connection and upload documentation.
24
+ - Remove private repository links and developer-only guidance from the package README and client guides.
25
+ - Correct skill guidance for browser OAuth and document proprietary licensing.
26
+
3
27
  ## [0.4.0] - 2026-10-08
4
28
 
5
29
  - Public browser OAuth with PKCE for the local CLI; private shared profiles refresh and revoke tokens, and stdio uses the same login.
package/README.md CHANGED
@@ -1,132 +1,124 @@
1
1
  # Dreamaan MCP
2
2
 
3
- Stateless Model Context Protocol service for Dreamaan: MCP spec `2026-07-28` (SDK v2) and 2025-era clients on the same endpoint, over Streamable HTTP and stdio. The service exposes project, cinema, assets, generation, model, collaboration and administration tools with permission checks, bounded responses, resources and read-only workflow prompts.
3
+ Connect your AI assistant to Dreamaan to work with projects, assets, generation models and collaboration workflows. Your Dreamaan account, project permissions and spending limits apply to every connection.
4
4
 
5
- Design, architecture, tool catalog, and implementation issues are maintained in the [Dreamaan MCP design docs](https://github.com/copilot-rast/dreamaan/tree/dev/docs/mcp).
5
+ **One package: `@maanster/dreamaan-mcp`.** It includes `dreamaan-mcp`, the local MCP server, and `dreamaan`, the terminal command for login, diagnostics and uploads.
6
6
 
7
- This repository is included as the `dreamaan-mcp` submodule of [Dreamaan](https://github.com/copilot-rast/dreamaan). Development targets the `dev` branch.
7
+ ## Do I need this package?
8
8
 
9
- ## Client guides
9
+ - **Dreamaan web app:** no package required.
10
+ - **Hosted MCP connection:** no package required. Add the remote MCP URL provided by your Dreamaan environment to a client supporting Streamable HTTP and OAuth.
11
+ - **Local MCP connection or terminal uploads:** install this package.
10
12
 
11
- - [Installation and hosted/local connection](docs/client/install.md)
12
- - [Companion CLI](docs/client/cli.md): login, diagnostics and local uploads
13
- - [Asset upload workflow and host limitations](docs/client/uploads.md)
14
- - [Dreamaan workflow skill](docs/client/skill.md)
15
- - [Client OAuth and upload conventions](docs/client/conventions.md)
16
- - [Backend requirements and pagination migration](docs/client/pagination.md)
13
+ Hosted and local connections have separate sign-in sessions. Installing the package does not grant access to Dreamaan projects.
17
14
 
18
- - [راهنمای فارسی اتصال ChatGPT، Claude و Codex](docs/mcp/CLIENTS-FA.md) — OAuth, HTTP/stdio, access, spending and troubleshooting.
15
+ ## Requirements
19
16
 
20
- ## Develop
17
+ - Node.js 22 or later.
18
+ - Linux or macOS for local credential and upload-state storage. Windows is currently unsupported.
19
+ - A Dreamaan account and access to the projects you intend to use.
20
+ - Your environment's API URL, including `/api`. Use the URL provided by your Dreamaan administrator; do not substitute a web-app or MCP URL.
21
21
 
22
- Node 22, pnpm.
22
+ ## Install
23
23
 
24
- ```bash
25
- pnpm install
26
- cp .env.example .env # then export the variables, e.g. set -a; . ./.env; set +a
27
- pnpm dev # http transport on 127.0.0.1:3100, restarts on change
28
- pnpm lint && pnpm typecheck && pnpm test && pnpm build
24
+ ```sh
25
+ npm install --global @maanster/dreamaan-mcp@0.5.1
26
+ dreamaan-mcp --version
27
+ dreamaan --help
29
28
  ```
30
29
 
31
- ```bash
32
- node dist/bin/dreamaan-mcp.js --help
33
- node dist/bin/dreamaan-mcp.js --transport http # POST /mcp, GET /health, GET /ready
34
- node dist/bin/dreamaan-mcp.js --transport stdio # JSON-RPC on stdin/stdout, logs on stderr
30
+ The package is public: downloading it does not require an npm account. Accessing Dreamaan requires Dreamaan authentication.
31
+
32
+ ## Sign in
33
+
34
+ Replace `YOUR_API_HOST` with your environment's API host:
35
+
36
+ ```sh
37
+ dreamaan login --api-url https://YOUR_API_HOST/api
35
38
  ```
36
39
 
37
- ## Authentication
40
+ Approve access in your browser. The CLI saves a private local profile and refreshes OAuth tokens automatically. If the browser cannot open automatically, add `--no-browser` and open the printed link on the same computer.
38
41
 
39
- Every request to `/mcp` passes an HTTP gate (`src/auth/gate.ts`) before the SDK: Host/Origin, then the credential. A missing or invalid credential is a real HTTP 401 challenge; credentials are read only from the `Authorization` header.
42
+ ```sh
43
+ dreamaan whoami --api-url https://YOUR_API_HOST/api
44
+ dreamaan doctor --api-url https://YOUR_API_HOST/api
45
+ ```
40
46
 
41
- - **Credentials:** `dmn_key_…` API keys, and (when `DREAMAAN_ISSUER` is set) MCP-audience OAuth access tokens (`aud` = `MCP_PUBLIC_URL`, verified against the issuer's JWKS). Login JWTs and internal API tokens are rejected.
42
- - **HTTP: token exchange, always.** Every credential is exchanged (RFC 8693, `private_key_jwt`) for a 5-minute internal API token, cached until `exp - 30 s` and evicted on any API 401. Needs `DREAMAAN_ISSUER`, `MCP_OAUTH_CLIENT_ID`, `MCP_OAUTH_PRIVATE_KEY` and `MCP_PUBLIC_URL`. On HTTP there is no direct path and no flag: without the OAuth settings the http transport refuses to start, and no credential is ever forwarded as-is.
43
- - **Grant:** loaded from `GET /api/auth/me` and cached for `MCP_GRANT_CACHE_TTL_MS` (default and maximum 30 s, ARCHITECTURE §5.4). Grants are multi-organization: the context carries the organization and project access policy, and the organization for a call is the tool's explicit `orgId`, never a default.
44
- - **No capabilities:** API keys and OAuth connections have no read/generate/write/admin-style scopes, and every tool is listed for every grant. A grant's access is only its organizations and projects, an optional spend cap, expiry and revocation, and everything stays bounded by the user's own RBAC, organization policy, budgets and the preview/confirm step of risky tools. OAuth carries one fixed scope string, `dreamaan:access`, for protocol compatibility only; it grants nothing by itself.
45
- - **stdio: the user’s local login, sent to its API.** Run `dreamaan login --api-url https://YOUR_API_HOST/api` for public browser OAuth with PKCE, or use `DREAMAAN_API_KEY`. The local MCP server uses the saved private profile, refreshes rotating tokens and validates the live grant; it never launches a browser inside stdio. Configure `DREAMAAN_API_URL`; no confidential OAuth key is needed. Usage is direct API traffic. See [CLI setup](docs/client/cli.md).
47
+ ## Connect a local MCP client
48
+
49
+ After signing in, configure your client's local MCP server entry:
50
+
51
+ ```json
52
+ {
53
+ "mcpServers": {
54
+ "dreamaan": {
55
+ "command": "dreamaan-mcp",
56
+ "args": ["--transport", "stdio"],
57
+ "env": {
58
+ "DREAMAAN_API_URL": "https://YOUR_API_HOST/api"
59
+ }
60
+ }
61
+ }
62
+ }
63
+ ```
46
64
 
47
- ### Revocation latency
65
+ This is a common JSON configuration shape; use your client's equivalent if it differs. The client must be able to find the globally installed executable. If necessary, use its absolute path. Restart the MCP connection after changing configuration.
48
66
 
49
- Revoking a grant (an API key or an OAuth consent) takes effect on a running MCP process after at most `MCP_GRANT_CACHE_TTL_MS` (30 s by default; it cannot be set higher). Two caches are involved:
67
+ The local server uses the saved login for that API URL. Alternatively, provide a dedicated `DREAMAAN_API_KEY` in the client environment. An explicit API key takes precedence over the saved OAuth profile.
50
68
 
51
- - the **grant cache** (`GET /auth/me`, at most 30 s): within it the process still serves the cached grant;
52
- - the **internal token** (5 minutes, reused until `exp - 30 s`): it is not re-checked by the MCP, but the Dreamaan API refuses a token of a revoked grant, and any API 401 evicts both the token and the cached grant. So the internal token does not extend the 30 s bound for calls that reach the API; it only means the exchange is not repeated until the token nears expiry.
69
+ Your assistant can discover projects, browse assets, inspect model constraints, prepare references, quote generation costs and track jobs. Ask it to show the quote before starting paid generation. Available actions remain limited by your permissions and the connected environment.
53
70
 
54
- A process that has nothing cached (a restart) exchanges again and the backend refuses a revoked grant at once.
71
+ ## Upload an asset
55
72
 
56
- `WEB_BASE_URL` (default `http://localhost:7070`) is the base of every `webUrl` (`<url>/go/<type>/<id>`).
73
+ Upload a local original file and register it as a new asset:
57
74
 
58
- `DREAMAAN_API_URL` is required and includes the API prefix (for example `http://localhost:3000/api`); `/health` probes `${DREAMAAN_API_URL}/health`. See `--help` for every variable.
75
+ ```sh
76
+ dreamaan upload --api-url https://YOUR_API_HOST/api \
77
+ --file ./reference.png --project PROJECT_ID \
78
+ --name 'Reference image' --code REF-01 \
79
+ --state ./reference-upload.json --json
80
+ ```
59
81
 
60
- ## Observability
82
+ Use real project IDs from Dreamaan. To add a file version to an existing asset, replace `--name` and `--code` with `--asset ASSET_ID`. Keep the state file until completion; repeat the same command with `--resume` after an interruption. For large files, add `--transfer direct`.
61
83
 
62
- Off by default. Set `OTEL_EXPORTER_OTLP_ENDPOINT` (OTLP/HTTP collector; the standard `OTEL_EXPORTER_OTLP_*` headers/per-signal overrides, `OTEL_SERVICE_NAME` and `OTEL_METRIC_EXPORT_INTERVAL` also apply) to start the OpenTelemetry Node SDK at process start (`src/telemetry/`). Without it every call is a no-op. The exporters never write to stdout (stdio keeps it for JSON-RPC); SDK diagnostics go to stderr. A graceful shutdown flushes telemetry after the 10 s request drain (flush bounded to 5 s more).
84
+ A displayed chat image is not automatically uploadable: the AI client must expose the original bytes, or you must save the file locally and use the CLI. Uploads register assets; comments and reviews reference those assets.
63
85
 
64
- - **Traces:** a server span per HTTP request (continues an incoming `traceparent`), the `mcp.tool` span, and one client span per API attempt; the API call carries that span's `traceparent`.
65
- - **Metrics** (OTel name, Prometheus form `mcp_tool_calls_total`, `mcp_tool_duration_seconds`, ...):
66
- `mcp.tool.calls` and `mcp.tool.duration` (`tool.name`, `outcome`: `ok` or the failure kind; a truncated success is `ok`),
67
- `mcp.http.auth_failures` (`status` 401/403, `reason`), `mcp.http.active_requests`,
68
- `mcp.token_exchanges` and `mcp.token_exchange.duration` (`outcome`: `ok`, `invalid` = revoked or unknown credential, `unavailable` = exchange/issuer failure),
69
- `mcp.api.duration`, `mcp.api.errors` (`http.route`, `http.request.method`, `error.type`) and `mcp.api.rate_limited` (429s from the API); `http.route` is a template (`/projects/:id`), never a raw path,
70
- `mcp.credits.started` (`grant.id`, `org.id`), `mcp.generation_wait.calls|degraded|duration`, `mcp.job.snapshot_states` (`state`), `mcp.job.replays`.
71
- - **Never in attributes:** credentials, tokens, prompts or user content. Only tool name, outcome, grant id/kind/key prefix, org id, route template and status.
86
+ ## Troubleshooting
72
87
 
73
- ### Probes
88
+ | Problem | What to do |
89
+ | ---------------------------------- | --------------------------------------------------------------------------------------------------------- |
90
+ | Executable not found | Check Node.js version and your global npm executable path; use an absolute path in the MCP configuration. |
91
+ | Sign-in expired or revoked | Run `dreamaan login` again for the exact API URL. |
92
+ | Access denied | Check the selected projects, connection permissions and your Dreamaan membership. |
93
+ | API unreachable | Run `dreamaan doctor`; verify the API URL and network access. |
94
+ | Upload exceeds the streaming limit | Use `--transfer direct`; the environment still enforces file-size and quota limits. |
95
+ | Upload interrupted | Preserve its state file and retry with `--resume`. |
96
+ | A workflow is unavailable | Ask your Dreamaan administrator whether the environment supports it. |
74
97
 
75
- - `GET /health`: liveness. 200 whenever the process serves; the body carries `status` (`ok`/`degraded`) and `apiReachable` for humans. It never fails on a dependency, so an API outage does not restart the service. The Docker `HEALTHCHECK` uses it.
76
- - `GET /ready`: readiness. 503 when `${DREAMAAN_API_URL}/health` is unreachable (cached 5 s) or the required auth config is missing, 200 otherwise (`checks.api`, `checks.auth`). Use it as the load balancer / Traefik health check.
98
+ For account or environment help, contact your Dreamaan administrator or your existing Dreamaan support channel. Include the package version, command or tool name, and a redacted error message. Do not include credentials or signed upload URLs.
77
99
 
78
- ## Layout
100
+ ## Update, logout and remove
79
101
 
80
- ```
81
- src/bin/dreamaan-mcp.ts CLI entry
82
- src/cli.ts argument parsing, transport selection, shutdown
83
- src/config.ts zod-validated environment
84
- src/server.ts McpServer factory (one per request / connection)
85
- src/context.ts ToolContext: grant, org/project access, trace id
86
- src/auth/ HTTP gate, JWT/JWKS verification, token exchange, grant loading, stdio key
87
- src/tools/ tools built with defineTool() (_framework.ts); index.ts is the registry,
88
- _lint.ts the lint rules the tests apply to every tool
89
- src/shape/ entity/job shapers (webUrl, civil dates, job snapshots), size guard
90
- src/transport/ http.ts, stdio.ts, health.ts
91
- src/telemetry/ OpenTelemetry bootstrap (sdk.ts) and metric instruments (metrics.ts)
92
- test/{unit,contract,e2e}
102
+ ```sh
103
+ npm install --global @maanster/dreamaan-mcp@latest
104
+ dreamaan logout --api-url https://YOUR_API_HOST/api
105
+ npm uninstall --global @maanster/dreamaan-mcp
93
106
  ```
94
107
 
95
- ## Manual round trip (the temporary `ping` tool)
108
+ OAuth logout revokes the CLI connection and removes its local profile. Uninstalling the package alone does not revoke a connection. Manage other connected apps and API keys separately in Dreamaan settings.
96
109
 
97
- > **Warning: API keys sit in plaintext in client config files.** The `dmn_key_…` value you put in `claude_desktop_config.json`, `.mcp.json`, `config.toml` or a `--header` argument is stored unencrypted, readable by anything that can read that file, and can end up in shell history. Create a separate key per client, grant it only the scopes that client needs (not admin, billing or delete unless required) and set a short expiry. Never commit the file, and revoke the key at once if it leaks.
110
+ ## Production skill and workflows
98
111
 
99
- Claude Code over HTTP:
112
+ The package includes the Dreamaan production skill (version 0.3.1): screenplay breakdown into sequences/plans/outputs, character/location/prop preparation and linking, version-pinned frames to videos, assignments/reviews and production budgeting.
100
113
 
101
- ```bash
102
- # needs the token exchange (see Authentication): the issuer, client id/key and public URL
103
- DREAMAAN_API_URL=http://localhost:3000/api DREAMAAN_ISSUER=http://localhost:3000 \
104
- MCP_OAUTH_CLIENT_ID=dreamaan-mcp MCP_OAUTH_PRIVATE_KEY="$(cat client-key.pem)" \
105
- MCP_PUBLIC_URL=http://127.0.0.1:3100/mcp pnpm dev
106
- claude mcp add --transport http dreamaan-local http://127.0.0.1:3100/mcp --header "Authorization: Bearer dmn_key_..."
107
- # in Claude Code: /mcp shows dreamaan-local; ask it to call the ping tool -> "pong"
108
- ```
114
+ Run `npm root --global`, then copy the complete `@maanster/dreamaan-mcp/skills/dreamaan` folder to your client's skills directory. Keep its reference guides with it and connect Dreamaan MCP. A skill-capable client can then use it for requests such as “Break this screenplay into plans and propose an asset checklist and budget” or “Create a reviewed frame-to-video pilot for this plan.”
109
115
 
110
- Claude Desktop over stdio (`claude_desktop_config.json`):
116
+ Dreamaan web settings also provide a downloadable skill bundle and client instructions. Clients without skill installation can call `workflow_get`, read `dreamaan://workflows/overview`, or use the `production_workflow` prompt if supported. These guides never perform writes or spending themselves.
111
117
 
112
- ```json
113
- {
114
- "mcpServers": {
115
- "dreamaan-local": {
116
- "command": "node",
117
- "args": ["/absolute/path/to/dreamaan-mcp/dist/bin/dreamaan-mcp.js", "--transport", "stdio"],
118
- "env": {
119
- "DREAMAAN_API_URL": "http://localhost:3000/api",
120
- "DREAMAAN_API_KEY": "dmn_key_..."
121
- }
122
- }
123
- }
124
- }
125
- ```
118
+ ## Additional guides
119
+
120
+ The installed package includes `docs/client/` guides for login, uploads, paging and the optional `skills/dreamaan/` workflow skill. These files are bundled with the package; no source-repository access is required. To locate a global installation, run `npm root --global`, then open its `@maanster/dreamaan-mcp` folder.
126
121
 
127
- See [output apps and client capabilities](docs/output-apps.md) for the optional
128
- read-only media player/contact sheet, trusted storage origin and text fallbacks.
122
+ ## License
129
123
 
130
- Package artifact review and public publication are documented in
131
- [docs/package-release.md](docs/package-release.md). Version `0.2.0` is Unreleased;
132
- no public npm distribution is authorized.
124
+ Dreamaan MCP is proprietary, closed-source software. This package is distributed with `UNLICENSED` metadata and does not grant an open-source license. Public npm availability does not make Dreamaan's source repositories public or grant rights to redistribute or modify the software. Contact Dreamaan for applicable licensing terms.