Logo SCP Local MCP Server

SCP Local MCP Server

Tổ chức
shopper-context-protocol

MCP wrapper for scp

Nhà phát hànhshopper-context-protocol
Kho mãscp-mcp-wrapper
Ngôn ngữTypeScript
Bản fork
2
Sao
1
Công cụ có sẵn
0
Phương thức truyền tảistdio
Danh mục
Giấy phépMIT
Liên kết
  • Kết nối công cụ với quy trình làm việc AI

    SCP Local MCP Server cung cấp các khả năng MCP mà ứng dụng khách và tác nhân AI tương thích có thể sử dụng.

  • 0 công cụ có sẵn

    Xem các thao tác có thể gọi bên dưới, kèm tên và mô tả nếu máy chủ cung cấp.

  • Cấu hình sẵn để sao chép

    Dùng các đoạn cấu hình cài đặt mẫu để thiết lập máy chủ này trong ứng dụng khách MCP bạn muốn dùng.

  • Chỉ số quan tâm đến mã nguồn mở

    1 sao và 2 bản fork từ kho mã được liên kết.

SCP Local MCP Server

A Model Context Protocol (MCP) server that provides AI assistants like Claude with secure access to customer data through the Shopper Context Protocol (SCP).

What is this?

This MCP server acts as a bridge between AI assistants and e-commerce systems that implement the SCP protocol. It enables Claude Desktop and other MCP clients to:

  • 🔐 Securely authorize access to customer accounts using OAuth 2.0 with PKCE
  • 📦 Retrieve order history, loyalty points, active offers, and shopping preferences
  • 🔍 Discover SCP endpoints for merchants via DNS or well-known URIs
  • 🔒 Store and manage encrypted authentication tokens locally

All customer data requests are authenticated and authorized by the merchant's SCP server, ensuring privacy and security.

Quick Start with npx

The easiest way to use this server is with npx - no installation required!

With Claude Desktop

Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json):

json
{
  "mcpServers": {
    "scp": {
      "command": "npx",
      "args": ["-y", "@shoppercontextprotocol/local-mcp-server"]
    }
  }
}

On Windows, the config file is located at: %APPDATA%\Claude\claude_desktop_config.json

Testing with a Local Development Server

If you're developing an SCP server locally, you can configure the MCP server to point to your test endpoint:

json
{
  "mcpServers": {
    "scp": {
      "command": "npx",
      "args": ["-y", "@shoppercontextprotocol/local-mcp-server"],
      "env": {
        "SCP_TEST_ENDPOINT": "http://localhost:8787/v1"
      }
    }
  }
}

This bypasses DNS discovery and directs all requests to your local test server.

Installation (Alternative)

For development or if you prefer a local installation:

bash
# Install globally
npm install -g @shoppercontextprotocol/local-mcp-server

# Or install locally for development
git clone <repository>
cd local_mcp
npm install
npm run build

Usage

With Claude Desktop (Local Installation)

json
{
  "mcpServers": {
    "scp": {
      "command": "scp-mcp-server"
    }
  }
}

Or with a local build:

json
{
  "mcpServers": {
    "scp": {
      "command": "node",
      "args": ["/absolute/path/to/local_mcp/dist/index.js"]
    }
  }
}

Direct Usage

bash
# If installed globally
scp-mcp-server

# Or with local build
npm start

Development

bash
npm run dev    # Watch mode
npm run build  # Production build
npm test       # Run tests

Configuration

The server stores configuration in ~/.scp/config.json. It will be created automatically on first run with these defaults:

json
{
  "dns_resolver": "1.1.1.1",
  "dns_cache_ttl": 86400,
  "poll_interval": 2,
  "max_poll_attempts": 150,
  "token_refresh_threshold": 300,
  "request_timeout": 30000,
  "demo_mode": true,
  "demo_endpoint": "http://localhost:8787/v1"
}

