JSPM

react-mcp-chatbot

0.0.6
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 26
  • Score
    100M100P100Q37900F
  • License MIT

A React MCP-style AI chatbot component with tool calling and backend integration

Package Exports

  • react-mcp-chatbot

Readme

npm version npm downloads license GitHub stars

πŸ€– React MCP Chatbot

AI-powered React chatbot with intelligent API tool calling

A production-ready chat widget that understands user intent, selects the correct API, executes it, and responds with clean Markdown-formatted answers.


✨ What is React MCP Chatbot?

React MCP Chatbot is a customizable AI chatbot component that connects natural language user requests to real API calls using an LLM-powered agent.

Instead of writing complex conditional logic, you simply define tools (API functions) β€” the AI automatically decides when and how to call them.

This makes it ideal for real-world, data-driven AI applications.


πŸŽ₯ Demo

Example: user asks a question β†’ AI decides β†’ API is called β†’ formatted response

React MCP Chatbot Demo


πŸš€ Features

  • πŸ€– AI-driven tool selection
  • πŸ”Œ Pluggable API tools
  • 🧠 LLM-powered intent detection
  • 🧩 Fully typed (TypeScript)
  • 🎨 Modern floating chat UI
  • πŸŒ— Dark & Light themes
  • πŸ“ Highly customizable
  • πŸ“ Markdown responses (tables, lists, code)
  • ⚑ Ollama / Groq / OpenAI / Gemini / Deepseek
  • πŸ›  Optional & validated tool parameters

🧠 How It Works


User Message
     ↓
LLM analyzes intent
     ↓
Tool decision (or no tool)
     ↓
API function executed
     ↓
Markdown-formatted response

πŸ“¦ Installation

npm install react-mcp-chatbot

or

yarn add react-mcp-chatbot

⚑ Quick Start

import { MCPAgent } from "react-mcp-chatbot";

<MCPAgent
  provider="ollama" // or "groq"
  providerURL="http://localhost:11434"
  model="llama3"
  tools={tools}
/>

πŸ›  Defining API Tools

import type { MCPTool } from "react-mcp-chatbot";

const weatherTool: MCPTool = {
  name: "get_weather",
  description: "Get current weather for a city",
  parameters: {
    city: {
      type: "string",
      description: "City name",
    },
    units: {
      type: "string",
      optional: true,
      description: "metric or imperial",
    },
  },
  call: async ({ city, units }) => {
    const res = await fetch(
      `https://api.example.com/weather?q=${city}&units=${units ?? "metric"}`
    );
    return res.json();
  },
};

🎨 UI Customization

<MCPAgent
  title="Support Assistant"
  align="right"
  theme="dark"
  width={420}
  height={640}
  primaryColor="#6366f1"
  borderRadius={20}
  placeholder="Ask me anything…"
/>

🧭 Use Cases

  • AI customer support bots
  • Internal admin dashboards
  • API copilots
  • SaaS onboarding assistants
  • Analytics chatbots
  • Developer tools
  • Portfolio projects

πŸ“œ License

MIT Β© Tigran Zakharyan


⭐ Star the Project

If this project helped you or inspired you, please consider giving it a star ⭐
It helps a lot and motivates further development.