Degurechaff57/dsh-openapi

DeepSeek Harness 的安全 OpenAPI 3.x 发现与 API 调用工具

Project Overview项目介绍

dsh-openapi is a native plugin built exclusively for DeepSeek Harness (DSH), packaged with a DSH bundle manifest to work natively within the DSH ecosystem. It is designed to give DSH agents a safe, structured interface for accessing any OpenAPI 3.x compliant API, adding three model-facing tools to DSH. The tools are openapi_list for discovering configured APIs and searching for specific operations, openapi_describe for fetching detailed parameters, request bodies, server information, and response schemas for a selected operation, and openapi_call for validating and invoking the selected operation with bounded output. To install the plugin, users run the command dsh plugin --profile web add github:Degurechaff57/dsh-openapi in their terminal, and since it is written in plain ESM JavaScript, no build or prepare script is required after installation.

This plugin is targeted at developers who want to let DSH agents interact with external APIs securely without compromising context window efficiency. While DSH already provides agents with shell access to external tools, calling APIs directly requires loading entire large OpenAPI specifications into the model context, which wastes valuable context space and introduces unnecessary security risks. This plugin adds necessary security controls without modifying the core DSH agent loop. After installation, users pre-configure their desired APIs in the cordis.patch.yml profile file, specifying the source of the OpenAPI spec, base URL, allowed HTTP methods, and credential mappings for authentication.

dsh-openapi is released under the permissive MIT open source license, and currently supports OpenAPI 3.0 and 3.1 specifications in both JSON and YAML formats. It supports local #/... references within a single spec, but intentionally does not yet support remote $ref documents or specialized serialization formats like deepObject, failing loudly instead of making ambiguous, incorrect requests. It ships with strict security defaults: APIs start as read-only with only GET and HEAD enabled, private network access is blocked by default, response sizes are capped, and credentials are pulled from environment variables instead of config files and never exposed to the model. The current release is tested against DSH CLI 0.1.0-rc.5 and npm prerelease 0.1.0-rc.6, with compatibility updates planned for upstream breaking changes.

dsh-openapi 是专为 DeepSeek Harness(DSH)开发的原生插件,用于为 DSH 智能体提供安全、结构化的 OpenAPI 3.x API 访问入口。它为模型提供了三个专用工具:openapi_list 用于发现 API 和搜索操作,openapi_describe 用于获取单个操作的详细参数和定义,openapi_call 用于验证并调用目标操作。该插件采用纯 ESM JavaScript 编写,安装后无需执行构建或 prepare 脚本,可通过 dsh 命令直接从 GitHub 安装。

该插件主要面向需要让 DSH 智能体安全访问外部开放 API 的开发者,解决了直接将完整 OpenAPI 文档载入模型上下文的效率问题,同时增加了多项安全控制。安装完成后,用户需要在个人配置文件 cordis.patch.yml 中预先添加需要访问的 API 条目,指定 API 文档源、基础地址、允许调用的方法等信息。使用时,智能体可通过列表工具发现操作、描述工具获取参数、调用工具发起请求,完成整个 API 访问流程。

该插件采用 MIT 许可证开源,目前支持 OpenAPI 3.0 和 3.1 版本的 JSON 和 YAML 格式文档,支持本地引用,暂不支持远程引用文档和特殊序列化格式。插件内置多项安全默认设置,默认仅允许 GET 和 HEAD 方法,禁止访问私有网络,限制响应大小,凭证从环境变量读取不会泄露。当前版本适配 DSH 0.1.0-rc.5 源码 CLI 和 0.1.0-rc.6 npm 预发布版,后续会跟进上游更新。

Pre-install check安装前体检Compatibility · Security兼容性 · 安全性 1 warning1 项注意
  • Only 3 stars - very few users, little community feedback星标只有 3,几乎没人在用,遇到问题缺少社区反馈
DSH walks through these 9 checksDSH 会逐条核对这 9 项

Compatibility兼容性

  • DSH, Node, OS and profile requirementsDSH 版本 / Node 版本 / 操作系统 / profile 是否满足要求
  • External dependencies and runtimes (Electron / Python / Docker, ...)外部依赖与运行时(Electron / Python / Docker 等)是否齐备
  • Conflicts with installed plugins: command names, skill / tool names, ports, duplicate MCP registration与已装插件是否冲突:命令名、skill / tool 重名、端口占用、重复 MCP 注册

Security安全性

  • Repo matches the facts registered here; archived or abandoned?仓库是否与页面登记一致,是否归档或长期停更
  • Safety of preinstall / install / postinstall and install.sh / setup.ps1preinstall / install / postinstall 与 install.sh、setup.ps1 是否安全
  • curl|bash, download-then-execute, obfuscation, unrelated domains → stop immediatelycurl|bash、下载即执行、混淆代码、无关域名 → 立刻停止
  • Typosquatting or unmaintained packages among the new dependencies新增依赖里有没有 typosquatting 或无人维护的包
  • Requested permissions vs. what the feature actually needs申请了哪些权限、是否超出功能所需(filesystem / network / shell / clipboard)
  • Any sudo / admin requirement, plus uninstall and rollback是否要求 sudo / 管理员权限,以及卸载与回滚方式

Anything uncertain must be marked unknown with a note on how to confirm it. This site's signal screen is a static snapshot, not a security audit.拿不准的必须标「未知」并说明要我怎么确认。本站的信号筛查是静态快照,不能替代安全审计。

Or use CLI install (for developers)或使用命令行安装(适合开发者)

CLI Install命令行安装

dsh plugin --profile web add github:Degurechaff57/dsh-openapi

把 Degurechaff57/dsh-openapi 加入你的 DSH 配置(web profile)即可启用。

READMEREADME

dsh-openapi

Give DeepSeek Harness a safe, structured doorway into any OpenAPI 3.x API.

中文说明 · DeepSeek Harness

dsh-openapi is a native DeepSeek Harness bundle that indexes configured OpenAPI documents and adds three model-facing tools:

  • openapi_list discovers APIs and searches operations.
  • openapi_describe returns parameters, request bodies, servers, and responses for one operation.
  • openapi_call validates and invokes an operation with bounded output.

It is plain ESM JavaScript, so installing from GitHub does not run a build or prepare script.

Why this plugin

Harness already gives an agent a shell. APIs still benefit from a narrower interface: operation discovery without reading a huge spec into the model context, declared-parameter validation, environment-backed credentials, read-only defaults, SSRF checks, and response limits. This plugin provides those controls without patching the Harness agent loop.

Install

dsh plugin --profile web add github:Degurechaff57/dsh-openapi

The bundle installs with an empty API catalog. Add API entries to your profile's cordis.patch.yml:

- id: openapi
  config:
    apis:
      - id: petstore
        source: https://petstore3.swagger.io/api/v3/openapi.json
        baseUrl: https://petstore3.swagger.io/api/v3
        allowedMethods: [GET, HEAD]

Start Harness and ask:

Use openapi_list to find the operation that lists pets, describe it, then call it.

For a source checkout, install the local directory instead:

dsh plugin --profile web add /absolute/path/to/dsh-openapi

Credentials

Keep secrets out of YAML. Map a request header to an environment variable:

- id: openapi
  config:
    apis:
      - id: internal-api
        source: ./openapi/internal.yml
        baseUrl: https://api.example.com/v1
        headers:
          Accept: application/json
        credentials:
          - header: Authorization
            env: INTERNAL_API_TOKEN
            prefix: 'Bearer '
        allowedMethods: [GET, HEAD, POST]

The credential header is applied after model-supplied header parameters, so a tool call cannot override it. Missing environment variables fail the call before network I/O.

Showing the opening section of the README — the full document lives in the repository以上为 README 开头摘要,完整文档在仓库内 · View the full README on GitHub →在 GitHub 查看完整 README →

← 上一个 Prev dsh-benchmark 下一个 Next dsh-hardssh →