Configuration Options

  • dns_resolver: DNS server to use for SCP endpoint discovery (default: Cloudflare's 1.1.1.1)
  • dns_cache_ttl: How long to cache discovered endpoints in seconds (default: 24 hours)
  • poll_interval: Seconds between polling attempts during OAuth flow (default: 2)
  • max_poll_attempts: Maximum number of polling attempts (default: 150 / 5 minutes)
  • token_refresh_threshold: Seconds before expiry to refresh tokens (default: 300 / 5 minutes)
  • request_timeout: HTTP request timeout in milliseconds (default: 30000 / 30 seconds)
  • demo_mode: Enable demo mode (default: true)
  • demo_endpoint: Endpoint to use in demo mode (default: http://localhost:8787/v1)

Testing with a Development Server

There are multiple ways to point the MCP server to your test SCP server:

Option 1: Environment Variable (Recommended for npx)

Set SCP_TEST_ENDPOINT when running the server:

bash
# Direct usage
SCP_TEST_ENDPOINT=http://localhost:8787/v1 scp-mcp-server

# With npx
SCP_TEST_ENDPOINT=http://localhost:8787/v1 npx @shoppercontextprotocol/local-mcp-server

# In Claude Desktop config (see Quick Start section above)

Option 2: Demo Mode Configuration

Edit ~/.scp/config.json:

json
{
  "demo_mode": true,
  "demo_endpoint": "http://localhost:8787/v1"
}

By default, demo mode is enabled and directs all SCP requests to the demo endpoint. This is useful for local testing without needing DNS records.

Option 3: Production Mode

To use real DNS-based discovery for production merchants:

json
{
  "demo_mode": false
}

Priority Order:

  1. SCP_TEST_ENDPOINT environment variable (highest priority)
  2. Demo mode configuration
  3. DNS-based discovery (lowest priority)

Data Storage

  • Tokens: ~/.scp/tokens.db (SQLite, encrypted)
  • Config: ~/.scp/config.json

MCP Tools

  • scp_authorize - Authorize access to a merchant
  • scp_check_authorization - Check authorization status
  • scp_revoke_authorization - Revoke access to a merchant
  • scp_discover - Discover SCP endpoint for a domain

MCP Resources

  • scp://{domain}/orders - Order history
  • scp://{domain}/loyalty - Loyalty status
  • scp://{domain}/offers - Active offers
  • scp://{domain}/preferences - Customer preferences
  • scp://{domain}/intents - Shopping intents

How to Use in Claude Desktop

After adding the MCP server to your Claude Desktop config and restarting Claude, you can interact with SCP-enabled merchants:

First Time: Authorize Access

Can you help me authorize access to my Boot Barn account? 
My email is customer@example.com

Claude will use the scp_authorize tool to:

  1. Discover the SCP endpoint for bootbarn.com
  2. Initiate OAuth authorization with a magic link
  3. The magic link will be sent to your email
  4. Poll for authorization completion
  5. Store encrypted tokens locally

Access Your Data

Once authorized, you can ask Claude to retrieve your data:

What are my recent Boot Barn orders?
How many loyalty points do I have at Boot Barn?
Do I have any active offers or coupons?

Claude will automatically:

  • Use the stored authorization tokens
  • Refresh tokens if they're about to expire
  • Fetch data from the merchant's SCP server
  • Present the information in a helpful format

Check Authorization Status

Am I authorized with Boot Barn?

Revoke Access

Revoke my Boot Barn authorization

Example Workflow

Here's a complete example of using SCP in Claude Desktop:

You: "Help me authorize with acmestore.com using customer@example.com"

Claude: Initiates OAuth flow, sends magic link to email

You: Clicks magic link in email

Claude: Completes authorization and confirms success

You: "What orders have I placed?"

Claude: Retrieves and displays order history

You: "Do I have any active coupons?"

Claude: Shows available offers and promotions

How It Works: Initialization Instructions

The SCP MCP Server provides built-in instructions to Claude during the initialization phase, ensuring it knows how to properly use the SCP tools without any additional prompting.

Automatic Guidance

When Claude Desktop connects to the SCP server, it automatically receives instructions that tell it to:

  1. Always check authorization first - Before accessing any customer data, Claude will check if you're authorized with the merchant
  2. Ask for your email - If not authorized, Claude will ask for your email address to start the OAuth flow
  3. Request all necessary scopes - Claude requests comprehensive permissions upfront: orders, loyalty, preferences, intent:read, intent:create
  4. Explain the magic link process - Claude tells you to check your email for the authorization link
  5. Handle errors gracefully - If something goes wrong, Claude knows how to guide you through fixing it

Why This Matters

This automatic initialization means:

  • ✅ No manual configuration needed - Claude knows how to use SCP tools immediately
  • ✅ Consistent behavior - Every conversation follows the same authorization workflow
  • ✅ Better user experience - Claude proactively handles authorization before trying to access data
  • ✅ Fewer errors - Reduces "Not authorized" errors by checking authorization first

The Initialization Flow

1. Claude Desktop starts and reads claude_desktop_config.json
2. Spawns the SCP MCP server (node dist/index.js or npx)
3. Sends initialize request to the server
4. Server responds with:
   - Server info (name, version)
   - Instructions for the LLM
   - Capabilities (tools, resources)
5. Claude reads the instructions and knows:
   ✓ Check authorization first
   ✓ Ask for email when needed
   ✓ Request all scopes upfront
   ✓ Create intents when users express shopping goals
6. Server is ready, Claude is ready with full context
7. User asks: "Show me my orders"
8. Claude follows the instructions:
   - Checks authorization
   - Asks for email if needed
   - Initiates OAuth flow
   - Retrieves and displays orders

Example Instructions Provided

During initialization, Claude receives these instructions:

IMPORTANT WORKFLOW:

1. AUTHORIZATION REQUIRED FIRST
   Before accessing ANY customer data, you MUST authorize with the merchant domain.
   
   Check authorization:
   - scp_check_authorization(domain="acmestore.com")
   
   If not authorized:
   - Ask user: "What email do you use with [Merchant]?"
   - Call: scp_authorize(domain="...", email="...", scopes=[...])
   - Tell user: "Please check your email for a magic link"

2. ACCESSING DATA
   Once authorized, use these tools:
   - scp_get_orders(domain="...") - Order history
   - scp_get_loyalty(domain="...") - Loyalty status
   - scp_get_preferences(domain="...") - Saved preferences
   - scp_get_intents(domain="...") - Shopping intents

3. CREATING INTENTS
   When user expresses a shopping goal, create an intent:
   - scp_create_intent(domain="...", base_intent="...", context={...})

REMEMBER:
✅ ALWAYS check authorization before accessing data
✅ Request comprehensive scopes upfront
✅ Create intents when users express shopping goals
❌ NEVER access data without authorization first

This ensures every interaction with the SCP server follows best practices and provides a smooth, secure experience for users.

Cài đặt

TypingMind
Yêu cầu:

Node.js 18+

{
  "mcpServers": {
    "scp": {
      "command": "npx",
      "args": [
        "-y",
        "@shoppercontextprotocol/local-mcp-server"
      ]
    }
  }
}

Dùng MCP SCP Local MCP Server với nhiều mô hình AI

TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên sau khi kết nối SCP Local MCP Server, bạn có thể dùng với nhiều mô hình AI khác nhau trong TypingMind thay vì phải thiết lập riêng cho từng mô hình. MCP này chạy cục bộ thông qua trình kết nối MCP của TypingMind trên thiết bị của bạn.

Hướng dẫn thiết lập để dùng trình kết nối cục bộ

Dùng cách này khi máy chủ MCP cần truy cập các tệp, ứng dụng hoặc tài nguyên riêng tư trên máy tính của bạn.

1

Mở cài đặt MCP

Trong TypingMind, vào Cài đặt, Cài đặt nâng cao, rồi đến Giao thức ngữ cảnh mô hình và chọn Cài trình kết nối.

  1. Mở TypingMind trong trình duyệt của bạn.
  2. Nhấp vào biểu tượng Cài đặt.
  3. Vào Cài đặt nâng cao.
  4. Mở mục Giao thức ngữ cảnh mô hình.
  5. Nhấp vào Cài trình kết nối rồi chọn Thiết bị này.
Màn hình thiết lập trình kết nối MCP của TypingMind với tùy chọn Thiết bị này được chọn
2

Chạy lệnh trình kết nối

Chọn Thiết bị này, sao chép lệnh từ TypingMind và chạy trong Terminal. Giữ tiến trình chạy trong khi bạn dùng MCP.

  1. Sao chép lệnh thiết lập hiển thị trong TypingMind.
  2. Mở Terminal trên macOS hoặc Windows Terminal trên Windows.
  3. Dán và chạy lệnh.
  4. Xác nhận cài đặt gói nếu Terminal hỏi bạn có muốn tiếp tục không.
  5. Giữ tiến trình trong cửa sổ Terminal chạy trong khi dùng các công cụ MCP.
3

Thêm SCP Local MCP Server làm máy chủ

Khi trạng thái trình kết nối là Sẵn sàng, nhấp vào Sửa máy chủ và dán cấu hình máy chủ MCP.

  1. Đợi đến khi trạng thái trình kết nối hiển thị Sẵn sàng.
  2. Nhấp vào Sửa máy chủ.
  3. Dán cấu hình máy chủ MCP của SCP Local MCP Server.
  4. Lưu danh sách máy chủ.
  5. Làm mới nếu bạn muốn xác nhận trình kết nối vẫn sẵn sàng.
Cài đặt MCP của TypingMind hiển thị máy chủ đang hoạt động và nút Sửa máy chủ
{
  "mcpServers": {
    "scp-local-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@shoppercontextprotocol/local-mcp-server"
      ]
    }
  }
}
4

