Get the FREE Ultimate OpenClaw Setup Guide →

mcp-ai-agents-template

A Model Context Protocol (MCP) TypeScript template with multi agents that can send Emails, schedule meetings and answer knowledge-base related questions.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio radulepy-mcp-ai-agents-template npx -y mcp-ai-agents-template \
  --env CLIENT_ID="your-client-id" \
  --env CLIENT_SECRET="your-client-secret" \
  --env OPENAI_API_KEY="your-openai-api-key"

How to use

This MCP server template demonstrates a multi-agent orchestration system built around the Model Context Protocol. It coordinates several AI agents (e.g., OpenAI, Gemini) and multiple tools (Gmail, Google Calendar, Knowledge Base, etc.) through a central Hub (WebSocket) and a Routing Agent that decides which agent or tool should handle a given user request. The client UI visualizes the network of agents/tools and lets users chat with the system. To get started, clone the repository, install dependencies, and run the hub first, followed by the routing agent and at least one AI agent. This setup lets you test end-to-end prompts that route to the appropriate tool or LLM, enabling complex automations across multiple services.

How to install

Prerequisites:

  • Git
  • Node.js and npm (or pnpm/yarn as you prefer)
  • Basic terminal/command-line knowledge

Step-by-step:

  1. Clone the repository: git clone https://github.com/your-username/multi-agent-ai-playground.git cd multi-agent-ai-playground

  2. Install dependencies: npm install

  3. Create environment variables file (optional for local testing):

    • Create a .env file in the root and add keys such as: OPENAI_API_KEY=sk-... CLIENT_ID=your_client_id_here CLIENT_SECRET=your_client_secret_here
  4. Start the system components in separate terminals (as suggested in the README): npm run start-hub # Start the central hub (must be first) npm run start-routing # Start the routing agent (must be second) npm run start-agent-openai # Start at least one agent (OpenAI recommended)

    Optionally, start more agents/tools:

    npm run start-agent-gemini npm run start-tool-gmail npm run start-tool-gcalendar npm run start-tool-knowledge-base

  5. Start the client (UI): npm run client

    or from the client folder:

    cd client npm run dev

  6. Open the UI at http://localhost:5173

Additional notes

Tips and notes:

  • The hub runs at ws://localhost:8080 by default; ensure no port conflicts.
  • Each agent/tool connects to the hub and appears as a node in the UI; start nodes in separate terminals or use a process manager.
  • You can add more agents or tools by duplicating and adjusting existing agent/tool files in /src/agents or /src/tools.
  • Environment variables such as OPENAI_API_KEY and Google OAuth secrets should be kept secure; do not commit secrets to source control.
  • If you encounter authentication issues with Google tools, ensure /secrets/google-secret.json is properly generated after completing the Google OAuth flow.

Related MCP Servers

Sponsor this space

Reach thousands of developers