Sponsored by Deepsite.site

Pearl MCP Server

Created By
Pearl-com8 months ago
A Model Context Protocol (MCP) server implementation that exposes Pearl's AI and Expert services through a standardized interface
Content

Pearl MCP Server

A Model Context Protocol (MCP) server implementation that exposes Pearl's AI and Expert services through a standardized interface. This server allows MCP clients like Claude Desktop, Cursor, and other MCP-compatible applications to interact with Pearl's advanced AI assistants and human experts.

Features

  • Support for both stdio and SSE transports
  • Integration with Pearl API for AI and expert assistance
  • Session management for continuous conversations
  • Multiple interaction modes:
    • AI-only mode for quick automated responses
    • AI-Expert mode for AI-assisted human expert support
    • Expert mode for direct human expert assistance
  • Conversation history tracking
  • Stateful session management

Prerequisites

  • Python 3.12 or higher
  • Pearl API Key (Contact Pearl to obtain your API key)
  • pip or uv package manager

Installation

  1. Clone the repository:
git clone https://github.com/Pearl-com/pearl_mcp_server.git
cd pearl_mcp_server
  1. Create a virtual environment and activate it:
python -m venv .venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate
  1. Install dependencies:
pip install -e .

Configuration

  1. Create a .env file in the src directory:
PEARL_API_KEY=your-api-key-here

Running the Server

Local Development

Start the server using either stdio (default) or SSE transport:

# Using stdio transport (default)
pearl-mcp-server --api-key your-api-key

# Using SSE transport on custom port
pearl-mcp-server --api-key your-api-key --transport sse --port 8000

Using Remote Server

Pearl provides a hosted MCP server at:

https://mcp.pearl.com/mcp

This can be used directly with any MCP client without installing the Python application locally.

Available Tools

The server provides the following tools:

  1. ask_pearl_ai

    • Quick AI-only responses without human review
    • Best for general inquiries and non-critical situations
    • Parameters:
      • question: The user's query
      • chat_history (optional): Previous conversation context
      • session_id (optional): For continuing conversations
  2. ask_pearl_expert

    • AI-assisted human expert support
    • Best for complex topics requiring expert verification
    • Parameters: Same as ask_pearl_ai
  3. ask_expert

    • Direct human expert assistance
    • Best for complex or sensitive topics
    • Parameters: Same as ask_pearl_ai
  4. get_conversation_status

    • Check the status of an active conversation
    • Parameter: session_id
  5. get_conversation_history

    • Retrieve full conversation history
    • Parameter: session_id

Expert Categories

Pearl's MCP server provides access to a wide range of expert categories. The appropriate expert category is automatically determined by Pearl's API based on the context of your query, ensuring you're connected with the most relevant expert for your needs.

Here are the main categories of expertise available:

  • Medical & Healthcare

    • General Medicine
    • Dental Health
    • Mental Health
    • Nutrition & Diet
    • Fitness & Exercise
    • Veterinary Medicine
  • Legal & Financial

    • Legal Advice
    • Tax Consultation
    • Financial Planning
    • Business Law
    • Employment Law
    • Real Estate Law
  • Technical & Professional

    • Software Development
    • IT Support
    • Computer Repair
    • Electronics
    • Mechanical Engineering
    • Home Improvement
  • Education & Career

    • Academic Tutoring
    • Career Counseling
    • Resume Writing
    • Test Preparation
    • College Admissions
    • Professional Development
  • Lifestyle & Personal

    • Relationship Advice
    • Parenting
    • Pet Care
    • Personal Styling
    • Interior Design
    • Travel Planning

Each expert category can be accessed through the ask_expert or ask_pearl_expert tools. You don't need to specify the category - simply describe your question or problem, and Pearl's AI will automatically route your request to the most appropriate expert type based on the context.

Connecting with MCP Clients

Local Connection (stdio transport)

For connecting to a local MCP server using stdio transport, add the following configuration to your MCP client:

{
    "pearl-mcp-server": {
        "type": "stdio",
        "command": "pearl-mcp-server",
        "args": ["--api-key", "your-api-key"],
        "env": {
            "PEARL_API_KEY": "Your Pearl Api Key"
        }
    }
}

Remote Connection using mcp-remote

Some MCP clients don't support direct connection to remote MCP servers. For these clients, you can use the mcp-remote package as a bridge:

  1. Prerequisites:

    • Node.js 18 or higher
    • npm (Node Package Manager)
  2. Configuration for remote server:

{
    "mcpServers": {
        "pearl-remote": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.pearl.com/sse"
            ]
        }
    }
}
  1. Configuration file locations:

    • Claude Desktop:
      • Windows: %APPDATA%\Claude\claude_desktop_config.json
      • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • Cursor: ~/.cursor/mcp.json
    • Windsurf: ~/.codeium/windsurf/mcp_config.json
  2. Additional Options:

    • Force latest version: Add @latest to npx command
    "args": ["mcp-remote@latest", "https://mcp.pearl.com/sse"]
    
  3. Troubleshooting:

    • Clear stored credentials: rm -rf ~/.mcp-auth
    • View logs:
      • Windows (PowerShell): Get-Content "$env:APPDATA\Claude\Logs\mcp.log" -Wait -Tail 20
      • macOS/Linux: tail -n 20 -F ~/Library/Logs/Claude/mcp*.log
    • Test connection: npx mcp-remote-client https://mcp.pearl.com/sse

Custom Python Client

import asyncio
from mcp.client.session import ClientSession
from mcp.client.stdio import StdioServerParameters, stdio_client

async def main():
    # For stdio transport
    async with stdio_client(
        StdioServerParameters(command="pearl-mcp-server", args=["--api-key", "your-api-key"])
    ) as (read, write):
        async with ClientSession(read, write) as session:
            await session.initialize()
            
            # List available tools
            tools = await session.list_tools()
            print(tools)
            
            # Call Pearl AI
            result = await session.call_tool(
                "ask_pearl_ai", 
                {
                    "question": "What is MCP?",
                    "session_id": "optional-session-id"
                }
            )
            print(result)

asyncio.run(main())

API Key

To obtain a Pearl API key for using this server:

  1. Visit Pearl Contact Page
  2. Request an API key for MCP server integration
  3. Follow the provided instructions to complete the registration process

Keep your API key secure and never commit it to version control.

License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Tavily Mcp
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
ChatWiseThe second fastest AI chatbot™
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
DeepChatYour AI Partner on Desktop
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
WindsurfThe new purpose-built IDE to harness magic
Amap Maps高德地图官方 MCP Server
Serper MCP ServerA Serper MCP Server
Playwright McpPlaywright MCP server
CursorThe AI Code Editor
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
Y GuiA web-based graphical interface for AI chat interactions with support for multiple AI models and MCP (Model Context Protocol) servers.