@link-assistant/agent 0.0.15 → 0.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -287,6 +287,110 @@ All 13 tools are **enabled by default** with **no configuration required**. See
287
287
 
288
288
  ✨ = Always enabled (no experimental flags or environment variables needed)
289
289
 
290
+ ## MCP (Model Context Protocol) Support
291
+
292
+ The agent supports the Model Context Protocol (MCP), allowing you to extend functionality with MCP servers. MCP enables the agent to interact with external tools and services, such as browser automation via Playwright.
293
+
294
+ ### Installing Playwright MCP
295
+
296
+ Microsoft's Playwright MCP server provides browser automation capabilities using Playwright. This enables the agent to interact with web pages through structured accessibility snapshots.
297
+
298
+ **Requirements:**
299
+
300
+ - Node.js 18 or newer (for running the Playwright MCP server)
301
+ - Bun (for running the agent itself)
302
+
303
+ **Installation:**
304
+
305
+ ```bash
306
+ # Add Playwright MCP server to your agent configuration
307
+ agent mcp add playwright npx @playwright/mcp@latest
308
+
309
+ # Verify the configuration
310
+ agent mcp list
311
+ ```
312
+
313
+ This will create a configuration file at `~/.config/opencode/opencode.json` (or your system's config directory) with:
314
+
315
+ ```json
316
+ {
317
+ "$schema": "https://opencode.ai/config.json",
318
+ "mcp": {
319
+ "playwright": {
320
+ "type": "local",
321
+ "command": ["npx", "@playwright/mcp@latest"],
322
+ "enabled": true
323
+ }
324
+ }
325
+ }
326
+ ```
327
+
328
+ **Available Playwright Tools:**
329
+
330
+ Once configured, the agent gains access to 22+ browser automation tools:
331
+
332
+ - `browser_navigate` - Navigate to a URL
333
+ - `browser_click` - Click on an element
334
+ - `browser_type` - Type text into an element
335
+ - `browser_snapshot` - Capture accessibility snapshot
336
+ - `browser_take_screenshot` - Take a screenshot
337
+ - `browser_fill_form` - Fill multiple form fields
338
+ - `browser_select_option` - Select dropdown option
339
+ - `browser_hover` - Hover over element
340
+ - `browser_drag` - Drag and drop
341
+ - `browser_evaluate` - Execute JavaScript
342
+ - `browser_tabs` - Manage browser tabs
343
+ - `browser_close` - Close the browser
344
+ - `browser_wait_for` - Wait for text/element
345
+ - `browser_press_key` - Press keyboard key
346
+ - `browser_handle_dialog` - Handle browser dialogs
347
+ - `browser_network_requests` - Get network requests
348
+ - `browser_console_messages` - Get console messages
349
+ - `browser_file_upload` - Upload files
350
+ - `browser_resize` - Resize browser window
351
+ - `browser_navigate_back` - Navigate back
352
+ - `browser_install` - Install browser
353
+ - `browser_run_code` - Run Playwright code
354
+
355
+ **Usage Example:**
356
+
357
+ ```bash
358
+ # Tell the agent to navigate to a website and take a screenshot
359
+ echo "Navigate to https://example.com and take a screenshot" | agent
360
+ ```
361
+
362
+ The agent will automatically use the Playwright MCP tools when browser automation is needed.
363
+
364
+ **Learn More:**
365
+
366
+ - [Playwright MCP GitHub Repository](https://github.com/microsoft/playwright-mcp)
367
+ - [Using Playwright MCP with Claude Code](https://til.simonwillison.net/claude-code/playwright-mcp-claude-code)
368
+ - [Playwright MCP Case Study](docs/case-studies/playwright-mcp-support/case-study.md)
369
+
370
+ ### Managing MCP Servers
371
+
372
+ **List configured servers:**
373
+
374
+ ```bash
375
+ agent mcp list
376
+ ```
377
+
378
+ **Add a remote MCP server:**
379
+
380
+ ```bash
381
+ agent mcp add myserver --url https://example.com/mcp
382
+ ```
383
+
384
+ **Interactive mode:**
385
+
386
+ If you prefer an interactive setup, just run:
387
+
388
+ ```bash
389
+ agent mcp add
390
+ ```
391
+
392
+ The interactive prompt will guide you through configuring local or remote MCP servers.
393
+
290
394
  ## Examples
291
395
 
292
396
  See [EXAMPLES.md](EXAMPLES.md) for detailed usage examples of each tool with both agent-cli and opencode commands.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@link-assistant/agent",
3
- "version": "0.0.15",
3
+ "version": "0.0.17",
4
4
  "description": "A minimal, public domain AI CLI agent compatible with OpenCode's JSON interface. Bun-only runtime.",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -704,7 +704,7 @@ export namespace SessionPrompt {
704
704
  // When --system-message is provided, use it exclusively without any
705
705
  // additional context (no environment, no custom instructions, no header).
706
706
  // This is critical for models with low token limits (e.g., qwen3-32b with 6K TPM).
707
- if (input.system) {
707
+ if (input.system !== undefined) {
708
708
  return [input.system];
709
709
  }
710
710