extension
MCP
MCP18 Feb 20267 min phút đọc

MCP Templates: Cầu nối giữa AI và thế giới thực

IS

ISC Team

ISC Vibe Marketplace

Hãy tưởng tượng Claude Code có thể trực tiếp query database production, tạo GitHub issues, đọc Slack messages, hay control trình duyệt — tất cả trong một conversation. Đây không phải tương lai — đây là MCP (Model Context Protocol) ngay hôm nay.

Vấn Đề Trước MCP

Trước khi có MCP, mỗi AI platform cần custom integration với mỗi service:

Claude  ←→ Custom GitHub adapter
Claude  ←→ Custom Slack adapter
Claude  ←→ Custom Postgres adapter
ChatGPT ←→ Custom GitHub adapter (khác!)
ChatGPT ←→ Custom Slack adapter (khác nữa!)
...

Kết quả: N×M integrations. Tốn kém, không nhất quán, khó maintain.

MCP Giải Quyết Vấn Đề Thế Nào

MCP tạo ra một protocol chuẩn. Mỗi service chỉ cần build một MCP server, mọi AI client đều dùng được:

GitHub MCP Server ←→ Claude Code
                  ←→ Cursor
                  ←→ VS Code Copilot
                  ←→ Bất kỳ MCP client nào

Ba Primitives Cốt Lõi Của MCP

1. Tools — Actions

AI có thể thực hiện qua MCP server:

# GitHub MCP cung cấp:
list_prs()                    → Lấy danh sách pull requests
create_issue(title, body)     → Tạo GitHub issue
review_pr(pr_id, comments)    → Comment vào PR
merge_pr(pr_id)               → Merge pull request

2. Resources — Data

Data AI có thể đọc và reference:

# Database MCP cung cấp:
database://schema/users       → Schema của bảng users
database://schema/orders      → Schema của bảng orders
database://query/recent       → 100 records gần nhất

3. Prompts — Commands

Pre-defined prompts trở thành slash commands:

/mcp__github__list_prs    → List all open PRs
/mcp__github__pr_review   → Review a specific PR

Cài Đặt MCP Servers

Option 1: Remote HTTP Server

# Thêm Stripe MCP
claude mcp add --transport http stripe https://mcp.stripe.com/anthropic

# Thêm GitHub MCP
claude mcp add --transport http github https://api.githubcopilot.com/mcp/

Option 2: Local Stdio Server

# Filesystem access
claude mcp add --transport stdio filesystem -- \
  npx -y @modelcontextprotocol/server-filesystem ~/Desktop

# Postgres
claude mcp add --transport stdio postgres -- \
  npx -y @bytebase/postgres-mcp \
  --dsn "postgresql://user:pass@db.example.com/prod"

Option 3: Với Authentication

claude mcp add --transport http slack \
  --header "Authorization: Bearer $SLACK_BOT_TOKEN" \
  https://mcp.slack.com/anthropic

MCP Servers Phổ Biến Nhất 2026

ServerMục đíchVí dụ usage
GitHubPR reviews, issues, repo queries"Review PR này và suggest improvements"
SlackSend messages, read channels"Post update vào #engineering"
PostgresQuery database, manage schemas"Find users chưa login 90 ngày"
FilesystemRead/write local files"Organize tất cả PDFs trong Downloads"
Brave SearchWeb search real-time"Tìm React benchmarks 2026"
PuppeteerBrowser automation"Screenshot checkout page"
StripePayment queries"List failed payments hôm nay"

Workflow Thực Tế: Multi-Server

Sức mạnh thực sự của MCP là khi kết hợp nhiều servers:

User: "Implement user dashboard với activity metrics"
      ↓
Claude Code:
  1. GitHub MCP → Xem existing issues liên quan
  2. Postgres MCP → Query user_activity schema
  3. Filesystem MCP → Tạo React component
  4. GitHub MCP → Tạo PR với changes
  5. Slack MCP → Thông báo team khi PR ready
      ↓
Kết quả: Feature complete, PR created,
         team notified — không cần context switching

Scope Hierarchy

Local scope   → Chỉ project này, chỉ bạn (override cao nhất)
Project scope → Shared qua .mcp.json (cho cả team)
User scope    → Tất cả projects của bạn
# Share với team qua .mcp.json
claude mcp add --scope project --transport http \
  github https://api.githubcopilot.com/mcp/

Security Best Practices

security

Chỉ install MCP servers từ nguồn đáng tin cậy. Kiểm tra GitHub repo, số stars, và source code trước khi grant access vào hệ thống của bạn.

  • Limit permissions: Filesystem MCP chỉ grant access thư mục cần thiết, không grant /Users
  • Use environment variables: Không hardcode API keys trong config
  • Readonly where possible: Database MCP nên dùng readonly credentials
  • Monitor output size: MCP responses có thể rất lớn, set giới hạn

Kết Luận

MCP đang dần trở thành standard cho AI-tool integration, tương tự như REST API đã làm với web services. Năm 2026, một developer không biết cách setup và dùng MCP sẽ bị disadvantaged đáng kể so với những người đã master nó. Bắt đầu với GitHub MCP và Filesystem MCP — hai servers này alone đã thay đổi hoàn toàn workflow của bạn.