Skip to main content
Glama
ChiragPatankar

AI Customer Support Bot - MCP Server

AIカスタマーサポートボット - MCPサーバー

Cursor AI と Glama.ai の統合を使用して AI を活用した顧客サポートを提供する Model Context Protocol (MCP) サーバー。

特徴

  • Glama.aiからのリアルタイムコンテキスト取得

  • Cursor AI による AI を活用した応答生成

  • バッチ処理のサポート

  • 優先キューイング

  • レート制限

  • ユーザーインタラクションの追跡

  • 健康モニタリング

  • MCPプロトコル準拠

Related MCP server: MCP Boilerplate

前提条件

  • Python 3.8以上

  • PostgreSQLデータベース

  • Glama.ai APIキー

  • カーソルAI APIキー

インストール

  1. リポジトリをクローンします。

git clone <repository-url>
cd <repository-name>
  1. 仮想環境を作成してアクティブ化します。

python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
  1. 依存関係をインストールします:

pip install -r requirements.txt
  1. .env.exampleに基づいて.envファイルを作成します。

cp .env.example .env
  1. 資格情報を使用して.envファイルを構成します。

# API Keys
GLAMA_API_KEY=your_glama_api_key_here
CURSOR_API_KEY=your_cursor_api_key_here

# Database
DATABASE_URL=postgresql://user:password@localhost/customer_support_bot

# API URLs
GLAMA_API_URL=https://api.glama.ai/v1

# Security
SECRET_KEY=your_secret_key_here

# MCP Server Configuration
SERVER_NAME="AI Customer Support Bot"
SERVER_VERSION="1.0.0"
API_PREFIX="/mcp"
MAX_CONTEXT_RESULTS=5

# Rate Limiting
RATE_LIMIT_REQUESTS=100
RATE_LIMIT_PERIOD=60

# Logging
LOG_LEVEL=INFO
  1. データベースを設定します。

# Create the database
createdb customer_support_bot

# Run migrations (if using Alembic)
alembic upgrade head

サーバーの実行

サーバーを起動します。

python app.py

サーバーはhttp://localhost:8000で利用可能になります。

APIエンドポイント

1. ルートエンドポイント

GET /

基本的なサーバー情報を返します。

2. MCPバージョン

GET /mcp/version

サポートされている MCP プロトコル バージョンを返します。

3. 機能

GET /mcp/capabilities

サーバーの機能とサポートされている機能を返します。

4. プロセスリクエスト

POST /mcp/process

コンテキストを使用して単一のクエリを処理します。

リクエストの例:

curl -X POST http://localhost:8000/mcp/process \
  -H "Content-Type: application/json" \
  -H "X-MCP-Auth: your-auth-token" \
  -H "X-MCP-Version: 1.0" \
  -d '{
    "query": "How do I reset my password?",
    "priority": "high",
    "mcp_version": "1.0"
  }'

5. バッチ処理

POST /mcp/batch

1 回のリクエストで複数のクエリを処理します。

リクエストの例:

curl -X POST http://localhost:8000/mcp/batch \
  -H "Content-Type: application/json" \
  -H "X-MCP-Auth: your-auth-token" \
  -H "X-MCP-Version: 1.0" \
  -d '{
    "queries": [
      "How do I reset my password?",
      "What are your business hours?",
      "How do I contact support?"
    ],
    "mcp_version": "1.0"
  }'

6. 健康チェック

GET /mcp/health

サーバーの健全性とサービスの状態を確認します。

レート制限

サーバーは、次のデフォルトでレート制限を実装します。

  • 60秒あたり100リクエスト

  • レート制限情報はヘルスチェックエンドポイントに含まれています

  • レート制限超過応答にはリセット時間が含まれます

エラー処理

サーバーは次の形式で構造化されたエラー応答を返します。

{
  "code": "ERROR_CODE",
  "message": "Error description",
  "details": {
    "timestamp": "2024-02-14T12:00:00Z",
    "additional_info": "value"
  }
}

一般的なエラーコード:

  • RATE_LIMIT_EXCEEDED : レート制限を超えました

  • UNSUPPORTED_MCP_VERSION : サポートされていないMCPバージョン

  • PROCESSING_ERROR : リクエスト処理エラー

  • CONTEXT_FETCH_ERROR : Glama.ai からコンテキストを取得中にエラーが発生しました

  • BATCH_PROCESSING_ERROR : バッチリクエストの処理中にエラーが発生しました

発達

プロジェクト構造

.
├── app.py              # Main application file
├── database.py         # Database configuration
├── middleware.py       # Middleware (rate limiting, validation)
├── models.py          # Database models
├── mcp_config.py      # MCP-specific configuration
├── requirements.txt   # Python dependencies
└── .env              # Environment variables

新機能の追加

  1. 新しい設定オプションでmcp_config.pyを更新します

  2. 必要に応じてmodels.pyに新しいモデルを追加します。

  3. app.pyに新しいエンドポイントを作成する

  4. 新しい機能を反映するために機能エンドポイントを更新します

安全

  • すべてのMCPエンドポイントはX-MCP-Authヘッダーによる認証を必要とする

  • 不正使用を防ぐためにレート制限が実装されています

  • データベースの資格情報は安全に保管する必要がある

  • APIキーはバージョン管理にコミットしてはならない

監視

サーバーは監視用のヘルスチェック エンドポイントを提供します。

  • サービスステータス

  • レート制限の使用

  • コネクテッドサービス

  • 処理時間

貢献

  1. リポジトリをフォークする

  2. 機能ブランチを作成する

  3. 変更をコミットする

  4. ブランチにプッシュする

  5. プルリクエストを作成する

認証バッジ

ライセンス

このプロジェクトは MIT ライセンスに基づいてライセンスされています - 詳細についてはLICENSEファイルを参照してください。

サポート

サポートについては、リポジトリに問題を作成するか、開発チームにお問い合わせください。

A
license - permissive license
-
quality - not tested
D
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

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

View all related MCP servers

Related MCP Connectors

  • A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…

  • A Model Context Protocol server for Wix AI tools

  • MCP (Model Context Protocol) server for Appwrite

View all MCP Connectors

Latest Blog Posts

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/ChiragPatankar/AI-Customer-Support-Bot--MCP-Server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server