1.0.0 • Published 7 months ago

@aintent/mcp-kit v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

Intent MCP Kit 🚀

npm version TypeScript License: MIT PRs Welcome

Features ✨

  • 🎯 Intent Processing: Advanced natural language understanding and intent classification
  • 🔄 Workflow Generation: Automated workflow creation from natural language inputs
  • 🎨 Interactive Widgets: Ready-to-use UI components for chat and flow visualization
  • 🛠️ Extensible Architecture: Easy to customize and extend with your own components
  • 📦 TypeScript Ready: Full TypeScript support with comprehensive type definitions
  • 🔌 Plugin System: Extensible plugin architecture for custom integrations
  • 🎭 Theme Support: Light and dark themes out of the box
  • 📱 Responsive Design: Works seamlessly on desktop and mobile

Quick Start 🚀

import { MCPClient, ChatWidget } from '@aintent/mcp-kit';

// Initialize the client
const client = new MCPClient({
  apiKey: 'your-api-key'
});

// Create a chat widget
const chat = new ChatWidget('#chat-container', client, {
  theme: 'light',
  height: '500px'
});

// Process intents and generate workflows
chat.on('message', async (message) => {
  const intent = await client.processIntent(message);
  const flow = await client.generateWorkflow(intent);
  await client.executeWorkflow(flow);
});

Installation 📦

# Using npm
npm install @aintent/mcp-kit

# Using yarn
yarn add @aintent/mcp-kit

# Using pnpm
pnpm add @aintent/mcp-kit

Usage 💡

Core Client

import { MCPClient } from '@aintent/mcp-kit';

const client = new MCPClient({
  apiKey: 'your-api-key',
  options: {
    timeout: 5000,
    retries: 3
  }
});

// Process an intent
const intent = await client.processIntent('Deploy the application to production');

// Generate a workflow
const flow = await client.generateWorkflow(intent);

// Execute the workflow
const result = await client.executeWorkflow(flow);

Interactive Chat

import { ChatWidget } from '@aintent/mcp-kit';

const chat = new ChatWidget('#chat', client, {
  theme: 'dark',
  height: '600px',
  placeholder: 'What would you like to do?',
  maxMessages: 100,
  autoScroll: true
});

// Listen for events
chat.on('message', (message) => {
  console.log('New message:', message);
});

Flow Visualization

import { FlowViewerWidget } from '@aintent/mcp-kit';

const viewer = new FlowViewerWidget('#viewer', flow, {
  height: '800px',
  theme: 'light',
  zoom: {
    min: 0.5,
    max: 3,
    step: 0.1
  }
});

// Update flow data
viewer.updateFlow(newFlow);

Widgets 🎨

The SDK includes ready-to-use UI components:

  • ChatWidget: Interactive chat interface for natural language interactions
  • FlowViewerWidget: Visual workflow representation with zoom and pan capabilities
  • Custom Widgets: Extend MCPWidget to create your own components

Learn more about widgets →

API Reference 📚

MCPClient

  • processIntent(input: string): Promise<DeepIntent>
  • generateWorkflow(intent: DeepIntent): Promise<DeepFlow>
  • executeWorkflow(flow: DeepFlow): Promise<WorkflowResult>

Widgets

Full API Documentation →

Examples 🎮

Basic Intent Processing

const result = await client.processIntent('Scale the web service to 5 replicas');
console.log(result.confidence); // 0.95
console.log(result.action); // { type: 'scale', target: 'web-service', replicas: 5 }

Workflow Generation

const workflow = await client.generateWorkflow({
  action: 'deploy',
  target: 'web-app',
  environment: 'production'
});

console.log(workflow.steps); // Array of workflow steps
console.log(workflow.resources); // Required resources

More Examples →

Documentation 📖

Contributing 🤝

We welcome contributions! Please see our Contributing Guide for details.

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

License 📄

This project is licensed under the MIT License - see the LICENSE file for details.

Support 💬