Skip to main content

🤖 What is the MCP Server?

The ClosedLoop MCP Server is a Model Context Protocol (MCP) server that provides AI clients with secure access to customer insight data. It enables AI agents and tools to interact with ClosedLoop AI’s customer insights through a standardized protocol.

🎯 Key Features

MCP Protocol Support

  • Full Model Context Protocol implementation
  • Compatible with Claude, Cursor, and other MCP clients
  • Standardized tool interface for AI agents

Customer Insight Tools

  • list_insights - Retrieve insights with filtering and pagination
  • get_insight_detail - Get detailed analysis of specific insights
  • search_insights - Full-text search across all insight fields
  • Rich metadata and AI analysis results

🔧 Technical Specifications

Server Details

  • URL: https://mcp.closedloop.sh
  • Protocol: Model Context Protocol (MCP)
  • Authentication: Bearer token (API key)
  • Data Format: JSON responses

Dependencies

  • Node.js 18+
  • PostgreSQL database
  • MCP SDK (@modelcontextprotocol/sdk)
  • Express.js for HTTP endpoints

🚀 Quick Start

1. Get Your API Key

# API keys are managed through the ClosedLoop web interface
# Visit: https://app.closedloop.sh/api-keys

2. Connect Your AI Client

{
  "mcpServers": {
    "closedloop": {
      "command": "npx",
      "args": ["@closedloop-ai/mcp-client"],
      "env": {
        "CLOSEDLOOP_API_KEY": "your-api-key-here"
      }
    }
  }
}

3. Use the Tools

{
  "name": "list_insights",
  "arguments": {
    "limit": 10,
    "date_from": "2024-01-01"
  }
}

📊 Available Tools

list_insights

Retrieve customer insights with optional filtering and pagination. Parameters:
  • date_from (optional): Start date (YYYY-MM-DD)
  • date_to (optional): End date (YYYY-MM-DD)
  • page (optional): Page number (default: 1)
  • limit (optional): Items per page (default: 20, max: 100)

get_insight_detail

Get detailed information about a specific insight item. Parameters:
  • insight_id (required): UUID of the insight item

search_insights

Advanced full-text search across customer insights with relevance ranking. Key Features:
  • Full-text search across 8+ insight fields
  • Relevance ranking - most relevant results first
  • Phrase search and fuzzy matching
  • Field-specific search - search specific fields or all fields
  • Advanced filtering - category, severity, date range, source
  • Language agnostic - works with any language
Parameters:
  • query (required): Search query text
  • fields (optional): Specific fields to search
  • category (optional): Filter by insight category
  • severity (optional): Filter by severity level
  • date_from (optional): Start date filter
  • date_to (optional): End date filter
  • source (optional): Filter by data source
  • page (optional): Page number (default: 1)
  • limit (optional): Items per page (default: 20, max: 100)

🎯 Use Cases

AI-Powered Analysis

  • Claude can analyze customer insight patterns
  • Cursor can provide insights during development
  • Custom AI agents can process insight data

Development Integration

  • Access insight data in your development environment
  • Get customer insights while coding
  • Integrate insights into your workflow

Automated Reporting

  • Generate insight summaries
  • Track sentiment trends
  • Monitor customer satisfaction

🔗 Integration Examples

Claude Desktop

{
  "mcpServers": {
    "closedloop": {
      "command": "npx",
      "args": ["@closedloop-ai/mcp-client"],
      "env": {
        "CLOSEDLOOP_API_KEY": "your-api-key"
      }
    }
  }
}

Cursor IDE

{
  "mcpServers": {
    "closedloop": {
      "command": "npx", 
      "args": ["@closedloop-ai/mcp-client"],
      "env": {
        "CLOSEDLOOP_API_KEY": "your-api-key"
      }
    }
  }
}

🛠️ Development

Local Setup

# Clone the repository
git clone https://github.com/closed-loop-ai/mcp-server

# Install dependencies
npm install

# Set environment variables
cp env.example .env

# Start development server
npm run dev

Testing

# Run tests
npm test

# Test MCP connection
npm run test:mcp

📞 Support

Documentation

Contact

Get Started with MCP Tools

Learn about the available MCP tools and how to use them