Commit 62a9e29
authored
feat: add OpenViking control plane MCP server + CLI (#408)
* feat(openviking-controlplane): add control-plane MCP server and CLI
Add a new package that exposes the OpenViking control plane (topapi · top
cluster) collection-management Actions as both an MCP server and a Typer CLI,
sharing one core (client.py) so each Action is available from both front-ends.
- 6 core Actions: list / create / get / delete / usage / api-key
(GetOpenVikingCollectionUserAccess)
- Pluggable auth (common/auth.py): dev-phase ManualHeadersAuth replays headers
supplied manually (e.g. copied from the browser); AuthProvider leaves room for
a future AK/SK signer or dedicated API key without touching client/tool/cli.
- MCP server defaults to stdio (uvx-launchable); create/delete are exposed with
confirm-first guidance in their tool descriptions.
- Lazy config from VIKING_HOST / VIKING_HEADERS_FILE|VIKING_HEADERS / VIKING_SCHEMA
/ OPENVIKING_PROJECT; headers file accepts JSON or raw 'Key: Value' blocks.
* feat(openviking-controlplane): target console proxy endpoint, verified live
Switch the request model to the console proxy the browser actually uses, and
verify the read-only Actions against the live staging console.
- Endpoint: POST {schema}://{host}/api/top/{service}/{region}/{api_version}/{Action}
with Action/Version in the path (no query params); body is the Action params.
- Extract host/region/service/api_version into config (VIKING_HOST default
console.volcengine.com, VIKING_REGION=cn-beijing, VIKING_API_SERVICE=vikingdb,
VIKING_API_VERSION=2025-06-09) and expose them as CLI flags + ControlPlaneConfig.action_path().
- Correct the api-key Action: the doc's GetOpenVikingCollectionUserAccess does
not exist on the console; use AccessOpenVikingApiKey (returns the default user's
plaintext {UserID, Role, ApiKey}). ListOpenVikingUser only returns a masked key.
- Live-verified read-only: list / get / usage / api-key. create/delete unchanged
(not exercised live as they are billable).
- READMEs updated for the console endpoint, new env vars, and verified Action names.
* feat(openviking-controlplane): switch to AgentPlan Bearer auth + data-plane endpoint
The control-plane TopAPI is now compiled into the OpenViking data-plane
cluster and authenticated with an Ark AgentPlan ApiKey. Replace the
dev-phase console-proxy approach accordingly:
- auth: drop ManualHeadersAuth (browser cookie/JWT replay); add
BearerTokenAuth that sends Authorization: Bearer <key> (the backend only
accepts Bearer, not X-API-Key).
- endpoint: single base URL config (VIKING_ENDPOINT / --endpoint), default
https://api.vikingdb.cn-beijing.volces.com/openviking (reserved public
gateway, not live yet); action path is /api/openviking/{Action}, no query.
- config: slim to api_key/endpoint/project; drop headers/region/service/
api_version and all header-blob parsing.
- client: fix api-key action name AccessOpenVikingApiKey ->
GetOpenVikingCollectionUserAccess (the former 404s on the data cluster);
emit the new multi-credential create format (VLM/Embedding carry a
Credentials[] list; source moves into each credential); for source=agentplan
the model ApiKey falls back to the configured key and model names default.
- cli: replace --host/--schema/--region/--service/--api-version/--headers-file
/--header with --endpoint/-e and --api-key/-k.
- docs: rewrite README/README_zh for Bearer-only auth and the new endpoint.
Verified against the staging data-plane pod via port-forward: list returns
200, missing auth returns 401, create reaches the backend (blocked only by
the account-side AgentPlan order gate, ProductUnordered). End-to-end
create/provisioning + data-plane key verification still pending an account
with AgentPlan deduction enabled.
* refactor(openviking-controlplane): rename API key env var to AGENTPLAN_API_KEY
The key is an Ark AgentPlan ApiKey; name the env var accordingly.
VIKING_API_KEY -> AGENTPLAN_API_KEY across config, CLI help, and docs.
VIKING_ENDPOINT / OPENVIKING_PROJECT are unchanged (not AgentPlan-specific).
* docs(openviking-controlplane): add ov-cp agent skill; env-var usage; keep default endpoint
- Add skills/openviking-controlplane/SKILL.md documenting the ov-cp workflow
(config, commands, agentplan create defaults, cold-start chain, data-plane key
usage) and link it from the READMEs.
- Show env-var-based CLI usage (export AGENTPLAN_API_KEY, then no per-command flag).
- Stop customizing VIKING_ENDPOINT in the primary examples / .mcp.json — use the
default endpoint and document overriding it (for port-forward testing) only as a note.
* feat(openviking-controlplane): drop AgentFileNum from usage output
AgentFileNum is not meaningful for control-plane usage; strip it in the
shared client.get_usage so both the CLI and MCP tool omit it. Update the
tool docstring accordingly.1 parent 4f305c5 commit 62a9e29
13 files changed
Lines changed: 2179 additions & 0 deletions
File tree
- server/mcp_server_openviking_controlplane
- skills/openviking-controlplane
- src/mcp_server_openviking_controlplane
- common
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
Lines changed: 84 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
Whitespace-only changes.
0 commit comments