Customer Support MCP Server
Enables AI assistants like Cursor to manage customer support tickets in SQLite through MCP tools, supporting creation, retrieval, search, and updates via natural language.
README
🎫 Customer Support MCP Server
<div align="center">
🤖 AI-Powered Customer Support MCP Server
Connect Cursor AI to a real SQLite database through Model Context Protocol (MCP).
</div>
🌟 Project Overview
The Customer Support MCP Server is a Python-based MCP server that allows an AI application such as Cursor to interact with a real SQLite database.
Instead of allowing the AI to directly execute SQL queries, the server exposes safe and well-defined business tools for customer support operations.
🎯 Main Goal
Demonstrate how an AI application can use MCP (Model Context Protocol) to:
- 🎫 Create customer support tickets
- 🔍 Retrieve existing tickets
- 🔎 Search tickets
- ✏️ Update ticket information
- 💾 Store ticket data in SQLite
- 🤖 Allow Cursor AI to perform operations using natural language
🏗️ Architecture
👤 USER
│
│ Natural Language
▼
┌───────────────┐
│ Cursor │
│ AI Agent │
└───────┬───────┘
│
│ MCP
▼
┌────────────────────────┐
│ Customer Support MCP │
│ Server │
├────────────────────────┤
│ 🎫 create_ticket │
│ 🔍 get_ticket │
│ 🔎 search_tickets │
│ ✏️ update_ticket │
└────────────┬───────────┘
│
│ SQL
▼
┌─────────────────┐
│ SQLite │
│ support.db │
└─────────────────┘
===================
🚀 Features
Feature Description
🎫 Create Ticket Create a new customer support ticket
🔍 Get Ticket Retrieve a ticket using its ID
🔎 Search Tickets Search using keyword, email, status, or priority
✏️ Update Ticket Update status, priority, or description
💾 SQLite Persistent local database
🤖 Cursor AI client for interacting with MCP
🧪 MCP Inspector Test and debug MCP tools
⚡ uv Fast Python package/environment management
=======================
🧰 Technology Stack
Technology Purpose
🐍 Python 3.12 Application development
🔌 MCP AI ↔ Tool communication
🗄️ SQLite Database
🤖 Cursor AI/MCP client
⚡ uv Python environment & dependency management
🧪 MCP Inspector MCP server testing
=====================
📁 Project Structure
customer_support_mcp/
│
├── 📁 .cursor/
│ └── 📄 mcp.json
│
├── 📁 data/
│ └── 🗄️ support.db
│
├── 📁 .venv/
│
├── 🐍 database.py
├── 🐍 server.py
├── 📄 pyproject.toml
├── 🔒 uv.lock
├── 📄 README.md
└── 📄 .gitignore
==================
🗄️ Database Schema
The SQLite database contains a tickets table.
┌─────────────────────────────────────────┐
│ tickets │
├─────────────────────────────────────────┤
│ id INTEGER PRIMARY KEY │
│ customer_name TEXT │
│ customer_email TEXT │
│ subject TEXT │
│ description TEXT │
│ status TEXT │
│ priority TEXT │
│ created_at TIMESTAMP │
│ updated_at TIMESTAMP │
└─────────────────────────────────────────┘
============
🧪 Test Using MCP Inspector
The MCP Inspector allows you to test the tools before connecting Cursor.
Run:
uv run mcp dev server.py
Open the Inspector URL displayed in the terminal.
You should see:
Customer Support MCP Server
Tools
✓ create_ticket
✓ get_ticket
✓ search_tickets
✓ update_ticket
=======================
🧑💻 Connect MCP Server to Cursor
Create:
.cursor/mcp.json
=======================
🔄 Restart Cursor
After saving .cursor/mcp.json:
Cursor
↓
Restart Cursor
↓
Open customer_support_mcp
↓
Settings
↓
Tools & MCP
-------------
You should see:
🟢 customer-support
Tools:
✓ create_ticket
✓ get_ticket
✓ search_tickets
✓ update_ticket
===============
🤖 Using Cursor AI
Once the MCP server is connected, you can use natural language.
🎫 Create Ticket
Ask Cursor:
Create a ticket for John Smith.
Email:
john@example.com
Issue:
Customer cannot login.
Priority:
high
Cursor can call:
create_ticket()
🔍 Retrieve Ticket
Ask:
Show me ticket number 1.
Cursor can call:
get_ticket(ticket_id=1)
🔎 Search Tickets
Ask:
Find all open urgent tickets.
Cursor can call:
search_tickets(
status="open",
priority="urgent"
)
✏️ Update Ticket
Ask:
Change ticket 1 to resolved.
Cursor can call:
update_ticket(
ticket_id=1,
status="resolved"
)
===================
🔥 Example Workflow
👤 User
│
│ "Create a ticket for John"
▼
🤖 Cursor AI
│
│ MCP Tool Call
▼
🔌 create_ticket()
│
│ SQL INSERT
▼
🗄️ SQLite
│
│ Ticket #1
▼
🔌 MCP Server
│
▼
🤖 Cursor
│
▼
👤 User
==================
📊 Example or Sample database of Tickets Output
After creating tickets, the database might contain:
┌────┬──────────────┬─────────────────────┬──────────────┬──────────┐
│ ID │ Customer │ Subject │ Status │ Priority │
├────┼──────────────┼─────────────────────┼──────────────┼──────────┤
│ 1 │ John Smith │ Unable to login │ open │ high │
│ 2 │ Sarah Jones │ Payment failed │ open │ urgent │
│ 3 │ Mike Brown │ Password reset │ resolved │ medium │
└────┴──────────────┴─────────────────────┴──────────────┴──────────┘
=================
🧠 MCP Concept
The most important concept in this project is:
AI APPLICATION
│
▼
┌───────────┐
│ MCP │
└─────┬─────┘
│
▼
BUSINESS TOOLS
│
┌────────┼────────┐
▼ ▼ ▼
CREATE SEARCH UPDATE
│ │ │
└────────┼────────┘
▼
DATABASE
The AI does not directly manipulate the SQLite database.
---------
Instead:
AI
↓
MCP Tool
↓
Python Function
↓
SQLite
↓
Result
↓
AI
===============
✅ MCP Business Tools
AI
↓
MCP Tool
↓
Validated Python Function
↓
SQLite
===============
🔍 Verify SQLite Database
The database will be created here:
data/support.db
You can verify the database using Python:
sqlite3 "C:\Users\your name\path\folder name\data\support.db"
============
🎓 Learning Outcomes
After completing this project, you will understand:
🔌 MCP
Model Context Protocol
↓
MCP Server
↓
MCP Tools
↓
MCP Client
---
🗄️ Database Integration
Python
↓
sqlite3
↓
SQLite
---
🤖 AI Integration
Cursor AI
↓
MCP
↓
Python Tools
↓
SQLite
---
💼 Business Operations
CREATE
↓
READ
↓
SEARCH
↓
UPDATE
============
🏆 Project Summary
Component Technology
🤖 AI Client Cursor
🔌 Protocol MCP
🐍 Backend Python
🗄️ Database SQLite
⚡ Environment uv
🧪 Testing MCP Inspector
🎫 Business Domain Customer Support
=============
🌟 Final Architecture
╔════════════════════╗
║ CURSOR ║
║ 🤖 AI AGENT ║
╚═════════╤══════════╝
│
│ MCP
▼
╔══════════════════════╗
║ CUSTOMER SUPPORT MCP ║
║ SERVER ║
╠══════════════════════╣
║ 🎫 create_ticket ║
║ 🔍 get_ticket ║
║ 🔎 search_tickets ║
║ ✏️ update_ticket ║
╚══════════╤═══════════╝
│
│ SQL
▼
╔══════════════════════╗
║ SQLite ║
║ support.db ║
╚══════════════════════╝
==============
🚀 Complete Command Flow
# 1. Go to project
cd C:\Users\path
# 2. Create environment
uv venv --python 3.12
# 3. Activate environment
.venv\Scripts\Activate.ps1
# 4. Install MCP
uv add "mcp[cli]"
# 5. Verify SQLite
uv run python -c "import sqlite3; print('SQLite OK')"
# 6. Verify MCP
uv run python -c "from mcp.server.fastmcp import FastMCP; print('MCP OK')"
# 7. Run MCP Inspector
uv run mcp dev server.py
# 8. Run MCP server directly
uv run python server.py
==============
❤️ Final Message
<div align="center">
🎫 Customer Support MCP Server
Python 🐍 + MCP 🔌 + SQLite 🗄️ + Cursor 🤖
AI + MCP + Database = Intelligent Business Operations
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。