{"schema_version":"1.0","name":"Geoscience Model Hub","description":"地学模型注册、推荐、异步运行与产物归档服务，同时提供 REST、MCP 和 Web 控制台。","version":"0.1.0","base_url":"https://model.ncdc.ac.cn","capabilities":["model-registry","external-official-model-catalog","deterministic-model-recommendation","agent-friendly-model-cards","data-requirement-metadata","dataset-management","asynchronous-run-execution","persisted-parameter-sweeps","artifact-preview-and-download","sse-progress-stream","completion-callback","mcp-streamable-http","mcp-stdio","local-user-accounts","role-based-access","audit-log","per-user-api-keys"],"interfaces":{"rest":{"base_path":"/api/v1","openapi":"/openapi.json","docs":"/docs"},"mcp":{"url":"/mcp","transport":"streamable-http","stdio_command":"python -m model_hub.mcp.stdio","tools":["list_models","get_model","recommend_models","list_datasets","preview_dataset","find_models_for_dataset","validate_model_inputs","run_model","run_model_sweep","list_sweeps","get_sweep","get_sweep_analysis","get_sweep_csv","get_run","get_run_result","list_artifacts","get_artifact_preview","get_run_charts","compare_runs","get_run_log","cancel_run","rerun_run"]},"web_console":{"url":"/"},"admin_console":{"url":"/admin","kind":"single-page-application","note":"模型/数据集/运行/用户/审计/系统管理；有独立登录入口，登录后与前台共用同一个统一会话，按账号角色授权。用户编辑对话框可为账号签发/撤销个人 API Key，部署级 MODEL_HUB_API_KEY 仍供受信机器客户端使用。","login":"/admin/login?next=/admin","setup":"/admin/setup"},"llms_txt":"/llms.txt"},"agent":{"recommended_flow":["GET /api/v1/models/recommend?goal=... （或 MCP recommend_models）","GET /api/v1/models/{model_id} 读取 agent_spec.data_requirements、input_schema、outputs[].schema 和 example_call","GET /api/v1/datasets?format=... 找到输入数据集 ID，并读取 profile.columns","POST /api/v1/models/{model_id}/validate-inputs 预检参数与文件结构","GET /api/v1/models/{model_id}/input-template?param=... 获取 CSV 表头模板（可选）","POST /api/v1/runs 提交运行；等待时可设置 wait_seconds，或轮询 /runs/{id}","GET /api/v1/runs/{id}/events 订阅 SSE 进度，GET /runs/{id}/artifacts 下载产物","POST /api/v1/runs/sweep 提交参数网格；用返回的 sweep_id 调用 GET /api/v1/runs/sweeps/{sweep_id} 回访批次与分析"],"model_card":"GET /api/v1/models/{model_id} -> agent_spec; runnable=false marks a catalog-only external model. execution_mode distinguishes native, local_simplified (Python reimplementation) and official_container (official upstream code inside environment_image)","external_models":"runnable=false entries are catalog-only: report external.official_version, external.source_url and external.runtime_environment; POST /api/v1/runs returns 409 and must not be retried. execution_mode=local_simplified means results are simplified and must be described as such. execution_mode=official_container runs the official upstream code in the declared Docker image; results come from the official engine, and the platform only adapts inputs/outputs","data_requirements":"agent_spec.data_requirements[] with role (base/thematic/auxiliary), required, formats, fields, temporal/spatial/resolution and optional param link; check these before asking users for data","input_contract":"agent_spec.input_schema (params / file_inputs); file inputs may declare columns[] with role/aliases/type/range","dataset_profile":"GET /api/v1/datasets/{id} -> profile (kind, rows, columns, preview)","input_validation_endpoint":"/api/v1/models/{model_id}/validate-inputs","input_template_endpoint":"/api/v1/models/{model_id}/input-template?param=<file_param>","output_contract":"agent_spec.outputs[] with media_type and optional JSON schema","run_result_contract":"GET /api/v1/runs/{id} -> result (summary/metrics/preview/warnings/artifacts) + raw_result","recommendation_endpoint":"/api/v1/models/recommend?goal=","media_types":["application/json","image/png","image/tiff","text/csv"]},"authentication":{"required":true,"headers":["X-API-Key","Authorization: Bearer <key>"],"scope":["/api/v1/*","/mcp"],"browser_session":{"cookie":"mh_session","login":"/login","admin_login":"/admin/login?next=/admin","setup":"/admin/setup","logout":"/logout","admin_logout":"/admin/logout","password_change":"/api/v1/auth/password","note":"前台工作区与后台控制台有各自的登录入口，但共用同一个 platform_auth 身份与 mh_session；登录后按账号角色（viewer/operator/admin）授权。启用统一身份后退出会同时结束 platform_auth 的单点登录会话；本地密码修改与用户密码重置关闭。旧版 mh_admin_session/mh_frontend_session Cookie 仍可解析，升级不会强制退出。未启用统一身份且无用户时通过 /admin/setup 创建管理员；启用统一身份后首次登录即建立本地账号。"},"unified_identity":{"enabled":true,"provider":"platform_auth","protocol":"OpenID Connect authorization code + PKCE (S256)","issuer":"https://id.ncdc.ac.cn","login":"/auth/oidc/login","callback":"/auth/oidc/callback","local_login":false,"groups_to_roles":{"admin":["platform-admins","model_hub-admins"],"operator":["model_hub-operators"],"viewer":"any other authorized account"},"required_group":null,"note":"浏览器登录跳转到平台统一认证；账号、图形验证码、双因素与密码策略由 platform_auth 负责。回调校验签发者、受众、有效期与 nonce 后，按 groups 映射为本地 viewer/operator/admin 角色，并继续使用 mh_session。"},"personal_api_keys":{"enabled":true,"prefix":"mhk_","header":"X-API-Key: mhk_... 或 Authorization: Bearer mhk_...","scope":["/api/v1/*"],"role":"继承所属账号的 viewer/operator/admin 角色；停用账号立即失效","issue":"POST /api/v1/users/{user_id}/api-keys（管理员）","list":"GET /api/v1/users/{user_id}/api-keys（管理员）","revoke":"DELETE /api/v1/users/{user_id}/api-keys/{key_id}（管理员）","storage":"仅保存 SHA-256 摘要，明文令牌只在创建响应中出现一次","expiry":"创建时可给 expires_in_days（1–3650），不填则不过期","note":"个人 Key 用于 REST；/mcp 仍使用部署级 MODEL_HUB_API_KEY 或浏览器会话，避免 MCP 工具在无角色上下文时越权。"},"roles":["viewer","operator","admin"]},"limits":{"max_upload_mb":100,"max_workers":2,"queue_limit":50,"wait_max_seconds":600,"max_run_files":1000},"catalog":{"model_count":43,"categories":[{"key":"snow-glacier","label":"积雪与冰川","description":"积雪过程、积雪遥感、融雪、冰川与海冰动力学","model_count":16},{"key":"permafrost","label":"多年冻土","description":"活动层、地温、冻结指数与 n 因子","model_count":5},{"key":"land-surface","label":"陆面模型","description":"陆面过程、陆气交换与地表数据同化","model_count":9},{"key":"hydro-flood","label":"水文与洪水","description":"降雨径流、基流、明渠水力学、洪水频率与演进、水库调洪","model_count":8},{"key":"geohazard","label":"地质灾害","description":"边坡稳定、泥石流预警与地面沉降","model_count":3},{"key":"remote-sensing","label":"遥感与植被","description":"植被指数与地表遥感分析","model_count":1},{"key":"general","label":"示例与通用","description":"平台示例与通用数据处理","model_count":1}],"models_url":"/api/v1/models","categories_url":"/api/v1/models/categories","datasets_url":"/api/v1/datasets"},"callbacks":{"supported":true,"request_field":"callback_url","protocol":"HTTP POST","signature_header":"X-Model-Hub-Signature","note":"仅在设置 MODEL_HUB_CALLBACK_SIGNING_SECRET 时签名；默认拒绝私网回调地址。"}}