@asd345gh/mcpkit
v1.0.0
Published
Shared browser automation and MCP server utilities for CLI tools
Downloads
24
Maintainers
Readme
@asd345gh/mcpkit
Shared browser automation and MCP (Model Context Protocol) server utilities for CLI tools.
Installation
npm install @asd345gh/mcpkitModules
Browser Module (@asd345gh/mcpkit/browser)
Puppeteer browser automation utilities with cross-platform Chrome detection.
import { launchBrowser, withBrowser, findChromePath } from '@asd345gh/mcpkit/browser';
// Auto-detect Chrome path
const chromePath = findChromePath();
// Launch browser with persistent user data
const browser = await launchBrowser({
headless: false,
appName: 'my-cli',
});
// Auto-manage browser lifecycle
await withBrowser({ appName: 'my-cli' }, async (page) => {
await page.goto('https://example.com');
// Browser auto-closes after callback
});MCP Server Module (@asd345gh/mcpkit/mcp)
Helper utilities for creating MCP servers.
import { createMcpServer, createMcpTool } from '@asd345gh/mcpkit/mcp';
createMcpServer({
name: 'my-server',
version: '1.0.0',
tools: {
myTool: {
definition: createMcpTool({
name: 'myTool',
description: 'My tool description',
}),
handler: async (args) => ({
content: [{ type: 'text', text: 'Result' }],
}),
},
},
});Utils Module (@asd345gh/mcpkit/utils)
File-based caching utilities.
import { saveToCache, loadFromCache, loadFromCacheWithTtl } from '@asd345gh/mcpkit/utils';
// Save to cache
saveToCache({ appName: 'my-cli' }, 'data.json', { key: 'value' });
// Load from cache
const data = loadFromCache({ appName: 'my-cli' }, 'data.json');
// Load with TTL (in seconds)
const freshData = loadFromCacheWithTtl({ appName: 'my-cli' }, 'data.json', 3600);Peer Dependencies
This package requires the following peer dependencies to be installed in your project:
@modelcontextprotocol/sdk(for MCP module)puppeteer-core(for browser module)
npm install @modelcontextprotocol/sdk puppeteer-coreLicense
MIT
