Pearl
Pearl
README
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
- Clone the repository:
git clone https://github.com/Pearl-com/pearl_mcp_server.git
cd pearl_mcp_server
- Create a virtual environment and activate it:
python -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
- Install dependencies:
pip install -e .
Configuration
- Create a
.envfile 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:
-
ask_pearl_ai- Quick AI-only responses without human review
- Best for general inquiries and non-critical situations
- Parameters:
question: The user's querychat_history(optional): Previous conversation contextsession_id(optional): For continuing conversations
-
ask_pearl_expert- AI-assisted human expert support
- Best for complex topics requiring expert verification
- Parameters: Same as ask_pearl_ai
-
ask_expert- Direct human expert assistance
- Best for complex or sensitive topics
- Parameters: Same as ask_pearl_ai
-
get_conversation_status- Check the status of an active conversation
- Parameter:
session_id
-
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:
-
Prerequisites:
- Node.js 18 or higher
- npm (Node Package Manager)
-
Configuration for remote server:
{
"mcpServers": {
"pearl-remote": {
"command": "npx",
"args": [
"mcp-remote",
"https://mcp.pearl.com/sse"
]
}
}
}
-
Configuration file locations:
- Claude Desktop:
- Windows:
%APPDATA%\Claude\claude_desktop_config.json - macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
- Windows:
- Cursor:
~/.cursor/mcp.json - Windsurf:
~/.codeium/windsurf/mcp_config.json
- Claude Desktop:
-
Additional Options:
- Force latest version: Add
@latestto npx command
"args": ["mcp-remote@latest", "https://mcp.pearl.com/sse"] - Force latest version: Add
-
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
- Windows (PowerShell):
- Test connection:
npx mcp-remote-client https://mcp.pearl.com/sse
- Clear stored credentials:
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:
- Visit Pearl Contact Page
- Request an API key for MCP server integration
- 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.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。