uthana-mcp 0.1.0__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 (75) hide show
  1. uthana_mcp-0.1.0/.flake8 +5 -0
  2. uthana_mcp-0.1.0/AGENTS.md +69 -0
  3. uthana_mcp-0.1.0/CODE_OF_CONDUCT.md +5 -0
  4. uthana_mcp-0.1.0/CONTRIBUTING.md +33 -0
  5. uthana_mcp-0.1.0/LICENSE +206 -0
  6. uthana_mcp-0.1.0/MANIFEST.in +8 -0
  7. uthana_mcp-0.1.0/PKG-INFO +218 -0
  8. uthana_mcp-0.1.0/README.md +191 -0
  9. uthana_mcp-0.1.0/SECURITY.md +7 -0
  10. uthana_mcp-0.1.0/docs/api-coverage.md +25 -0
  11. uthana_mcp-0.1.0/docs/first-animation.md +25 -0
  12. uthana_mcp-0.1.0/docs/installation.md +146 -0
  13. uthana_mcp-0.1.0/docs/operations.md +11 -0
  14. uthana_mcp-0.1.0/docs/stitching.md +90 -0
  15. uthana_mcp-0.1.0/examples/tar/README.md +14 -0
  16. uthana_mcp-0.1.0/examples/tar/cXi2eAP19XwQ.fbx +0 -0
  17. uthana_mcp-0.1.0/examples/tar/cXi2eAP19XwQ.glb +0 -0
  18. uthana_mcp-0.1.0/install.ps1 +42 -0
  19. uthana_mcp-0.1.0/install.sh +35 -0
  20. uthana_mcp-0.1.0/pyproject.toml +91 -0
  21. uthana_mcp-0.1.0/setup.cfg +4 -0
  22. uthana_mcp-0.1.0/src/uthana_mcp/WORKFLOW.md +101 -0
  23. uthana_mcp-0.1.0/src/uthana_mcp/__init__.py +1 -0
  24. uthana_mcp-0.1.0/src/uthana_mcp/api.py +444 -0
  25. uthana_mcp-0.1.0/src/uthana_mcp/artifact_io.py +60 -0
  26. uthana_mcp-0.1.0/src/uthana_mcp/attribution.py +32 -0
  27. uthana_mcp-0.1.0/src/uthana_mcp/billing.py +90 -0
  28. uthana_mcp-0.1.0/src/uthana_mcp/catalog.py +169 -0
  29. uthana_mcp-0.1.0/src/uthana_mcp/config.py +54 -0
  30. uthana_mcp-0.1.0/src/uthana_mcp/errors.py +146 -0
  31. uthana_mcp-0.1.0/src/uthana_mcp/fingerprints.py +65 -0
  32. uthana_mcp-0.1.0/src/uthana_mcp/operations.py +822 -0
  33. uthana_mcp-0.1.0/src/uthana_mcp/safe_open.py +160 -0
  34. uthana_mcp-0.1.0/src/uthana_mcp/server.py +752 -0
  35. uthana_mcp-0.1.0/src/uthana_mcp/smoke.py +80 -0
  36. uthana_mcp-0.1.0/src/uthana_mcp/stitching.py +127 -0
  37. uthana_mcp-0.1.0/src/uthana_mcp/store.py +262 -0
  38. uthana_mcp-0.1.0/src/uthana_mcp/validation.py +106 -0
  39. uthana_mcp-0.1.0/src/uthana_mcp.egg-info/PKG-INFO +218 -0
  40. uthana_mcp-0.1.0/src/uthana_mcp.egg-info/SOURCES.txt +73 -0
  41. uthana_mcp-0.1.0/src/uthana_mcp.egg-info/dependency_links.txt +1 -0
  42. uthana_mcp-0.1.0/src/uthana_mcp.egg-info/entry_points.txt +3 -0
  43. uthana_mcp-0.1.0/src/uthana_mcp.egg-info/requires.txt +6 -0
  44. uthana_mcp-0.1.0/src/uthana_mcp.egg-info/top_level.txt +1 -0
  45. uthana_mcp-0.1.0/test.sh +16 -0
  46. uthana_mcp-0.1.0/tests/fakes.py +190 -0
  47. uthana_mcp-0.1.0/tests/fixtures/stitch_contract.json +806 -0
  48. uthana_mcp-0.1.0/tests/platform_support.py +44 -0
  49. uthana_mcp-0.1.0/tests/stdio_fixture.py +13 -0
  50. uthana_mcp-0.1.0/tests/test_api.py +279 -0
  51. uthana_mcp-0.1.0/tests/test_artifact_io.py +146 -0
  52. uthana_mcp-0.1.0/tests/test_artifact_recovery.py +88 -0
  53. uthana_mcp-0.1.0/tests/test_auto_stitch.py +108 -0
  54. uthana_mcp-0.1.0/tests/test_catalog.py +170 -0
  55. uthana_mcp-0.1.0/tests/test_character_prompt.py +183 -0
  56. uthana_mcp-0.1.0/tests/test_environments.py +144 -0
  57. uthana_mcp-0.1.0/tests/test_fingerprints.py +124 -0
  58. uthana_mcp-0.1.0/tests/test_generate_v1.py +37 -0
  59. uthana_mcp-0.1.0/tests/test_image_loop.py +277 -0
  60. uthana_mcp-0.1.0/tests/test_installers.py +63 -0
  61. uthana_mcp-0.1.0/tests/test_mcp_contract_cleanup.py +244 -0
  62. uthana_mcp-0.1.0/tests/test_numeric_replay_protocol.py +64 -0
  63. uthana_mcp-0.1.0/tests/test_operation_guards.py +109 -0
  64. uthana_mcp-0.1.0/tests/test_operations.py +424 -0
  65. uthana_mcp-0.1.0/tests/test_preview_timing.py +121 -0
  66. uthana_mcp-0.1.0/tests/test_protocol.py +159 -0
  67. uthana_mcp-0.1.0/tests/test_read_errors.py +172 -0
  68. uthana_mcp-0.1.0/tests/test_recovery.py +240 -0
  69. uthana_mcp-0.1.0/tests/test_review_regressions.py +299 -0
  70. uthana_mcp-0.1.0/tests/test_rigging_options.py +161 -0
  71. uthana_mcp-0.1.0/tests/test_routing_billing.py +179 -0
  72. uthana_mcp-0.1.0/tests/test_sdk_boundary.py +73 -0
  73. uthana_mcp-0.1.0/tests/test_smoke.py +98 -0
  74. uthana_mcp-0.1.0/tests/test_stitch.py +103 -0
  75. uthana_mcp-0.1.0/uv.lock +1359 -0
