sellagent-mcp-server
v1.3.1
Published
Model Context Protocol server for integrating LLM tools and services
Maintainers
Readme
SellAgent AI MCP Server
A Model Context Protocol (MCP) server that provides secure tools for interacting with SellAgent AI's CRM and sales automation platform.
Features
- 🔐 Secure Authentication - Supports both API Keys and Bearer tokens
- 📊 Lead Management - Get, create, update, and delete leads
- 🚀 High Performance - Built-in caching for optimal performance
- 🔌 Easy Integration - Works with any MCP-compatible client
Prerequisites
- Node.js 16+ installed
- A SellAgent AI account with API access
- An MCP-compatible client (Claude Desktop, Continue.dev, etc.)
Installation
Option 1: Install from npm (Recommended)
# Install globally
npm install -g sellagent-mcp-server
# Or install locally in your project
npm install sellagent-mcp-serverOption 2: Clone and Install from Source
# Clone the repository
git clone https://github.com/sellagent/mcp-server.git
cd mcp-server
# Install dependencies
npm installConfiguration
Step 1: Configure Environment
Create a .env file in your working directory:
# Required: Your SellAgent API Key
SELLAGENT_API_KEY=your-api-key-here
# API Base URL
# For production (default):
SELLAGENT_BASE_URL=https://server.sellagent.ai/api
# For local development:
# SELLAGENT_BASE_URL=http://localhost:4005/api
# Optional: Authentication cache duration (milliseconds)
AUTH_CACHE_TTL=300000 # 5 minutesStep 2: Get Your API Key
- Log in to SellAgent AI
- Navigate to Settings → API Keys
- Click Create New API Key
- Copy the key and add it to your
.envfile
Usage
Starting the Server
# If installed globally
sellagent-mcp-server
# If installed locally
npx sellagent-mcp-server
# Or using npm start (if cloned from source)
npm start
# The server will run on http://localhost:8080/sseTo test if everything is working:
# Run the test suite (source install only)
npm testClient Configuration
Claude Desktop
Find your Claude Desktop configuration file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
- macOS:
Add the SellAgent server configuration:
If installed globally:
{
"mcpServers": {
"sellagent": {
"command": "sellagent-mcp-server",
"env": {
"SELLAGENT_API_KEY": "your-api-key-here",
"SELLAGENT_BASE_URL": "https://server.sellagent.ai/api"
}
}
}
}If installed locally or from source:
{
"mcpServers": {
"sellagent": {
"command": "node",
"args": ["/absolute/path/to/mcp/index.js"],
"env": {
"SELLAGENT_API_KEY": "your-api-key-here",
"SELLAGENT_BASE_URL": "https://server.sellagent.ai/api"
}
}
}
}Restart Claude Desktop
Verify by typing: "Can you get all leads from SellAgent?"
Continue.dev
- Open VS Code with Continue extension
- Open Continue settings (
.continuerc.json) - Add the MCP server:
If installed globally:
{
"models": [...],
"contextProviders": [{
"name": "mcp",
"params": {
"servers": {
"sellagent": {
"command": "sellagent-mcp-server",
"env": {
"SELLAGENT_API_KEY": "your-api-key-here",
"SELLAGENT_BASE_URL": "https://server.sellagent.ai/api"
}
}
}
}
}]
}If installed locally or from source:
{
"models": [...],
"contextProviders": [{
"name": "mcp",
"params": {
"servers": {
"sellagent": {
"command": "node /absolute/path/to/mcp/index.js",
"env": {
"SELLAGENT_API_KEY": "your-api-key-here",
"SELLAGENT_BASE_URL": "https://server.sellagent.ai/api"
}
}
}
}
}]
}Cody (Sourcegraph)
Add to your Cody configuration:
If installed globally:
{
"mcp": {
"servers": {
"sellagent": {
"command": "sellagent-mcp-server",
"env": {
"SELLAGENT_API_KEY": "your-api-key-here",
"SELLAGENT_BASE_URL": "https://server.sellagent.ai/api"
}
}
}
}
}If installed locally or from source:
{
"mcp": {
"servers": {
"sellagent": {
"command": "node",
"args": ["/absolute/path/to/mcp/index.js"],
"env": {
"SELLAGENT_API_KEY": "your-api-key-here",
"SELLAGENT_BASE_URL": "https://server.sellagent.ai/api"
}
}
}
}
}Available Tools
sellagent_get_all_leads
Fetches all leads from your SellAgent workspace.
Basic Usage with API Key:
{
"auth": {
"type": "apiKey",
"key": "your-api-key-here"
}
}With Parameters:
{
"auth": {
"type": "apiKey",
"key": "your-api-key-here"
},
"limit": 10,
"offset": 0,
"workspaceId": "optional-workspace-id"
}With Custom Authentication:
{
"auth": {
"type": "apiKey",
"key": "different-api-key"
},
"limit": 5
}Authentication Methods
Important: Authentication is required for every tool call. You must provide credentials with each request.
Method 1: API Key Authentication
Include your API key in the request:
{
"auth": {
"type": "apiKey",
"key": "sk_live_different_key"
}
}Method 2: Bearer Token Authentication
For user-specific operations with JWT tokens:
{
"auth": {
"type": "bearer",
"token": "eyJhbGciOiJIUzI1NiIs..."
}
}Troubleshooting
Common Issues
"Authentication failed"
- Check API Key: Ensure it's correctly copied to
.env - Verify Status: Check if the key is active in SellAgent dashboard
- Test Directly: Run
npm testto verify authentication
"Connection refused"
- Local Server: Start your SellAgent server on port 4005
- Use Production: Switch to
https://server.sellagent.ai/apiin.env - Check Network: Ensure you can reach the API server
"Rate limit exceeded"
- Check Usage: View your API usage in SellAgent dashboard
- Upgrade Plan: Consider upgrading for higher limits
- Use Caching: The server caches auth for 5 minutes by default
Debug Mode
Enable detailed logging:
NODE_ENV=development npm startTesting Authentication
Test your setup without a client:
# This will run authentication tests
npm testAdvanced Usage
Multiple Workspaces
To work with different workspaces:
{
"workspaceId": "workspace-123",
"auth": {
"type": "apiKey",
"key": "workspace-specific-key"
}
}Custom Base URL
For self-hosted SellAgent instances:
SELLAGENT_BASE_URL=https://your-domain.com/apiProxy Configuration
If behind a corporate proxy:
export HTTP_PROXY=http://proxy.company.com:8080
export HTTPS_PROXY=http://proxy.company.com:8080Security Best Practices
API Key Storage
- Never commit
.envfiles to version control - Use environment variables in production
- Rotate keys regularly
- Never commit
Network Security
- Use HTTPS URLs in production
- Restrict API key permissions in SellAgent
- Monitor API usage for anomalies
Client Security
- Store keys in secure client configuration
- Don't share configuration files
- Use separate keys for each environment
Development
Project Structure
mcp/
├── auth/ # Authentication middleware
│ ├── middleware.js # Request authentication
│ ├── service.js # Token validation
│ └── httpClient.js # Authenticated HTTP client
├── tools/ # MCP tools
│ └── sellagent/ # SellAgent-specific tools
│ └── leads.js # Lead management
├── test/ # Test files
├── index.js # Server entry point
└── .env # Environment configurationAdding New Tools
- Create a new file in
tools/sellagent/ - Use the authentication middleware
- Register in
tools/index.js - Add tests in
test/
Support
- Documentation: See AUTHENTICATION.md for detailed auth docs
- Issues: Report bugs on GitHub Issues
- SellAgent Support: Contact [email protected]
- MCP Protocol: Learn more at modelcontextprotocol.io
License
MIT License - See LICENSE file for details
