Skip to main content

MCP Server

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

What is MCP?

The Model Context Protocol (MCP) is a standardized way for AI clients to connect to external data sources and tools. It enables:
  • Seamless integration with AI agents like Claude, Cursor, and custom tools
  • Standardized interface for accessing customer insights
  • Secure authentication and data access
  • Real-time data synchronization

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
  • Rich metadata and AI analysis results

Quick Start

1. Get Your API Key

API keys are managed through the ClosedLoop web interface:

2. Connect Your AI Client

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

3. Use the Tools

Once connected, you can use the available MCP 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)
Response:
  • Array of insight objects with metadata
  • Pagination information
  • Total count and page details

get_insight_detail

Get detailed information about a specific insight item. Parameters:
  • insight_id (required): UUID of the insight item
Response:
  • Complete insight details
  • Customer context and quotes
  • AI analysis and recommendations
  • Related insights and patterns

Integration Examples

Claude Desktop

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

Cursor IDE

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

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

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

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

Security

Data Protection

  • End-to-end encryption for all data transmission
  • API key authentication with secure token management
  • Rate limiting to prevent abuse
  • Data isolation between customers

Access Control

  • Team-based permissions for insight access
  • Role-based access for different user types
  • Audit trails for all data access
  • Secure token refresh for long-term connections

Support

Documentation

  • Tool Reference - Complete tool documentation
  • Integration Guide - Setup and configuration
  • API Reference - REST API documentation

Contact

Get Started with MCP

Learn more about the MCP Server and available tools

MCP Tools Reference

Complete reference for all available MCP tools