Skip to content

feat: Complete MCP and Studio OpenAPI support - #61

Merged
wangxingjun778 merged 4 commits into
mainfrom
feat/latest_openapi
Sep 1, 2026
Merged

feat: Complete MCP and Studio OpenAPI support#61
wangxingjun778 merged 4 commits into
mainfrom
feat/latest_openapi

Conversation

@wangxingjun778

@wangxingjun778 wangxingjun778 commented Sep 1, 2026

Copy link
Copy Markdown
Member
  1. Add OpenAPI support for Studio listing, variables, configuration options, protected visibility, and hosted MCP discovery.
  2. Support permission-tiered tokens with clearer access-denied guidance.
  3. Fix Studio compat token leaks, cover images, anonymous info, log pagination, and OpenAPI error mapping.
  4. Add OpenAPI coverage checks and streamline release notes.

…ssion tiers

Audited the live OpenAPI document (1.1.0+master.20260813) against the client:
of the 23 operations under the MCP and Studios tags, 8 were unimplemented and
several implemented ones had drifted from the spec. Closes the gap and adds a
guard so the next drift fails the suite instead of going unnoticed.

Feature
- Studios: list_studios, list_studio_hardware / _base_images / _sdk_versions,
  and the four plaintext-variable operations; exposed as `ms-hub studio list`,
  `studio variable`, `studio hardware|base-images|sdk-versions`, and
  `ms-hub list --repo-type studio`.
- MCP: HubApi.list_operational_mcp_servers() plus `ms-hub mcp list --hosted`,
  which also unblocks the umbrella SDK delegating its own MCPApi here.
- Studio visibility gains `protected` (app public, code hidden), previously
  inexpressible because visibility was folded into a `private` bool.
- RepoInfo now carries the Studio runtime fields (sdk_type, sdk_version,
  base_image, hardware, mcp_support, runtime) instead of discarding them.
- Token permission tiers: TokenScope annotations, a read-scoped token can log in
  (warning that writes need a higher tier), and a rejected write names the tier
  it requires.

Fix
- The compat layer forwarded `token` / `endpoint` into request bodies, so
  `HubApi().update_studio_settings(..., token=...)` serialised the caller's API
  token into the PATCH body. All Studio shims now split control kwargs from
  business fields.
- `HubApi().get_studio_logs(..., token=...)` raised TypeError and could never
  succeed; a per-call `token=` was silently ignored on every Studio shim.
- `cover_image` was renamed to `coverImage` on the way out and dropped by the
  server, so Studio cover images never applied.
- 403 now separates insufficient permission from an exhausted quota (new
  QuotaExceededError, deliberately not retryable); 409 maps to
  AlreadyExistsError; the OpenAPI string error codes are recognised at all.
- `get_studio` demanded a token for spaces the spec says are public.
- `studio logs` read a `total` field the response never had, so its pagination
  footer never printed.

Enhance
- MCP discovery sends PUT first -- the only verb the spec defines -- and
  remembers which verb a deployment serves, so the loser is tried at most once.
- Listing a Studio owner asks for every status: the endpoint keeps filtering to
  running spaces even with an owner set, so "list my spaces" returned nothing.

Documentation
- README: new Studio/MCP command surface, a Token permission levels section, and
  the SDK method reference.

Testing
- Vendored the spec under tests/data/ and check it against OPERATION_REGISTRY.
- 723 unit tests (881 in mock mode) and 28 integration tests against the live
  service.
The News list had no entry for 0.3.0 or 0.3.1, so it jumped straight from 0.4.0
to 0.2.0 and left the release that took over all four console scripts
undocumented.

- Adds v0.3.0 (unified console scripts, repo/files truncation mitigation,
  get_current_username, agent visibility) and v0.3.1 (upload env var rename with
  deprecation shims, logout wiring, download lock paths, UserInfo and legacy
  compat field mapping), both reconstructed from the commits in each range.
- Condenses v0.4.0 from eleven bullets to nine by merging entries that share a
  root cause: the three compat kwargs defects are one leak, and the two MCP/
  Studio request-shape improvements are one behaviour change.
- Folds v0.2.0 and everything older into the "Older releases" block, so only the
  three current releases are visible by default.
- v0.4.0: fold the second Feature bullet into the OpenAPI-coverage one, join the
  cover_image leak into the compat-kwarg fix, and merge the two small studio
  fixes into the error-handling bullet — nine bullets become six, one per
  category except Feature.
- v0.3.0/v0.3.1: trim wordy phrasing and group Feature items first.
@wangxingjun778 wangxingjun778 changed the title Feat/latest openapi feat: Complete MCP and Studio OpenAPI support Sep 1, 2026
@wangxingjun778
wangxingjun778 merged commit 2d1701a into main Sep 1, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant