mirror of
https://github.com/chainbase-labs/Agentkey.git
synced 2026-09-20 14:20:23 +08:00
feat: improve Kimi plugin onboarding (#86)
## Summary - add a Kimi Code plugin manifest with an inline AgentKey MCP server definition - use Kimi's native MCP OAuth flow while keeping browser login explicit through `/mcp-config login plugin-agentkey:agentkey` - document the required `/reload`, browser authorization, local-plugin update flow, and legacy global MCP cleanup - include the Kimi manifest in release-please and version-sync checks - add regression coverage for the Kimi manifest shape and OAuth configuration ## Why Kimi requires `mcpServers` to be declared inline in the plugin manifest. The previous path-based configuration was not loaded as a plugin MCP server, so installation did not produce the expected MCP-aware reload guidance. With the corrected manifest, Kimi recognizes the MCP server during installation and shows its standard `/new` or `/reload` prompt. After reloading, the user completes Kimi's native browser OAuth flow explicitly with `/mcp-config login plugin-agentkey:agentkey`. ## User impact After installing the plugin, users receive the reload guidance from Kimi. They run `/reload`, follow Kimi's OAuth prompt with `/mcp-config login plugin-agentkey:agentkey`, approve the browser authorization, and can then use AgentKey normally. ## Validation - installed the local plugin with Kimi Code CLI 0.31.1 and confirmed the success screen reports one MCP server plus `Run /new or /reload to apply plugin changes.` - verified the managed Kimi plugin copy matches the repository manifest - validated the Kimi manifest shape and native-OAuth constraints - verified all six release version values remain synchronized at 1.12.1 - parsed the modified GitHub Actions workflows as YAML - ran `git diff --check` The repository CI runs the full Bats suite on Ubuntu and macOS. --------- Co-authored-by: Allen <0xfatdog@gmail.com>
This commit is contained in:
+16
-4
@@ -17,6 +17,8 @@ The same repo also works as a Claude Code plugin (via `.claude-plugin/plugin.jso
|
||||
|
||||
It additionally works as a **Codex plugin** (via `.codex-plugin/plugin.json` + `.codex-plugin/mcp.json`, distributed through `.agents/plugins/marketplace.json` — the repo is its own marketplace, added with `codex plugin marketplace add chainbase-labs/agentkey`). Codex plugins have no `userConfig`/header-interpolation mechanism, so auth uses MCP OAuth instead: the server's `/v1/mcp` endpoint advertises `WWW-Authenticate: Bearer resource_metadata=…` (RFC 9728) and supports dynamic client registration, so `.codex-plugin/mcp.json` needs only `type` + `url` — discovery does the rest. In that mode the OAuth sign-in substitutes for step 2.
|
||||
|
||||
It also works as a **Kimi Code plugin** (`.kimi-plugin/plugin.json`). Kimi requires `mcpServers` to be an inline object in the manifest. The remote AgentKey endpoint uses Kimi's native MCP OAuth flow; after install Kimi shows the standard `/reload` hint, then the user signs in with `/mcp-config login plugin-agentkey:agentkey` when Kimi reports that OAuth is required.
|
||||
|
||||
## Directory Structure
|
||||
|
||||
```
|
||||
@@ -25,6 +27,8 @@ agentkey/
|
||||
├── .codex-plugin/
|
||||
│ ├── plugin.json # Codex plugin manifest (skills + mcpServers + interface metadata)
|
||||
│ └── mcp.json # Codex MCP entry — http + oauth_resource (NOT the root .mcp.json)
|
||||
├── .kimi-plugin/
|
||||
│ └── plugin.json # Kimi Code manifest with inline HTTP MCP entry (OAuth)
|
||||
├── .agents/plugins/marketplace.json # Codex marketplace listing this repo as a local-source plugin
|
||||
├── .mcp.json # Auto-registers AgentKey MCP when installed as a Claude Code plugin
|
||||
├── skills/agentkey/
|
||||
@@ -54,11 +58,11 @@ git tag -d vX.Y.Z && git push origin :refs/tags/vX.Y.Z
|
||||
gh release delete vX.Y.Z --repo chainbase-labs/agentkey --yes
|
||||
```
|
||||
|
||||
Releases are driven by [release-please](https://github.com/googleapis/release-please): merged PRs with Conventional Commit messages (`feat:`, `fix:`, `feat!:`, etc.) update an open Release PR that bumps `skills/agentkey/version.txt`, `.claude-plugin/plugin.json` version, and `CHANGELOG.md`. Merging the Release PR tags the release and creates the GitHub Release, which in turn triggers plugin updates for users.
|
||||
Releases are driven by [release-please](https://github.com/googleapis/release-please): merged PRs with Conventional Commit messages (`feat:`, `fix:`, `feat!:`, etc.) update an open Release PR that bumps `skills/agentkey/version.txt`, all three plugin manifest versions, and `CHANGELOG.md`. Merging the Release PR tags the release and creates the GitHub Release, which in turn triggers plugin updates for users.
|
||||
|
||||
## Version & Release Rules
|
||||
|
||||
- `skills/agentkey/version.txt`, `.claude-plugin/plugin.json` version, `.codex-plugin/plugin.json` version, and `CHANGELOG.md` are managed by release-please based on Conventional Commits — never edit manually except via PR that intentionally amends them.
|
||||
- `skills/agentkey/version.txt`, the versions in `.claude-plugin/plugin.json`, `.codex-plugin/plugin.json`, and `.kimi-plugin/plugin.json`, plus `CHANGELOG.md`, are managed by release-please based on Conventional Commits — never edit manually except via PR that intentionally amends them.
|
||||
- `version.txt` lives inside `skills/agentkey/` (not at repo root) so it travels with the skill when the Skills CLI copies the subdirectory. `release-please-config.json` points at this path via `version-file`.
|
||||
- Tag format: `v` prefix (e.g. `v0.4.5`)
|
||||
- Plugin updates trigger on **GitHub Release** publication, not on plain commits
|
||||
@@ -66,8 +70,8 @@ Releases are driven by [release-please](https://github.com/googleapis/release-pl
|
||||
|
||||
## Change Checklists
|
||||
|
||||
**Changes to `plugin.json`:**
|
||||
- release-please automatically bumps `version` + `plugin.json` version + `CHANGELOG.md` from merged conventional-commit PRs; maintainers review + merge the generated Release PR rather than editing these files directly
|
||||
**Changes to any `plugin.json`:**
|
||||
- release-please automatically bumps all three manifest versions + `CHANGELOG.md` from merged conventional-commit PRs; maintainers review + merge the generated Release PR rather than editing these files directly
|
||||
|
||||
**Changes to `.mcp.json`:**
|
||||
- The MCP server is `type: http` (remote endpoint, no subprocess), so inject the API key by interpolating the userConfig value as `${user_config.AGENTKEY_API_KEY}` in the `Authorization` header — the key name MUST match the `plugin.json` `userConfig` key. Do NOT use `${CLAUDE_PLUGIN_OPTION_<KEY>}`: those env vars are only exported to stdio/subprocess servers and hook/monitor commands, and are not interpolated into an http server's headers.
|
||||
@@ -78,6 +82,13 @@ Releases are driven by [release-please](https://github.com/googleapis/release-pl
|
||||
- Do NOT set `oauth_resource`: rmcp already sends `resource` on its own, and Codex appends `oauth_resource` as a *second* `resource` query param without deduplication (`codex-rs/rmcp-client/src/perform_oauth_login.rs`). Clerk enforces RFC 6749 (no repeated params) and rejects the request with `invalid_request: The request includes the parameter 'resource' more than once`. The official Notion/Figma plugins get away with it only because their authorization servers tolerate duplicates.
|
||||
- Keep the endpoint URL in sync with the root `.mcp.json` — both must point at the same `/v1/mcp` endpoint.
|
||||
|
||||
**Changes to `.kimi-plugin/plugin.json`:**
|
||||
- `mcpServers` MUST be an inline object. Kimi does not accept a path such as `"./mcp.json"` for this field.
|
||||
- Keep the HTTP entry minimal: `{"agentkey":{"url":"https://api.agentkey.app/v1/mcp"}}`. Kimi infers the transport from `url`.
|
||||
- Do not add `userConfig`, a static Authorization header, or `${user_config.*}` interpolation. Kimi discovers and persists MCP OAuth credentials itself.
|
||||
- Kimi displays `Run /new or /reload to apply plugin changes.` after install. Once reloaded, the user completes native MCP OAuth with `/mcp-config login plugin-agentkey:agentkey` when Kimi reports that authentication is required.
|
||||
- Keep the endpoint URL in sync with the root `.mcp.json` and `.codex-plugin/mcp.json`.
|
||||
|
||||
**Changes to install/uninstall docs:**
|
||||
- Update both `README.md` and `docs/README_zh.md` together — they mirror each other
|
||||
- The canonical install is always the two-command sequence (`npx skills add …` + `npx -y @agentkey/cli --auth-login`). Don't imply either command does both.
|
||||
@@ -88,4 +99,5 @@ Releases are driven by [release-please](https://github.com/googleapis/release-pl
|
||||
- Setup mode in SKILL.md runs `! npx -y @agentkey/cli --auth-login` to authenticate via browser — same command as step 2 of the public install
|
||||
- `@agentkey/cli --auth-login` auto-writes MCP configs for 16 agents (canonical list lives in `AGENT_REGISTRY` in `../AgentKey-Server/cli/src/lib/mcp-clients.ts`): Claude Code, Claude Desktop, Cursor, Codex, Gemini CLI, OpenCode, Qwen Code, iFlow CLI, Kimi CLI, Kiro CLI, Windsurf, Warp, Amp, Crush, droid, openclaw. The `--only <ids>` flag (used by install.sh's `MCP_TARGETS` and install.ps1's `$McpTargets`) filters this list — its id values MUST match `npx skills add -a` ids, with `claude-desktop` as the one documented MCP-only exception. Goose / kode / kilo still need a manual JSON paste (see SKILL.md's "Fallback" section); when adding more agents server-side, keep `MCP_AUTO_AGENTS` in both install scripts and the cleanup list in both uninstall scripts in sync.
|
||||
- `.mcp.json` registers the remote-HTTP MCP endpoint (`https://api.agentkey.app/v1/mcp`) in Claude Code plugin mode; the API key flows from plugin userConfig into the `Authorization: Bearer ${user_config.AGENTKEY_API_KEY}` header (no stdio binary is launched)
|
||||
- `.kimi-plugin/plugin.json` registers the same endpoint inline in Kimi Code plugin mode. After reloading, the user starts Kimi's native MCP OAuth flow with `/mcp-config login plugin-agentkey:agentkey`.
|
||||
- `README.md` / `docs/README_zh.md` are the public-facing docs; keep them in sync with any structural changes
|
||||
|
||||
@@ -191,7 +191,8 @@ jobs:
|
||||
- `CHANGELOG.md` — managed (unless part of a release PR
|
||||
from release-please itself, which won't trigger this
|
||||
review since author.type == Bot)
|
||||
- `.claude-plugin/plugin.json` version field — managed
|
||||
- `.claude-plugin/plugin.json`, `.codex-plugin/plugin.json`,
|
||||
and `.kimi-plugin/plugin.json` version fields — managed
|
||||
|
||||
### 4c. Repo invariants
|
||||
- `skills/agentkey/scripts/check-update.sh` REPO line
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
name: verify-version-sync
|
||||
|
||||
# Guards against drift between the canonical version (skills/agentkey/version.txt)
|
||||
# and the version constant embedded in skills/agentkey/scripts/check-update.sh.
|
||||
# release-please syncs both via extra-files; this job catches the case where a
|
||||
# human edits one of them by hand and forgets the other.
|
||||
# Guards against drift between the canonical version, the skill metadata, and
|
||||
# every plugin manifest. release-please syncs them via extra-files; this job
|
||||
# catches a manual edit that updates only one copy.
|
||||
|
||||
on:
|
||||
push:
|
||||
@@ -13,6 +12,8 @@ on:
|
||||
- 'skills/agentkey/scripts/check-update.sh'
|
||||
- 'skills/agentkey/SKILL.md'
|
||||
- '.claude-plugin/plugin.json'
|
||||
- '.codex-plugin/plugin.json'
|
||||
- '.kimi-plugin/plugin.json'
|
||||
- 'release-please-config.json'
|
||||
pull_request:
|
||||
paths:
|
||||
@@ -20,6 +21,8 @@ on:
|
||||
- 'skills/agentkey/scripts/check-update.sh'
|
||||
- 'skills/agentkey/SKILL.md'
|
||||
- '.claude-plugin/plugin.json'
|
||||
- '.codex-plugin/plugin.json'
|
||||
- '.kimi-plugin/plugin.json'
|
||||
- 'release-please-config.json'
|
||||
|
||||
jobs:
|
||||
@@ -33,15 +36,21 @@ jobs:
|
||||
canonical=$(tr -d '[:space:]' < skills/agentkey/version.txt)
|
||||
script=$(grep -E '^LOCAL_VERSION="[^"]+"' skills/agentkey/scripts/check-update.sh \
|
||||
| head -1 | sed -E 's/^LOCAL_VERSION="([^"]+)".*/\1/')
|
||||
plugin=$(python3 -c 'import json; print(json.load(open(".claude-plugin/plugin.json"))["version"])')
|
||||
claude_plugin=$(python3 -c 'import json; print(json.load(open(".claude-plugin/plugin.json"))["version"])')
|
||||
codex_plugin=$(python3 -c 'import json; print(json.load(open(".codex-plugin/plugin.json"))["version"])')
|
||||
kimi_plugin=$(python3 -c 'import json; print(json.load(open(".kimi-plugin/plugin.json"))["version"])')
|
||||
skill=$(awk '/^---/{c++; next} c==1 && /^version:/{print $2; exit}' skills/agentkey/SKILL.md)
|
||||
echo "version.txt: $canonical"
|
||||
echo "check-update.sh: $script"
|
||||
echo "plugin.json: $plugin"
|
||||
echo "Claude plugin: $claude_plugin"
|
||||
echo "Codex plugin: $codex_plugin"
|
||||
echo "Kimi plugin: $kimi_plugin"
|
||||
echo "SKILL.md: $skill"
|
||||
if [ "$canonical" != "$script" ] \
|
||||
|| [ "$canonical" != "$plugin" ] \
|
||||
|| [ "$canonical" != "$claude_plugin" ] \
|
||||
|| [ "$canonical" != "$codex_plugin" ] \
|
||||
|| [ "$canonical" != "$kimi_plugin" ] \
|
||||
|| [ "$canonical" != "$skill" ]; then
|
||||
echo "::error::Version drift detected. release-please syncs all four from version.txt — re-run release-please or restore the values manually."
|
||||
echo "::error::Version drift detected. release-please syncs all six values from version.txt — re-run release-please or restore the values manually."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
{
|
||||
"name": "agentkey",
|
||||
"version": "1.12.1",
|
||||
"description": "AgentKey — one-stop live data marketplace for your agent: web search, web scraping, social media, finance, crypto, e-commerce, business data, weather/maps, and travel through a single MCP server. No API keys to manage, auto failover across providers, free to start.",
|
||||
"author": {
|
||||
"name": "Chainbase Labs"
|
||||
},
|
||||
"homepage": "https://agentkey.app",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"agentkey",
|
||||
"web-search",
|
||||
"scraping",
|
||||
"social-media",
|
||||
"finance",
|
||||
"crypto",
|
||||
"blockchain",
|
||||
"e-commerce",
|
||||
"business-data",
|
||||
"weather",
|
||||
"maps",
|
||||
"travel",
|
||||
"real-time-data"
|
||||
],
|
||||
"skills": "./skills/",
|
||||
"mcpServers": {
|
||||
"agentkey": {
|
||||
"url": "https://api.agentkey.app/v1/mcp"
|
||||
}
|
||||
},
|
||||
"interface": {
|
||||
"displayName": "AgentKey",
|
||||
"shortDescription": "One-stop live data marketplace for your agent",
|
||||
"longDescription": "AgentKey connects your agent to live external data through a single MCP server — web search, web scraping, social media, finance, crypto, e-commerce, business data, weather/maps, and travel — with no per-provider API integrations or key management. Providers are vetted and health-monitored, every call carries provenance, and auto failover keeps workflows running. Free to start.",
|
||||
"developerName": "Chainbase Labs",
|
||||
"websiteURL": "https://agentkey.app"
|
||||
}
|
||||
}
|
||||
@@ -17,6 +17,7 @@ The same repo also works as:
|
||||
|
||||
- a **Claude Code plugin** (`.claude-plugin/plugin.json` + root `.mcp.json`) — the plugin's `userConfig` injects the API key via `${user_config.AGENTKEY_API_KEY}`, substituting for step 2.
|
||||
- a **Codex plugin** (`.codex-plugin/plugin.json` + `.codex-plugin/mcp.json`, distributed through `.agents/plugins/marketplace.json`; the repo is its own marketplace: `codex plugin marketplace add chainbase-labs/agentkey`). Codex plugins have no `userConfig`/header-interpolation mechanism, so auth uses MCP OAuth via the server's RFC 9728 metadata discovery (`type` + `url` only in mcp.json), substituting for step 2.
|
||||
- a **Kimi Code plugin** (`.kimi-plugin/plugin.json`). Kimi requires `mcpServers` to be an inline object in the manifest. The remote AgentKey endpoint uses Kimi's native MCP OAuth flow; after install Kimi shows the standard `/reload` hint, then the user signs in with `/mcp-config login plugin-agentkey:agentkey` when Kimi reports that OAuth is required.
|
||||
|
||||
## Directory Structure
|
||||
|
||||
@@ -26,6 +27,8 @@ agentkey/
|
||||
├── .codex-plugin/
|
||||
│ ├── plugin.json # Codex plugin manifest (skills + mcpServers + interface metadata)
|
||||
│ └── mcp.json # Codex MCP entry — http + oauth_resource (NOT the root .mcp.json)
|
||||
├── .kimi-plugin/
|
||||
│ └── plugin.json # Kimi Code manifest with inline HTTP MCP entry (OAuth)
|
||||
├── .agents/plugins/marketplace.json # Codex marketplace listing this repo as a local-source plugin
|
||||
├── .mcp.json # Auto-registers AgentKey MCP when installed as a Claude Code plugin
|
||||
├── skills/agentkey/
|
||||
@@ -55,11 +58,11 @@ git tag -d vX.Y.Z && git push origin :refs/tags/vX.Y.Z
|
||||
gh release delete vX.Y.Z --repo chainbase-labs/agentkey --yes
|
||||
```
|
||||
|
||||
Releases are driven by [release-please](https://github.com/googleapis/release-please): merged PRs with Conventional Commit messages (`feat:`, `fix:`, `feat!:`, etc.) update an open Release PR that bumps `skills/agentkey/version.txt`, both plugin manifest versions, and `CHANGELOG.md`. Merging the Release PR tags the release and creates the GitHub Release, which in turn triggers plugin updates for users.
|
||||
Releases are driven by [release-please](https://github.com/googleapis/release-please): merged PRs with Conventional Commit messages (`feat:`, `fix:`, `feat!:`, etc.) update an open Release PR that bumps `skills/agentkey/version.txt`, all three plugin manifest versions, and `CHANGELOG.md`. Merging the Release PR tags the release and creates the GitHub Release, which in turn triggers plugin updates for users.
|
||||
|
||||
## Version & Release Rules
|
||||
|
||||
- `skills/agentkey/version.txt`, `.claude-plugin/plugin.json` version, `.codex-plugin/plugin.json` version, and `CHANGELOG.md` are managed by release-please based on Conventional Commits — never edit manually except via PR that intentionally amends them.
|
||||
- `skills/agentkey/version.txt`, the versions in `.claude-plugin/plugin.json`, `.codex-plugin/plugin.json`, and `.kimi-plugin/plugin.json`, plus `CHANGELOG.md`, are managed by release-please based on Conventional Commits — never edit manually except via PR that intentionally amends them.
|
||||
- `version.txt` lives inside `skills/agentkey/` (not at repo root) so it travels with the skill when the Skills CLI copies the subdirectory. `release-please-config.json` points at this path via `version-file`.
|
||||
- Tag format: `v` prefix (e.g. `v0.4.5`)
|
||||
- Plugin updates trigger on **GitHub Release** publication, not on plain commits
|
||||
@@ -67,8 +70,8 @@ Releases are driven by [release-please](https://github.com/googleapis/release-pl
|
||||
|
||||
## Change Checklists
|
||||
|
||||
**Changes to either `plugin.json`:**
|
||||
- release-please automatically bumps both manifest versions + `CHANGELOG.md` from merged conventional-commit PRs; maintainers review + merge the generated Release PR rather than editing these files directly
|
||||
**Changes to any `plugin.json`:**
|
||||
- release-please automatically bumps all three manifest versions + `CHANGELOG.md` from merged conventional-commit PRs; maintainers review + merge the generated Release PR rather than editing these files directly
|
||||
|
||||
**Changes to the root `.mcp.json` (Claude Code plugin path):**
|
||||
- The MCP server is `type: http` (remote endpoint, no subprocess), so inject the API key by interpolating the userConfig value as `${user_config.AGENTKEY_API_KEY}` in the `Authorization` header — the key name MUST match the `.claude-plugin/plugin.json` `userConfig` key. Do NOT use `${CLAUDE_PLUGIN_OPTION_<KEY>}`: those env vars are only exported to stdio/subprocess servers and hook/monitor commands, and are not interpolated into an http server's headers.
|
||||
@@ -79,6 +82,13 @@ Releases are driven by [release-please](https://github.com/googleapis/release-pl
|
||||
- Do NOT set `oauth_resource`: rmcp already sends `resource` on its own, and Codex appends `oauth_resource` as a *second* `resource` query param without deduplication (`codex-rs/rmcp-client/src/perform_oauth_login.rs`). Clerk enforces RFC 6749 (no repeated params) and rejects the request with `invalid_request: The request includes the parameter 'resource' more than once`. The official Notion/Figma plugins get away with it only because their authorization servers tolerate duplicates.
|
||||
- Keep the endpoint URL in sync with the root `.mcp.json` — both must point at the same `/v1/mcp` endpoint.
|
||||
|
||||
**Changes to `.kimi-plugin/plugin.json` (Kimi Code plugin path):**
|
||||
- `mcpServers` MUST be an inline object. Kimi does not accept a path such as `"./mcp.json"` for this field.
|
||||
- Keep the HTTP entry minimal: `{"agentkey":{"url":"https://api.agentkey.app/v1/mcp"}}`. Kimi infers the transport from `url`.
|
||||
- Do not add `userConfig`, a static Authorization header, or `${user_config.*}` interpolation. Kimi discovers and persists MCP OAuth credentials itself.
|
||||
- Kimi displays `Run /new or /reload to apply plugin changes.` after install. Once reloaded, the user completes native MCP OAuth with `/mcp-config login plugin-agentkey:agentkey` when Kimi reports that authentication is required.
|
||||
- Keep the endpoint URL in sync with the root `.mcp.json` and `.codex-plugin/mcp.json`.
|
||||
|
||||
**Changes to install/uninstall docs:**
|
||||
- Update both `README.md` and `docs/README_zh.md` together — they mirror each other
|
||||
- The canonical install is always the two-command sequence (`npx skills add …` + `npx -y @agentkey/cli --auth-login`). Don't imply either command does both.
|
||||
@@ -90,4 +100,5 @@ Releases are driven by [release-please](https://github.com/googleapis/release-pl
|
||||
- `@agentkey/cli --auth-login` auto-writes MCP configs for 16 agents (canonical list lives in `AGENT_REGISTRY` in `../AgentKey-Server/cli/src/lib/mcp-clients.ts`): Claude Code, Claude Desktop, Cursor, Codex, Gemini CLI, OpenCode, Qwen Code, iFlow CLI, Kimi CLI, Kiro CLI, Windsurf, Warp, Amp, Crush, droid, openclaw. The `--only <ids>` flag (used by install.sh's `MCP_TARGETS` and install.ps1's `$McpTargets`) filters this list — its id values MUST match `npx skills add -a` ids, with `claude-desktop` as the one documented MCP-only exception. Goose / kode / kilo still need a manual JSON paste (see SKILL.md's "Fallback" section); when adding more agents server-side, keep `MCP_AUTO_AGENTS` in both install scripts and the cleanup list in both uninstall scripts in sync.
|
||||
- Root `.mcp.json` registers the remote-HTTP MCP endpoint (`https://api.agentkey.app/v1/mcp`) in Claude Code plugin mode; the API key flows from plugin userConfig into the `Authorization: Bearer ${user_config.AGENTKEY_API_KEY}` header (no stdio binary is launched)
|
||||
- `.codex-plugin/mcp.json` registers the same endpoint in Codex plugin mode, authenticated via MCP OAuth (RFC 9728 discovery; no `oauth_resource` — see checklist above)
|
||||
- `.kimi-plugin/plugin.json` registers the same endpoint inline in Kimi Code plugin mode. After reloading, the user starts Kimi's native MCP OAuth flow with `/mcp-config login plugin-agentkey:agentkey`.
|
||||
- `README.md` / `docs/README_zh.md` are the public-facing docs; keep them in sync with any structural changes
|
||||
|
||||
@@ -364,6 +364,22 @@ codex plugin marketplace add chainbase-labs/agentkey
|
||||
|
||||
The plugin manifest lives in `.codex-plugin/plugin.json`; it bundles the same skill plus a remote-HTTP MCP entry (`.codex-plugin/mcp.json`) that authenticates against `https://api.agentkey.app/v1/mcp` via MCP OAuth (RFC 9728 discovery). Sign in with your AgentKey account when Codex prompts you.
|
||||
|
||||
**Kimi Code plugin mode** — install the repo directly from Kimi Code. The manifest bundles the skill and an inline remote-HTTP MCP entry, so there is **no API key to paste and no second `@agentkey/cli` step**:
|
||||
|
||||
```text
|
||||
# Public install
|
||||
/plugins install https://github.com/chainbase-labs/agentkey
|
||||
|
||||
# Or install a local checkout for development
|
||||
/plugins install /absolute/path/to/agentkey
|
||||
```
|
||||
|
||||
Kimi shows `Run /new or /reload to apply plugin changes.` after installation. Run `/reload`; when Kimi reports that the plugin MCP server needs OAuth, run `/mcp-config login plugin-agentkey:agentkey` and approve the browser authorization. You can then ask your original AgentKey question.
|
||||
|
||||
Kimi copies local plugins into its managed plugin directory. Re-run `/plugins install /absolute/path/to/agentkey` after editing the checkout, then run `/reload` again.
|
||||
|
||||
If you previously worked around an older AgentKey plugin by adding a user-global `agentkey` entry through `/mcp-config`, remove that old entry once with `/mcp-config remove agentkey` before reloading. The plugin now owns its namespaced MCP entry; keeping both would create duplicate tools and authentication attempts.
|
||||
|
||||
**Repo layout:**
|
||||
|
||||
```
|
||||
@@ -372,6 +388,8 @@ agentkey/
|
||||
├── .codex-plugin/
|
||||
│ ├── plugin.json # Codex plugin manifest
|
||||
│ └── mcp.json # Codex MCP entry (OAuth, no user_config)
|
||||
├── .kimi-plugin/
|
||||
│ └── plugin.json # Kimi manifest with inline MCP OAuth entry
|
||||
├── .agents/plugins/marketplace.json # Codex marketplace (this repo is its own marketplace)
|
||||
├── .mcp.json # Used when installed as a Claude Code plugin
|
||||
├── skills/agentkey/
|
||||
@@ -385,7 +403,7 @@ agentkey/
|
||||
└── uninstall.ps1 # Windows PowerShell uninstaller
|
||||
```
|
||||
|
||||
**Release a new version (maintainers):** releases are cut automatically by [release-please](https://github.com/googleapis/release-please). Merging a PR with a `feat:` or `fix:` title opens a Release PR that bumps `skills/agentkey/version.txt`, `plugin.json`, and `CHANGELOG.md`. Merging the Release PR creates the tag + GitHub Release + uploads the `agentkey.skill` asset.
|
||||
**Release a new version (maintainers):** releases are cut automatically by [release-please](https://github.com/googleapis/release-please). Merging a PR with a `feat:` or `fix:` title opens a Release PR that bumps `skills/agentkey/version.txt`, all three plugin manifests, and `CHANGELOG.md`. Merging the Release PR creates the tag + GitHub Release + uploads the `agentkey.skill` asset.
|
||||
|
||||
</details>
|
||||
|
||||
|
||||
+19
-1
@@ -364,6 +364,22 @@ codex plugin marketplace add chainbase-labs/agentkey
|
||||
|
||||
插件清单在 `.codex-plugin/plugin.json`;它捆绑了同一个 Skill,外加一条远程 HTTP MCP 配置(`.codex-plugin/mcp.json`),通过 MCP OAuth(RFC 9728 自动发现)对 `https://api.agentkey.app/v1/mcp` 做认证。Codex 提示时用你的 AgentKey 账号登录即可。
|
||||
|
||||
**Kimi Code 插件模式** —— 直接在 Kimi Code 中安装本仓库。插件清单同时捆绑 Skill 和内联的远程 HTTP MCP 配置,**不用粘贴 API Key,也不需要再单独跑 `@agentkey/cli`**:
|
||||
|
||||
```text
|
||||
# 公开安装
|
||||
/plugins install https://github.com/chainbase-labs/agentkey
|
||||
|
||||
# 或从本地 checkout 安装,用于开发
|
||||
/plugins install /absolute/path/to/agentkey
|
||||
```
|
||||
|
||||
安装成功后 Kimi 会显示 `Run /new or /reload to apply plugin changes.`。执行 `/reload`;当 Kimi 提示插件 MCP 需要 OAuth 时,执行 `/mcp-config login plugin-agentkey:agentkey` 并在浏览器完成授权,之后即可提出原本的 AgentKey 查询。
|
||||
|
||||
Kimi 会把本地插件复制到自己的托管目录。修改原 checkout 后,需要重新执行 `/plugins install /absolute/path/to/agentkey`,再执行一次 `/reload`。
|
||||
|
||||
如果你曾为旧版 AgentKey plugin 手工通过 `/mcp-config` 添加过用户全局的 `agentkey` 条目,请在 reload 前执行一次 `/mcp-config remove agentkey` 删除旧条目。现在 plugin 会维护自己的命名空间 MCP;同时保留两份会造成工具和鉴权流程重复。
|
||||
|
||||
**仓库结构:**
|
||||
|
||||
```
|
||||
@@ -372,6 +388,8 @@ agentkey/
|
||||
├── .codex-plugin/
|
||||
│ ├── plugin.json # Codex 插件清单
|
||||
│ └── mcp.json # Codex MCP 配置(OAuth,无 user_config)
|
||||
├── .kimi-plugin/
|
||||
│ └── plugin.json # Kimi 清单,内联 MCP OAuth 配置
|
||||
├── .agents/plugins/marketplace.json # Codex marketplace(本仓库即自己的 marketplace)
|
||||
├── .mcp.json # 作为 Claude Code 插件安装时使用
|
||||
├── skills/agentkey/
|
||||
@@ -385,7 +403,7 @@ agentkey/
|
||||
└── uninstall.ps1 # Windows PowerShell 卸载脚本
|
||||
```
|
||||
|
||||
**发布新版本(Maintainer):** 发版由 [release-please](https://github.com/googleapis/release-please) 自动触发。合并一个 `feat:` 或 `fix:` 的 PR 后,release-please 会开一个 Release PR,自动 bump `skills/agentkey/version.txt`、`plugin.json`、`CHANGELOG.md`。合并这个 Release PR 即会创建 tag + GitHub Release + 上传 `agentkey.skill` 产物。
|
||||
**发布新版本(Maintainer):** 发版由 [release-please](https://github.com/googleapis/release-please) 自动触发。合并一个 `feat:` 或 `fix:` 的 PR 后,release-please 会开一个 Release PR,自动 bump `skills/agentkey/version.txt`、三个插件清单和 `CHANGELOG.md`。合并这个 Release PR 即会创建 tag + GitHub Release + 上传 `agentkey.skill` 产物。
|
||||
|
||||
</details>
|
||||
|
||||
|
||||
@@ -20,6 +20,11 @@
|
||||
"path": ".codex-plugin/plugin.json",
|
||||
"jsonpath": "$.version"
|
||||
},
|
||||
{
|
||||
"type": "json",
|
||||
"path": ".kimi-plugin/plugin.json",
|
||||
"jsonpath": "$.version"
|
||||
},
|
||||
{
|
||||
"type": "generic",
|
||||
"path": "skills/agentkey/scripts/check-update.sh"
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
setup() {
|
||||
REPO_ROOT="$(cd "$BATS_TEST_DIRNAME/.." && pwd)"
|
||||
MANIFEST="$REPO_ROOT/.kimi-plugin/plugin.json"
|
||||
}
|
||||
|
||||
@test "Kimi plugin declares the AgentKey MCP server inline" {
|
||||
python3 - "$MANIFEST" <<'PY'
|
||||
import json
|
||||
import sys
|
||||
|
||||
with open(sys.argv[1], encoding="utf-8") as handle:
|
||||
manifest = json.load(handle)
|
||||
|
||||
servers = manifest.get("mcpServers")
|
||||
assert isinstance(servers, dict), "mcpServers must be an inline object"
|
||||
assert servers == {
|
||||
"agentkey": {
|
||||
"url": "https://api.agentkey.app/v1/mcp",
|
||||
}
|
||||
}
|
||||
PY
|
||||
}
|
||||
|
||||
@test "Kimi plugin relies on native OAuth instead of static credentials" {
|
||||
python3 - "$MANIFEST" <<'PY'
|
||||
import json
|
||||
import sys
|
||||
|
||||
with open(sys.argv[1], encoding="utf-8") as handle:
|
||||
manifest = json.load(handle)
|
||||
|
||||
assert "userConfig" not in manifest
|
||||
server = manifest["mcpServers"]["agentkey"]
|
||||
assert "headers" not in server
|
||||
assert "bearerTokenEnvVar" not in server
|
||||
PY
|
||||
|
||||
[ ! -e "$REPO_ROOT/.kimi-plugin/mcp.json" ]
|
||||
}
|
||||
Reference in New Issue
Block a user