Dùng kết nối với nhiều mô hình

Lưu danh sách máy chủ, mở Plugin, bật các công cụ MCP của SCP Local MCP Server, sau đó chọn bất kỳ mô hình AI nào được hỗ trợ trong TypingMind và dùng các công cụ trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.

  1. Mở trang Plugin trong TypingMind.
  2. Bật các công cụ MCP của SCP Local MCP Server.
  3. Bắt đầu cuộc trò chuyện và chọn mô hình AI bạn muốn dùng.
  4. Dùng các công cụ MCP trong cuộc trò chuyện hoặc gán chúng cho một tác nhân AI.
  5. Chuyển sang mô hình AI khác bất cứ khi nào cần mà không phải kết nối lại MCP.
Cuộc trò chuyện TypingMind dùng các công cụ MCP đã bật với một mô hình AI được chọn
Bạn có thể dùng SCP Local MCP Server giúp tôi làm việc này không?
SCP Local MCP Server
Được. Tôi đã đọc.
Đây là kết quả tôi tìm được bằng SCP Local MCP Server.

Câu hỏi thường gặp

Máy chủ MCP SCP Local MCP Server dùng để làm gì?

SCP Local MCP Server là máy chủ MCP cho phép các ứng dụng AI tương thích kết nối với công cụ và ngữ cảnh bên ngoài. Trong TypingMind, bạn chỉ cần thêm máy chủ MCP này một lần để các công cụ của nó có sẵn trong không gian làm việc AI của bạn.