@@ -0,0 +1,5 @@
1
+ [flake8]
2
+ # Match Uthana's existing lint policy without depending on a parent checkout.
3
+ ignore = E203,E302,E402,W503,E731,F722,E704
4
+ exclude = .git,.venv,__pycache__,build,dist
5
+ max-line-length = 250
@@ -0,0 +1,69 @@
1
+ # Contributor and agent guide
2
+
3
+ Apply these conventions to new code and the code you change. Preserve existing public interfaces and keep unrelated typing or style migrations out of a focused change.
4
+
5
+ ## Python style
6
+
7
+ - Put imports at module level. Import inside a function only to resolve a circular dependency or avoid a measurable startup cost.
8
+ - Use keyword-only arguments when a function has more than two parameters or has parameters that are easy to swap. Preserve compatibility when changing an existing callable.
9
+ - Annotate new functions and methods with argument and return types when known. Do not add types throughout unrelated existing code just to satisfy a local change.
10
+ - Treat untrusted JSON and provider payloads as `object` until validated. Check container types before accessing fields. Use `type(value) is int` for counts when booleans must be rejected; a failed check leaves the value unknown.
11
+ - Use Pydantic models for structured input schemas owned by this package, with `extra="forbid"` and `strict=True`. Persist `model_dump()` when storing a model as JSON. A boolean or numeric string must not silently become a billed or stored count.
12
+ - Use `TypedDict` for dictionaries this code builds and later updates. Declare optional keys with `NotRequired`. When branches return variations of the same record, build the shared fields once, add the differing fields, and return that record.
13
+ - Put shared keys in a base `TypedDict` and extend it for related records. Unpack a typed shared record rather than rebuilding it with a dict comprehension. Preserve a present key even when its value is `None`, and narrow optional keys explicitly before accessing them.
14
+ - Prefer f-strings, including numeric formatting such as `{count:,}` or `{ratio:.2%}`. Logging calls should keep the logger's deferred format arguments.
15
+ - Use `pathlib.Path` for filesystem paths. Convert strings at the boundary, pass `Path` objects through, and convert back only where an API requires a string. Use `PurePosixPath` for virtual paths that are independent of the operating system.
16
+ - Put fixed limits in named module-level constants. Name each constant for what it bounds; keep shared limits in one place.
17
+ - Prefer a clear comprehension for building a collection. Use `next()` on a generator when only the first match is needed.
18
+ - Prefer early returns for cases that leave the function. When checks share a return, continuation, or error, combine them. Two or three simple comparisons may stay inline; for a long condition, name each piece for the rule it represents and combine those names. Prefer semantic names over splitting one condition into repeated branches. Keep type-narrowing guards inline before reading fields or computing dependent predicates.
19
+
20
+ ```python
21
+ has_wrong_origin = scope != expected_origin
22
+ is_request_pending = state == "pending"
23
+ if has_wrong_origin or is_request_pending:
24
+ return None
25
+ ```
26
+
27
+ - Give a nested `any()` or `all()` a helper or variable when its predicate is complicated. Keep checks that narrow a type in the condition where that type is used.
28
+ - Use `:=` when a lookup is tested and its result is reused, provided it keeps the condition readable. Do not introduce an assignment expression whose name is never read again.
29
+ - Let unexpected errors propagate. Catch an exception when the failure is expected and recovery or another code path is required. At an external boundary, redact credentials and private provider details while preserving a useful error category.
30
+ - Write error messages that say what failed and what to do next. Identify the record, field, or operation and include safe lookup values when useful, for example, "No character_id found matching {character_id}." For validation errors, state the expected shape, range, or step order. Use distinct errors for distinct failures rather than a generic "incomplete result" or "No resource found." Never include credentials or private provider details, and do not suggest resubmitting a paid operation when its outcome is unknown.
31
+
32
+ ## Tests and coverage
33
+
34
+ Use the checked-in tools and settings rather than introducing a second formatting or test configuration:
35
+
36
+ ```sh
37
+ uv sync --locked
38
+ uv run --locked bash ./test.sh
39
+ ```
40
+
41
+ The verification script runs Ruff, Black, isort, Flake8, pytest with coverage, and package builds. Python formatting uses a 120-character line length. Coverage must stay at or above the configured 85% gate, including subprocess coverage. There is no separate mypy gate configured; do not claim type checking ran when it did not.
42
+
43
+ - Add focused regression tests for fixed bugs and meaningful behavior changes. Cover invalid inputs, error paths, replay/recovery, and compatibility where relevant. Assert observable behavior rather than reproducing the implementation in the test.
44
+ - Keep the normal suite offline and deterministic. Mock external services; live checks must be explicitly configured and must not silently use production credentials or spend credits.
45
+ - Check the missing-coverage report for changed paths. Improve coverage of important branches rather than chasing a percentage with trivial tests. Do not lower thresholds or add exclusions to hide a failure.
46
+ - Exercise platform-specific behavior on its native operating system in CI. Skip a fixture only when the platform cannot provide it, with a clear reason; do not suppress a failure in supported behavior.
47
+ - Run focused checks while developing, then the complete applicable verification before handing off executable changes. For documentation-only changes, check accuracy, links, and formatting without inventing redundant tests.
48
+
49
+ ## Changes and review
50
+
51
+ - Prefer backward-compatible changes. Treat removed fields, required new arguments, changed semantics, and reduced limits as compatibility changes; document their effect on callers.
52
+ - Keep documentation alongside the behavior it describes. Keep temporary release history, personal handoffs, and test-run transcripts out of published documentation.
53
+ - Review the full diff for bugs, security issues, unnecessary abstraction, duplicated logic, and generated boilerplate. Remove stale or misleading claims, and preserve checks that enforce real behavior.
54
+ - Fix actionable findings and rerun affected checks after the final fix. State what passed, what was not checked, and which findings were judged non-actionable. Distinguish manual review from automated review.
55
+ - Keep pull request descriptions focused on the problem, resulting behavior, compatibility, and verification. Do not claim a check covers components it did not exercise.
56
+ - Do not merge or publish without authorization.
57
+
58
+ ## Boundary validation and style reviews
59
+
60
+ - Start boolean variable names with `is` or `has`, using the language’s casing: `is_valid_motion`, `has_frame_range` in Python; `isValidMotion`, `hasFrameRange` in TypeScript. Prefer names that read as a clear predicate. Preserve published parameter and field names for compatibility.
61
+ - Name predicates for the domain rule they express, then combine names at a shared error, return, or continuation. Keep simple type-narrowing guards inline before field access. Do not compute an unsafe or expensive predicate eagerly just to give it a name.
62
+ - Treat untrusted values as `object` in Python or `unknown` in TypeScript until validated. Build owned normalized records with declared types; a cast is not runtime validation. Keep any necessary assertion local to the checks that justify it.
63
+ - Distinguish omitted fields from explicit null, zero, and false. Apply defaults only where the contract permits them. Validation must not mutate caller-owned nested data.
64
+ - Name domain limits and non-obvious numeric tolerances, including units. Keep equivalent cross-language contracts aligned with shared acceptance, rejection, and normalization fixtures.
65
+ - Keep runtime validation in normal control flow; do not use Python `assert` for caller input, permissions, or side-effect preconditions. Assertions may narrow already-proven internal invariants, but prefer a type design that avoids repeating the proof.
66
+ - Use module-level imports, including TypeScript `import type`. Local imports need a circular-dependency or measurable startup-cost reason. Keep module summaries accurate when a file serves both current and legacy interfaces.
67
+ - Preserve published signatures, error categories, unknown-outcome recovery, and side-effect order during style changes. Do not retrofit unrelated existing code. Add tests for changed behavior or meaningful gaps, not for a cosmetic rewrite of the same implementation.
68
+
69
+ Use the shared SDK types for SDK calls and core results. Pydantic models own the MCP tool schema; retain normalization needed for durable receipt fingerprints rather than silently changing numeric/default representation during a style refactor.
@@ -0,0 +1,5 @@
1
+ # Code of Conduct
2
+
3
+ This project follows the [Contributor Covenant, version 2.1](https://www.contributor-covenant.org/version/2/1/code_of_conduct/).
4
+
5
+ To report behavior that violates it, email [support@uthana.com](mailto:support@uthana.com).
@@ -0,0 +1,33 @@
1
+ # Contributing
2
+
3
+ Development uses Python 3.11 or newer and [uv](https://docs.astral.sh/uv/getting-started/installation/).
4
+
5
+ See [AGENTS.md](AGENTS.md) for Python style, testing, coverage, and review conventions.
6
+
7
+ ```sh
8
+ uv sync --locked
9
+ uv run --locked bash ./test.sh
10
+ ```
11
+
12
+ `test.sh` runs Ruff, Black, isort, Flake8, the offline pytest suite with coverage, and a package build. Coverage is measured for `uthana_mcp`, including subprocesses started by the tests, and must stay at or above 85 percent (`--cov-fail-under=85`). Platform-specific file and permission checks are exercised on their native operating systems in CI.
13
+
14
+ Live model calls are not part of this suite. They need an explicitly configured API key and spend account credits.
15
+
16
+ Do not commit API keys, `.env` files, or generated private state.
17
+
18
+ ## Releasing
19
+
20
+ Like the Uthana Python client, releases start with a version bump in a PR. Use `uv version --no-sync 0.1.1` to update `pyproject.toml` and `uv.lock`, then commit both. This uses uv's built-in command instead of a separate version script.
21
+
22
+ On merge to `main`, `.github/workflows/release.yml` checks whether that version exists on PyPI, runs verification, builds a fresh sdist and wheel, publishes through PyPI Trusted Publishing (OIDC), and creates `vX.Y.Z` plus a GitHub release. Configure the trusted publisher for **uthana-mcp**, repository **Uthana/uthana-mcp**, workflow **release.yml**. An already-published version is skipped; a failed PyPI lookup stops the release.
23
+
24
+ The workflow also supports a manual run with `dry_run=true` (the default). A real manual publication creates the tag and GitHub release as well. Publish the required Uthana client and remove its temporary `[tool.uv.sources]` pin before any release build.
25
+
26
+ For a local package dry run:
27
+
28
+ ```sh
29
+ uv build --clear
30
+ uv publish --check-url https://pypi.org/simple/ --dry-run
31
+ ```
32
+
33
+ The clean build prevents old versions in `dist/` from being uploaded. Authorized local publication uses the same command without `--dry-run` and an API token supplied through `UV_PUBLISH_TOKEN`; GitHub publication uses OIDC instead.
@@ -0,0 +1,206 @@
1
+ Copyright 2026 Uthana, Inc.
2
+
3
+
4
+ Apache License
5
+ Version 2.0, January 2004
6
+ http://www.apache.org/licenses/
7
+
8
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
9
+
10
+ 1. Definitions.
11
+
12
+ "License" shall mean the terms and conditions for use, reproduction,
13
+ and distribution as defined by Sections 1 through 9 of this document.
14
+
15
+ "Licensor" shall mean the copyright owner or entity authorized by
16
+ the copyright owner that is granting the License.
17
+
18
+ "Legal Entity" shall mean the union of the acting entity and all
19
+ other entities that control, are controlled by, or are under common
20
+ control with that entity. For the purposes of this definition,
21
+ "control" means (i) the power, direct or indirect, to cause the
22
+ direction or management of such entity, whether by contract or
23
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
24
+ outstanding shares, or (iii) beneficial ownership of such entity.
25
+
26
+ "You" (or "Your") shall mean an individual or Legal Entity
27
+ exercising permissions granted by this License.
28
+
29
+ "Source" form shall mean the preferred form for making modifications,
30
+ including but not limited to software source code, documentation
31
+ source, and configuration files.
32
+
33
+ "Object" form shall mean any form resulting from mechanical
34
+ transformation or translation of a Source form, including but
35
+ not limited to compiled object code, generated documentation,
36
+ and conversions to other media types.
37
+
38
+ "Work" shall mean the work of authorship, whether in Source or
39
+ Object form, made available under the License, as indicated by a
40
+ copyright notice that is included in or attached to the work
41
+ (an example is provided in the Appendix below).
42
+
43
+ "Derivative Works" shall mean any work, whether in Source or Object
44
+ form, that is based on (or derived from) the Work and for which the
45
+ editorial revisions, annotations, elaborations, or other modifications
46
+ represent, as a whole, an original work of authorship. For the purposes
47
+ of this License, Derivative Works shall not include works that remain
48
+ separable from, or merely link (or bind by name) to the interfaces of,
49
+ the Work and Derivative Works thereof.
50
+
51
+ "Contribution" shall mean any work of authorship, including
52
+ the original version of the Work and any modifications or additions
53
+ to that Work or Derivative Works thereof, that is intentionally
54
+ submitted to Licensor for inclusion in the Work by the copyright owner
55
+ or by an individual or Legal Entity authorized to submit on behalf of
56
+ the copyright owner. For the purposes of this definition, "submitted"
57
+ means any form of electronic, verbal, or written communication sent
58
+ to the Licensor or its representatives, including but not limited to
59
+ communication on electronic mailing lists, source code control systems,
60
+ and issue tracking systems that are managed by, or on behalf of, the
61
+ Licensor for the purpose of discussing and improving the Work, but
62
+ excluding communication that is conspicuously marked or otherwise
63
+ designated in writing by the copyright owner as "Not a Contribution."
64
+
65
+ "Contributor" shall mean Licensor and any individual or Legal Entity
66
+ on behalf of whom a Contribution has been received by Licensor and
67
+ subsequently incorporated within the Work.
68
+
69
+ 2. Grant of Copyright License. Subject to the terms and conditions of
70
+ this License, each Contributor hereby grants to You a perpetual,
71
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
72
+ copyright license to reproduce, prepare Derivative Works of,
73
+ publicly display, publicly perform, sublicense, and distribute the
74
+ Work and such Derivative Works in Source or Object form.
75
+
76
+ 3. Grant of Patent License. Subject to the terms and conditions of
77
+ this License, each Contributor hereby grants to You a perpetual,
78
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
79
+ (except as stated in this section) patent license to make, have made,
80
+ use, offer to sell, sell, import, and otherwise transfer the Work,
81
+ where such license applies only to those patent claims licensable
82
+ by such Contributor that are necessarily infringed by their
83
+ Contribution(s) alone or by combination of their Contribution(s)
84
+ with the Work to which such Contribution(s) was submitted. If You
85
+ institute patent litigation against any entity (including a
86
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
87
+ or a Contribution incorporated within the Work constitutes direct
88
+ or contributory patent infringement, then any patent licenses
89
+ granted to You under this License for that Work shall terminate
90
+ as of the date such litigation is filed.
91
+
92
+ 4. Redistribution. You may reproduce and distribute copies of the
93
+ Work or Derivative Works thereof in any medium, with or without
94
+ modifications, and in Source or Object form, provided that You
95
+ meet the following conditions:
96
+
97
+ (a) You must give any other recipients of the Work or
98
+ Derivative Works a copy of this License; and
99
+
100
+ (b) You must cause any modified files to carry prominent notices
101
+ stating that You changed the files; and
102
+
103
+ (c) You must retain, in the Source form of any Derivative Works
104
+ that You distribute, all copyright, patent, trademark, and
105
+ attribution notices from the Source form of the Work,
106
+ excluding those notices that do not pertain to any part of
107
+ the Derivative Works; and
108
+
109
+ (d) If the Work includes a "NOTICE" text file as part of its
110
+ distribution, then any Derivative Works that You distribute must
111
+ include a readable copy of the attribution notices contained
112
+ within such NOTICE file, excluding those notices that do not
113
+ pertain to any part of the Derivative Works, in at least one
114
+ of the following places: within a NOTICE text file distributed
115
+ as part of the Derivative Works; within the Source form or
116
+ documentation, if provided along with the Derivative Works; or,
117
+ within a display generated by the Derivative Works, if and
118
+ wherever such third-party notices normally appear. The contents
119
+ of the NOTICE file are for informational purposes only and
120
+ do not modify the License. You may add Your own attribution
121
+ notices within Derivative Works that You distribute, alongside
122
+ or as an addendum to the NOTICE text from the Work, provided
123
+ that such additional attribution notices cannot be construed
124
+ as modifying the License.
125
+
126
+ You may add Your own copyright statement to Your modifications and
127
+ may provide additional or different license terms and conditions
128
+ for use, reproduction, or distribution of Your modifications, or
129
+ for any such Derivative Works as a whole, provided Your use,
130
+ reproduction, and distribution of the Work otherwise complies with
131
+ the conditions stated in this License.
132
+
133
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
134
+ any Contribution intentionally submitted for inclusion in the Work
135
+ by You to the Licensor shall be under the terms and conditions of
136
+ this License, without any additional terms or conditions.
137
+ Notwithstanding the above, nothing herein shall supersede or modify
138
+ the terms of any separate license agreement you may have executed
139
+ with Licensor regarding such Contributions.
140
+
141
+ 6. Trademarks. This License does not grant permission to use the trade
142
+ names, trademarks, service marks, or product names of the Licensor,
143
+ except as required for reasonable and customary use in describing the
144
+ origin of the Work and reproducing the content of the NOTICE file.
145
+
146
+ 7. Disclaimer of Warranty. Unless required by applicable law or
147
+ agreed to in writing, Licensor provides the Work (and each
148
+ Contributor provides its Contributions) on an "AS IS" BASIS,
149
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
150
+ implied, including, without limitation, any warranties or conditions
151
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
152
+ PARTICULAR PURPOSE. You are solely responsible for determining the
153
+ appropriateness of using or redistributing the Work and assume any
154
+ risks associated with Your exercise of permissions under this License.
155
+
156
+ 8. Limitation of Liability. In no event and under no legal theory,
157
+ whether in tort (including negligence), contract, or otherwise,
158
+ unless required by applicable law (such as deliberate and grossly
159
+ negligent acts) or agreed to in writing, shall any Contributor be
160
+ liable to You for damages, including any direct, indirect, special,
161
+ incidental, or consequential damages of any character arising as a
162
+ result of this License or out of the use or inability to use the
163
+ Work (including but not limited to damages for loss of goodwill,
164
+ work stoppage, computer failure or malfunction, or any and all
165
+ other commercial damages or losses), even if such Contributor
166
+ has been advised of the possibility of such damages.
167
+
168
+ 9. Accepting Warranty or Additional Liability. While redistributing
169
+ the Work or Derivative Works thereof, You may choose to offer,
170
+ and charge a fee for, acceptance of support, warranty, indemnity,
171
+ or other liability obligations and/or rights consistent with this
172
+ License. However, in accepting such obligations, You may act only
173
+ on Your own behalf and on Your sole responsibility, not on behalf
174
+ of any other Contributor, and only if You agree to indemnify,
175
+ defend, and hold each Contributor harmless for any liability
176
+ incurred by, or claims asserted against, such Contributor by reason
177
+ of your accepting any such warranty or additional liability.
178
+
179
+ END OF TERMS AND CONDITIONS
180
+
181
+ APPENDIX: How to apply the Apache License to your work.
182
+
183
+ To apply the Apache License to your work, attach the following
184
+ boilerplate notice, with the fields enclosed by brackets "[]"
185
+ replaced with your own identifying information. (Don't include
186
+ the brackets!) The text should be enclosed in the appropriate
187
+ comment syntax for the file format. We also recommend that a
188
+ file or class name and description of purpose be included on the
189
+ same "printed page" as the copyright notice for easier
190
+ identification within third-party archives.
191
+
192
+ Copyright [yyyy] [name of copyright owner]
193
+
194
+ Licensed under the Apache License, Version 2.0 (the "License");
195
+ you may not use this file except in compliance with the License.
196
+ You may obtain a copy of the License at
197
+
198
+ http://www.apache.org/licenses/LICENSE-2.0
199
+
200
+ Unless required by applicable law or agreed to in writing, software
201
+ distributed under the License is distributed on an "AS IS" BASIS,
202
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
203
+ See the License for the specific language governing permissions and
204
+ limitations under the License.
205
+
206
+ Copyright 2026 Uthana, Inc.
@@ -0,0 +1,8 @@
1
+ include AGENTS.md
2
+ include README.md CONTRIBUTING.md
3
+ include SECURITY.md CODE_OF_CONDUCT.md
4
+ recursive-include docs *.md
5
+ include install.sh install.ps1
6
+ include test.sh .flake8 pyproject.toml uv.lock
7
+ recursive-include tests *.py *.json
8
+ recursive-include examples/tar *.md *.fbx *.glb
@@ -0,0 +1,218 @@
1
+ Metadata-Version: 2.4
2
+ Name: uthana-mcp
3
+ Version: 0.1.0
4
+ Summary: Local MCP adapter for Uthana motion operations
5
+ Author: Uthana, Inc.
6
+ License-Expression: Apache-2.0
7
+ Project-URL: Homepage, https://uthana.com
8
+ Project-URL: Documentation, https://uthana.com/docs/api
9
+ Project-URL: Repository, https://github.com/Uthana/uthana-mcp
10
+ Project-URL: Issues, https://github.com/Uthana/uthana-mcp/issues
11
+ Project-URL: Changelog, https://github.com/Uthana/uthana-mcp/releases
12
+ Keywords: mcp,uthana,animation,motion,character
13
+ Classifier: Operating System :: OS Independent
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.11
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Requires-Python: >=3.11
18
+ Description-Content-Type: text/markdown
19
+ License-File: LICENSE
20
+ Requires-Dist: uthana>=0.6.0
21
+ Requires-Dist: mcp==1.30.0
22
+ Requires-Dist: httpx==0.28.1
23
+ Requires-Dist: Pillow==13.0.0
24
+ Requires-Dist: pydantic==2.13.5
25
+ Requires-Dist: python-dotenv==1.2.3
26
+ Dynamic: license-file
27
+
28
+ # Uthana MCP
29
+
30
+ [![PyPI version](https://badge.fury.io/py/uthana-mcp.svg)](https://badge.fury.io/py/uthana-mcp)
31
+ [![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](LICENSE)
32
+
33
+ Local [MCP](https://modelcontextprotocol.io) server for [Uthana](https://uthana.com): generate motion from text or video, create characters from prompts, images, or rigged files, trim, loop, and stitch motions, and export retargeted animation.
34
+
35
+ The host supplies the reasoning model. This server uses the shared [Uthana Python client](https://github.com/Uthana/uthana-python-client) and speaks stdio. It registers 24 tools and the `uthana://workflow` resource.
36
+
37
+ 📖 [API documentation](https://uthana.com/docs/api) · [First animation](docs/first-animation.md)
38
+
39
+ ## Install
40
+
41
+ Download and run the installer for your platform:
42
+
43
+ **macOS / Linux**
44
+
45
+ ```sh
46
+ curl -fsSL https://raw.githubusercontent.com/Uthana/uthana-mcp/main/install.sh -o install.sh
47
+ sh install.sh
48
+ ```
49
+
50
+ **Windows (PowerShell)**
51
+
52
+ ```powershell
53
+ Invoke-WebRequest https://raw.githubusercontent.com/Uthana/uthana-mcp/main/install.ps1 -OutFile install.ps1
54
+ powershell -NoProfile -ExecutionPolicy Bypass -File .\install.ps1
55
+ ```
56
+
57
+ The installer checks for uv, installs it if needed, and installs the MCP with Python 3.12. No existing Python installation is required. It prints the server command for your host configuration. Create an API key in your [Uthana account settings](https://uthana.com) and paste its value into `UTHANA_API_KEY` below.
58
+
59
+ See the [installation guide](docs/installation.md) for manual installation, environment settings, and tool timeouts.
60
+
61
+ ## Connect
62
+
63
+ Use the absolute server command printed by the installer. For Claude Desktop (`claude_desktop_config.json`):
64
+
65
+ ```json
66
+ {
67
+ "mcpServers": {
68
+ "uthana": {
69
+ "command": "/absolute/path/to/uthana-mcp",
70
+ "args": [],
71
+ "env": {
72
+ "UTHANA_API_KEY": "your-api-key",
73
+ "UTHANA_MCP_INPUT_DIR": "/absolute/path/to/selected-inputs"
74
+ }
75
+ }
76
+ }
77
+ }
78
+ ```
79
+
80
+ Cursor (`.cursor/mcp.json`) uses the same `mcpServers` object.
81
+
82
+ Codex (`~/.codex/config.toml`):
83
+
84
+ ```toml
85
+ [mcp_servers.uthana]
86
+ command = "/absolute/path/to/uthana-mcp"
87
+ args = []
88
+
89
+ [mcp_servers.uthana.env]
90
+ UTHANA_API_KEY = "your-api-key"
91
+ UTHANA_MCP_INPUT_DIR = "/absolute/path/to/selected-inputs"
92
+ ```
93
+
94
+ [Install and connect](docs/installation.md) has Windows path examples and host timeout settings.
95
+
96
+ Restart your host, then ask it to read Uthana’s workflow, check account access, and estimate a motion before generating it. Production generation spends your account’s credits. Continue with the [first-animation walkthrough](docs/first-animation.md) for upload, generation, and export.
97
+
98
+ ## Tools
99
+
100
+ | Tool | What it does |
101
+ | --- | --- |
102
+ | `generate_motion` | Text-to-motion V3. Returns a job ID |
103
+ | `generate_motion_v2` | Text-to-motion V2. Returns a motion ID |
104
+ | `generate_locomotion` | Walk or run cycles from style, strides, speed, and direction |
105
+ | `list_locomotion_styles` | Available locomotion styles |
106
+ | `estimate_model_cost` | USD estimate from current model rates |
107
+ | `get_job` | Generation job state and available motion ID |
108
+ | `get_motion` | Native motion metadata and source-file identity |
109
+ | `get_request_status` | Local request state, result IDs, and recovery guidance |
110
+ | `trim_motion` | Save an interval as a new motion |
111
+ | `get_preview` | APNG or WebM preview |
112
+ | `get_preview_frame` | One APNG frame with index and available timing |
113
+ | `generate_motion_from_video` | Video-to-motion (V2M) 2.0 or 2.1 job |
114
+ | `upload_character` | FBX/GLB upload, with optional auto-rig and rerig options |
115
+ | `create_character_from_image` | PNG/JPEG to a rigged character |
116
+ | `preview_character_from_prompt` | Preview images for a character description |
117
+ | `create_character_from_prompt` | Rig the preview you chose |
118
+ | `create_looped_motion` | Closed or open loop of an existing motion |
119
+ | `stitch` | Join typed motion/transition/motion steps with server preparation |
120
+ | `list_characters` | Character name filter and result pages |
121
+ | `list_motions` | Recent motion name search and source filters |
122
+ | `get_usage` | Pay-as-you-go balance, rates, and allowances |
123
+ | `check_download_allowed` | Current export eligibility |
124
+ | `save_motion` | Register host-edited animated GLTF JSON |
125
+ | `download_motion` | Retargeted FBX/GLB/BVH with export options |
126
+
127
+ `UthanaAPI.generate_v1` is a Python adapter method for V1 generation. It is not a separate MCP tool.
128
+
129
+ ## Join two motions
130
+
131
+ Call the `stitch` tool with the following arguments, or ask your host to stitch the selected motions. Replace the character and motion IDs with your own.
132
+
133
+ ### Simple join
134
+
135
+ Join two motions with automatic positioning. The server handles sampling and alignment.
136
+
137
+ ```json
138
+ {
139
+ "request_id": "stitch-basic",
140
+ "character_id": "CHARACTER_ID",
141
+ "steps": [
142
+ {
143
+ "type": "motion",
144
+ "motion_id": "FIRST_MOTION_ID"
145
+ },
146
+ {
147
+ "type": "transition",
148
+ "duration_seconds": 1.0
149
+ },
150
+ {
151
+ "type": "motion",
152
+ "motion_id": "SECOND_MOTION_ID"
153
+ }
154
+ ]
155
+ }
156
+ ```
157
+
158
+ ### Join with ranges and positioning
159
+
160
+ Select source intervals and place the second motion one meter forward and half a meter right of the first motion’s ending pelvis, turned 45 degrees right. Placement is relative to the first motion’s ending facing.
161
+
162
+ ```json
163
+ {
164
+ "request_id": "stitch-positioned",
165
+ "character_id": "CHARACTER_ID",
166
+ "steps": [
167
+ {
168
+ "type": "motion",
169
+ "motion_id": "FIRST_MOTION_ID",
170
+ "range": {
171
+ "start_frame": 12,
172
+ "end_frame": 60
173
+ }
174
+ },
175
+ {
176
+ "type": "transition",
177
+ "duration_seconds": 1.5
178
+ },
179
+ {
180
+ "type": "motion",
181
+ "motion_id": "SECOND_MOTION_ID",
182
+ "range": {
183
+ "start_seconds": 0.5,
184
+ "end_seconds": 3.0
185
+ },
186
+ "placement": {
187
+ "forward_m": 1.0,
188
+ "right_m": 0.5,
189
+ "turn_degrees": 45.0
190
+ }
191
+ }
192
+ ]
193
+ }
194
+ ```
195
+
196
+ Choose ranges that fit your source motions and leave the required transition context. Frame indices use each source’s native FPS; do not mix frames and seconds within one range. Inspect `resolved_steps` and review playback before accepting the result.
197
+
198
+ Each example makes a separate mutation. Use a distinct request ID for different arguments; recover an uncertain request before retrying. See [stitching](docs/stitching.md) for the full contract.
199
+
200
+ ## Documentation
201
+
202
+ - [Workflow and recovery](src/uthana_mcp/WORKFLOW.md)
203
+ - [API coverage and limits](docs/api-coverage.md)
204
+ - [Stitching steps and positioning](docs/stitching.md)
205
+ - [Install and connect](docs/installation.md)
206
+ - [First animation and export](docs/first-animation.md)
207
+ - [Operational checks](docs/operations.md)
208
+ - [Contributing](CONTRIBUTING.md)
209
+ - [Public API documentation](https://uthana.com/docs/api)
210
+
211
+ ## Develop from source
212
+
213
+ ```sh
214
+ uv sync --locked
215
+ uv run --locked bash ./test.sh
216
+ ```
217
+
218
+ Licensed under [Apache-2.0](LICENSE).