WhatsApp Claude MCP
WhatsApp Claude MCP
Ein leistungsstarker WhatsApp-Bot, der mithilfe des Model Context Protocol (MCP) in Claude AI integriert ist. Sende Nachrichten an deinen WhatsApp-Bot und erhalte intelligente Antworten, unterstützt von Claude, mit Zugriff auf externe APIs und Tools.
🌟 Features
Claude-AI-Integration: Nutzt Claude 3.5 Sonnet für intelligente Gespräche
MCP-Tools: Erweiterbares Toolsystem für Claude, um mit externen APIs zu interagieren
Witzgenerator: Integriertes Tool, das zufällige Witze über eine externe API abruft
Konversationsgedächtnis: Behält den Kontext über mehrere Nachrichten pro Benutzer
WhatsApp-Webhook: Einfache REST-API für die Integration in WhatsApp-Dienste
Einfaches Deployment: Funktioniert mit Express-Server, bereit für die Cloud-Bereitstellung
Related MCP server: WAHA WhatsApp MCP Server
📋 Voraussetzungen
Node.js 18+
npm oder yarn
Anthropic-API-Schlüssel (erhältlich unter console.anthropic.com)
Zugriff auf die WhatsApp Cloud API (für die Produktionsintegration)
🚀 Schnellstart
1. Projekt klonen und installieren
git clone https://github.com/yulianheroes-lgtm/whatsapp-claude-mcp.git
cd whatsapp-claude-mcp
npm install2. Umgebungsvariablen festlegen
cp .env.example .envBearbeite .env und füge deinen Anthropic-API-Schlüssel hinzu:
ANTHROPIC_API_KEY=your_anthropic_api_key_here
PORT=30003. Server starten
npm startDu solltest Folgendes sehen:
✅ WhatsApp Claude MCP Server running on http://localhost:3000
🤖 Ready to process WhatsApp messages!📡 API-Nutzung
Health Check
curl http://localhost:3000/healthNachricht an Claude senden
curl -X POST http://localhost:3000/webhook/whatsapp \
-H "Content-Type: application/json" \
-d '{
"userId": "1234567890",
"message": "Tell me a joke"
}'Antwort:
{
"success": true,
"userId": "1234567890",
"message": "😂 Here's a programming joke for you!\n\nWhy do programmers prefer dark mode?\n\nBecause light attracts bugs! 🐛"
}Konversationsverlauf löschen
curl -X POST http://localhost:3000/webhook/clear-history \
-H "Content-Type: application/json" \
-d '{
"userId": "1234567890"
}'🛠️ Verfügbare Tools
Witzgenerator
Claude kann dieses Tool automatisch verwenden, wenn es passt:
Auslöser: Wenn der Benutzer nach Witzen fragt
Typen: random, programming, general
API: Official Joke API
Beispielinteraktion:
User: Tell me a funny programming joke
Bot: [Uses joke_generator tool] 😂 Here's a programming joke...📁 Projektstruktur
whatsapp-claude-mcp/
├── src/
│ ├── index.js # Main Express server
│ ├── whatsapp-handler.js # Message handling & Claude integration
│ ├── mcp-server.js # MCP tool definitions & execution
│ └── tools/
│ └── joke-generator.js # Joke generator tool implementation
├── .env.example # Environment variables template
├── .gitignore # Git ignore rules
├── package.json # Dependencies
└── README.md # This file🔌 Integration in WhatsApp
Option 1: WhatsApp Cloud API
Für die Produktion die WhatsApp Cloud API integrieren:
Richte einen Webhook auf der Meta Business Platform ein
Lege die Webhook-URL fest auf:
https://your-domain.com/webhook/whatsappWenn WhatsApp Nachrichten sendet, bitte leite sie an diesen Endpunkt weiter.
Option 2: Lokale Tests
Verwende Tools wie curl, Postman oder ein Testskript, um Nachrichten zu senden:
// test.js
const userId = '1234567890';
const message = 'Tell me a joke';
const response = await fetch('http://localhost:3000/webhook/whatsapp', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ userId, message })
});
const result = await response.json();
console.log(result.message);🧠 So funktioniert es
Nachricht empfangen → WhatsApp-Webhook empfängt eine Nachricht
Claude-Verarbeitung → Die Nachricht wird mit den verfügbaren Tools an Claude gesendet
Tool-Auswahl → Claude entscheidet, ob Tools benötigt werden
Tool-Ausführung → Der MCP-Server führt die Tools aus (z. B. Witze abrufen)
Antwortgenerierung → Claude erstellt eine Antwort anhand der Tool-Ergebnisse
Nachricht senden → Die Antwort wird über WhatsApp zurückgesendet
🚀 Weitere Tools hinzufügen
Um ein neues Tool hinzuzufügen (z. B. Wetter, Übersetzungen):
1. Tool-Datei erstellen
// src/tools/weather.js
export const weatherTool = {
name: 'get_weather',
description: 'Get current weather for a location',
inputSchema: {
type: 'object',
properties: {
location: { type: 'string', description: 'City name' }
}
}
};
export async function executeWeather(location) {
// Fetch weather data
return { /* weather data */ };
}2. Im MCP-Server registrieren
// src/mcp-server.js
import { weatherTool, executeWeather } from './tools/weather.js';
export class MCPServer {
constructor() {
this.tools = [
jokeGeneratorTool,
weatherTool // Add here
];
}
async processTool(toolName, toolInput) {
switch (toolName) {
case 'get_weather':
return await executeWeather(toolInput.location);
// ...
}
}
}📚 API-Referenz
POST /webhook/whatsapp
Request-Body:
{
"userId": "string (required)",
"message": "string (required)"
}Antwort:
{
"success": boolean,
"userId": "string",
"message": "string"
}POST /webhook/clear-history
Request-Body:
{
"userId": "string (required)"
}Antwort:
{
"success": boolean,
"message": "string"
}🔐 Sicherheitshinweise
API-Schlüssel: Committe die
.env-Datei niemals in die VersionskontrolleRate-Limiting: Ziehe ein Rate-Limiting für die Produktion in Betracht
Eingabevalidierung: Validiere immer die Webhook-Payloads
HTTPS: Verwende in der Produktion HTTPS
Authentifizierung: Füge eine Webhook-Signaturprüfung für die WhatsApp-Integration hinzu
📝 Umgebungsvariablen
Variable | Beschreibung | Beispiel |
| Claude-API-Schlüssel |
|
| Server-Port |
|
| Umgebung |
|
| Joke-API-Endpunkt |
|
🤝 Mitwirken
Forke das Projekt, modifiziere es und trage gerne etwas bei!
📄 Lizenz
MIT-Lizenz – Details findest du in der LICENSE-Datei.
🆘 Fehlerbehebung
„API key not found“
Stelle sicher, dass
.envexistiert undANTHROPIC_API_KEYgesetzt istPrüfe, ob der Schlüssel unter console.anthropic.com gültig ist
„Tool execution failed“
Prüfe, ob die externen APIs erreichbar sind
Überprüfe die Netzwerkverbindung
Sieh dir die Fehlerprotokolle in der Konsolenausgabe an
„No response from Claude“
Prüfe, ob
ANTHROPIC_API_KEYkorrekt istStelle sicher, dass das Claude-Modell verfügbar ist
Prüfe die API-Rate-Limits
📞 Support
Bei Problemen oder Fragen:
Sprich den Abschnitt zur Fehlerbehebung an
Lies dir die Claude-API-Dokumentation durch
Eröffne ein Issue auf GitHub
🎯 Zukünftige Erweiterungen
Unterstützung für Bilder/Medien in WhatsApp-Nachrichten
Weitere Tools (Wetter, Nachrichten, Übersetzungen)
Datenbank für dauerhaften Gesprächsverlauf
Rate-Limiting und Authentifizierung
Admin-Dashboard zur Überwachung
Mehrsprachige Unterstützung
Maßgeschneiderte Claude-Systemprompts pro Benutzer
Mit ❤️ erstellt von yulianheroes-lgtm
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables sending, reading, and deleting WhatsApp messages through Claude Desktop and other MCP clients with granular per-chat permissions. Built on whatsapp-web.js using a headless browser to automate WhatsApp Web.6MIT
- AlicenseAqualityCmaintenanceEnables Claude to interact with WhatsApp through a unified backend API, providing 20 tools for messaging, media, groups, contacts, and chat management.22107MIT
- AlicenseNot gradedqualityBmaintenanceConnects WhatsApp to Claude Code, enabling message reading, audio transcription, image analysis, and message sending with full codebase context.51MIT
- AlicenseNot gradedqualityCmaintenanceA local MCP server that connects WhatsApp to Claude via QR code, enabling chat listing, message retrieval, and sending with automatic rate limiting for anti-ban protection.51MIT
Related MCP Connectors
Drive your real WhatsApp inbox from Claude — send, reply, label, assign, and triage via TimelinesAI.
Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer
Security-first WordPress MCP server. 129 tools for Claude, ChatGPT, Gemini. Free on wp.org.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/yulianheroes-lgtm/whatsapp-claude-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server