Bạn có thể dùng MCP SCP Local MCP Server với nhiều mô hình AI trong TypingMind không?

Có. TypingMind kết nối các công cụ MCP ở cấp không gian làm việc, nên bạn có thể dùng SCP Local MCP Server với nhiều mô hình AI như Claude, ChatGPT, Gemini hoặc các mô hình khác đã cấu hình trong TypingMind mà không cần thiết lập máy chủ MCP riêng cho từng mô hình.

Vì sao nên dùng MCP SCP Local MCP Server với TypingMind?

TypingMind là một trong những giao diện trò chuyện với LLM tốt nhất vì tập hợp nhiều mô hình AI, prompt, plugin, tác nhân AI, khóa API và công cụ MCP vào một không gian làm việc. Khi kết nối SCP Local MCP Server, bạn có thể dùng các công cụ MCP của dịch vụ này với những mô hình ưa thích, đồng thời giữ quy trình trò chuyện gọn gàng trong TypingMind.

Làm cách nào để kết nối MCP SCP Local MCP Server với TypingMind?

SCP Local MCP Server hoạt động thông qua trình kết nối MCP cục bộ của TypingMind. Đây là lựa chọn phù hợp nhất khi máy chủ MCP cần truy cập tệp cục bộ, ứng dụng máy tính, công cụ dòng lệnh hoặc tài nguyên riêng trên máy tính của bạn.

MCP SCP Local MCP Server cung cấp những công cụ nào trong TypingMind?

SCP Local MCP Server cung cấp các chức năng MCP mà bạn có thể bật từ trang Plugin của TypingMind để dùng trong trò chuyện hoặc gán cho tác nhân AI.

Bạn có cần chia sẻ khóa API với TypingMind để dùng MCP SCP Local MCP Server không?

Không. TypingMind ưu tiên xử lý cục bộ và cho phép bạn kiểm soát nhà cung cấp mô hình, khóa API, prompt và cấu hình MCP. Nếu SCP Local MCP Server yêu cầu xác thực, hãy thêm các header, cài đặt OAuth hoặc cấu hình cục bộ cần thiết cho máy chủ MCP đó khi tạo kết nối.

Máy chủ MCP liên quan

Xem tất cả

Tạo ngay không gian làm việc AI riêng

Đăng ký bản tin của chúng tôi để nhận thông báo về tính năng mới và các đợt tặng quà sắp tới 👇