Skip to content

Commit 8238ee0

Browse files
committed
Add MCP tools and refresh docs
1 parent ac1af21 commit 8238ee0

8 files changed

Lines changed: 219 additions & 294 deletions

File tree

PRD-chat-ui.md

Lines changed: 0 additions & 136 deletions
This file was deleted.

PRD-static-skill-loader.md

Lines changed: 0 additions & 157 deletions
This file was deleted.

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ Highlights:
88
- Browser-first agent loop (observe → plan → act)
99
- **Skills**: prompt-based tools stored in the DOM (Codex skill markdown)
1010
- Built-in DOM/JS tools (XPath helpers, event binding, interpreter)
11+
- Optional chat UI subpath (`browseragentkit/ui`)
12+
- Static skill loader with Vite plugin (DOM-backed resources)
13+
- Minimal MCP HTTP tools adapter
1114
- Streaming API (async generator)
1215

1316
## Install
@@ -132,6 +135,22 @@ const skill = Skill.fromDomSelector("//script[@data-skill='canvas.render' and @d
132135
The plugin injects `script[type="text/plain"]` nodes under `#bak-skills-root` with:
133136
`data-skill`, `data-kind` (`prompt | reference | script`), and `data-path`.
134137

138+
## MCP tools (HTTP)
139+
140+
```ts
141+
import { createMcpHttpClient, mcpTools } from "browseragentkit";
142+
143+
const mcpClient = createMcpHttpClient({
144+
baseUrl: "https://mcp.example.com",
145+
bearerToken: "token",
146+
});
147+
148+
const callables = [
149+
...mcpTools(mcpClient),
150+
// ...your other tools/skills
151+
];
152+
```
153+
135154
## Concepts
136155

137156
### Skills
@@ -254,6 +273,7 @@ npm run dev
254273
```
255274

256275
Vite will open the demo and refresh on source changes.
276+
The demo includes skill and tool toggles above the chat input.
257277

258278
### GitHub Pages (static demo)
259279

examples/index.html

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,11 @@
138138
flex-direction: column;
139139
gap: 6px;
140140
}
141+
.tool-list {
142+
display: flex;
143+
flex-direction: column;
144+
gap: 6px;
145+
}
141146
.skill-list-items {
142147
display: flex;
143148
flex-direction: column;
@@ -201,6 +206,11 @@ <h1>BrowserAgentKit Chat</h1>
201206
<div id="skillList" class="skill-list-items"></div>
202207
</div>
203208

209+
<div class="tool-list">
210+
<label>Enabled tools</label>
211+
<div id="toolList" class="skill-list-items"></div>
212+
</div>
213+
204214
<div id="chatLog" class="chat-log"></div>
205215

206216
<label for="prompt">Message</label>

0 commit comments

Comments
 (0)