Kimi in Chrome

binyu2 pts0 comments

GitHub - 0xSufi/kimi-chrome: Chrome extension that exposes the browser as a tool surface to kimi-code · GitHub

/" data-turbo-transient="true" />

Skip to content

Search or jump to...

Search code, repositories, users, issues, pull requests...

-->

Search

Clear

Search syntax tips

Provide feedback

--><br>We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Cancel

Submit feedback

Saved searches

Use saved searches to filter your results more quickly

-->

Name

Query

To see all available qualifiers, see our documentation.

Cancel

Create saved search

Sign in

/;ref_cta:Sign up;ref_loc:header logged out"}"<br>Sign up

Appearance settings

Resetting focus

You signed in with another tab or window. Reload to refresh your session.<br>You signed out in another tab or window. Reload to refresh your session.<br>You switched accounts on another tab or window. Reload to refresh your session.

Dismiss alert

{{ message }}

0xSufi

kimi-chrome

Public

Notifications<br>You must be signed in to change notification settings

Fork

Star

master

BranchesTags

Go to file

CodeOpen more actions menu

Folders and files<br>NameNameLast commit message<br>Last commit date<br>Latest commit

History<br>5 Commits<br>5 Commits

public

public

shim

shim

src

src

.gitignore

.gitignore

FEASIBILITY.md

FEASIBILITY.md

IMPLEMENTATION.md

IMPLEMENTATION.md

README.md

README.md

package-lock.json

package-lock.json

package.json

package.json

postcss.config.js

postcss.config.js

tailwind.config.ts

tailwind.config.ts

tsconfig.json

tsconfig.json

vite.config.ts

vite.config.ts

View all files

Repository files navigation

Kimi in Chrome

A Manifest V3 Chrome extension that exposes the browser as a tool surface to<br>kimi-code (Moonshot's Kimi Code CLI) and embeds a sidepanel chat backed by<br>kimi-code's local daemon (kap-server). Ported from<br>dyspel-chrome-plugin — the Claude-flavored<br>original — per FEASIBILITY.md.

┌────────────────────────── Chrome ──────────────────────────┐<br>│ Kimi-in-Chrome extension │<br>kimi web │ sidepanel chat ◄──REST /sessions /prompts /approvals──┐ │<br>(kap-server) ◄─┼──────────────────────────────────────────────────────── │ │<br>127.0.0.1:58627│ ◄──WS /api/v1/ws assistant.delta / approval events──┘ │<br>▲ │ │<br>│ MCP │ tool registry (13 CDP tools) ◄──ws bridge protocol──┐ │<br>▼ │ │ │<br>shim/shim.mjs ─┴────────────────────────────────────────────────────────┘ │<br>127.0.0.1:8765 /mcp (streamable HTTP) ↔ /chrome/* (extension WebSocket) │<br>└────────────────────────────────────────────────────────────┘

Components

src/ — the extension. CDP-backed tools (navigate, computer, read_page,<br>find, form_input, javascript_tool, tabs, console/network readers,<br>resize_window, gif_creator, update_plan), per-domain permission gate,<br>scheduled prompts, sidepanel chat, options page.

shim/ — one small local process bridging both worlds: serves the 13<br>browser tools to kimi-code as a streamable-HTTP MCP server (/mcp) and<br>relays each tools/call to the extension over the bridge WebSocket<br>(/chrome/*), which the extension dials out to.

Setup

Build + load the extension

npm install<br>npm run build # tsc --noEmit && vite build → dist/

Load dist/ as an unpacked extension at chrome://extensions.

Start the daemon (kimi-code ≥ the pinned commit, Node ≥ 24.15)

kimi web --no-open # kap-server on 127.0.0.1:58627, prints #token=…

Configure the extension (options page → Connection)

Kimi server URL: http://127.0.0.1:58627

Auth token: from ~/.kimi-code/server.token or the printed #token= fragment

Working directory: an existing absolute path on this machine (the daemon<br>requires metadata.cwd and does not expand ~)

Model id: leave empty — auto-picked when the daemon has exactly one model<br>(e.g. env-injected or managed login)

CORS : allow the extension origin on the daemon:

kimi web --no-open">KIMI_CODE_CORS_ORIGINS=chrome-extension://your-extension-id> kimi web --no-open

(Loopback pages are auto-allowed; a chrome-extension:// origin is not.)

Browser tools for the agent — start the shim and register it:

cd shim && npm install && npm start # 127.0.0.1:8765

~/.kimi-code/mcp.json:

{ "mcpServers": { "chrome": { "url": "http://127.0.0.1:8765/mcp" } } }

The extension's bridge transport dials ws://127.0.0.1:8765/chrome/local<br>automatically (override via chrome.storage.local.LOCAL_BRIDGE_URL). Tools<br>appear to the agent as mcp__chrome__navigate etc. The extension's own<br>per-domain permission prompts still gate every call — keep the side panel<br>open so they have a UI.

Verified

See IMPLEMENTATION.md for the integration test transcript: real kap-server<br>(kimi-code 66f611aae) + shim + simulated extension client — session create,<br>WS handshake, streamed assistant.delta, MCP chrome server connected with<br>13 tools, and the full approval round-trip (approval.requested → REST<br>approve → tool runs → turn completes).

What changed vs. the Dyspel original

claude.ai OAuth deleted — auth is one pasted bearer token; Kimi...

kimi chrome extension code shim server

Related Articles