CustomGPT MCP Server
A full-featured MCP server providing seamless access to CustomGPT.ai APIs, enabling agent and conversation management through MCP-compatible clients.
README
CustomGPT MCP Server
A full-featured Model Context Protocol (MCP) server that provides seamless access to CustomGPT.ai APIs. Interact with your CustomGPT agents directly through Claude Code, Claude Web, and any MCP-compatible client.
Features
Agent Management
- List Agents: Browse all your CustomGPT agents with pagination
- Get Agent Details: Retrieve detailed information about specific agents
- Create Agents: Create new agents from sitemaps or files
- Agent Statistics: Get usage stats, page counts, and conversation metrics
- Agent Settings: View and configure agent behavior and appearance
Conversation Management
- Send Messages: Chat with your agents using OpenAI-compatible format
- List Conversations: Browse conversation history for any agent
- Message History: Retrieve full conversation transcripts
Content Management
- List Pages: View all pages/sources for your agents
- Page Status: Check crawl and indexing status
- Content Sources: Manage sitemaps and uploaded files
API Documentation Integration
- Search Documentation: Find relevant API endpoints and documentation
- Endpoint Details: Get comprehensive information about specific API endpoints
- Interactive Help: Built-in API reference with examples
Security & Privacy
- API Key Masking: Secure API key handling with automatic masking in logs
- Validation: Built-in API key validation and format checking
- No Storage: Stateless design - API keys are never stored permanently
Quick Start
Prerequisites
- Python 3.10+ (required for FastMCP)
- A valid CustomGPT.ai API key from CustomGPT Dashboard
- MCP-compatible client (Claude Code, Claude Web, etc.)
Installation
Recommended Setup
# Clone repository
git clone https://github.com/Poll-The-People/customgpt-mcp.git
cd customgpt-mcp
# Create Python 3.11 virtual environment (required for FastMCP)
python3.11 -m venv venv
source venv/bin/activate
# Install dependencies (includes FastMCP + CustomGPT SDK)
pip install -r requirements.txt
# Configure with your API key
cp .env.example .env
# Edit .env and add: CUSTOMGPT_API_KEY=your_actual_key
# Test the server
python server.py
Option 2: Using Docker
git clone https://github.com/customgpt-ai/customgpt-mcp.git
cd customgpt-mcp
docker-compose up -d
Option 3: Deploy to Railway (Recommended for Production)
- Click the Railway button above
- Set your environment variables
- Deploy with one click
Local Development
# Clone the repository
git clone https://github.com/customgpt-ai/customgpt-mcp.git
cd customgpt-mcp
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\\Scripts\\activate
# Install dependencies
pip install -r requirements.txt
# Copy environment file and configure
cp .env.example .env
# Edit .env with your settings
# Run the server
python server.py
🔧 Configuration
Environment Variables
Create a .env file in the project root:
# API Settings
CUSTOMGPT_API_BASE=https://app.customgpt.ai
API_VERSION=v1
# Server Settings
HOST=0.0.0.0
PORT=8000
DEBUG=false
# CORS Settings
CORS_ORIGINS=https://claude.ai,https://chatgpt.com
# Security
API_KEY_MASK_CHARS=4
MCP Client Configuration
Claude Code
Add to your MCP settings:
{
"mcpServers": {
"customgpt": {
"command": "python",
"args": ["/path/to/customgpt-mcp/server.py"],
"env": {
"PYTHONPATH": "/path/to/customgpt-mcp"
}
}
}
}
Claude Web
- Go to Claude Web Settings
- Add MCP Server:
https://your-deployed-server.railway.app - Configure with your CustomGPT API key
🛠️ Available Tools
Agent Management
list_agents
List all your CustomGPT agents with pagination support.
{
"api_key": "your_customgpt_api_key",
"page": 1,
"name": "filter_by_name",
"order": "desc"
}
get_agent
Get detailed information about a specific agent.
{
"api_key": "your_customgpt_api_key",
"project_id": 123
}
create_agent
Create a new agent from a sitemap or files.
{
"api_key": "your_customgpt_api_key",
"project_name": "My New Agent",
"sitemap_path": "https://example.com/sitemap.xml",
"file_data_retention": true,
"is_ocr_enabled": false,
"is_anonymized": false
}
Conversation Tools
send_message
Send a message to any of your agents.
{
"api_key": "your_customgpt_api_key",
"project_id": 123,
"message": "Hello, how can you help me?",
"lang": "en",
"stream": false,
"is_inline_citation": false
}
list_conversations
List all conversations for a specific agent.
{
"api_key": "your_customgpt_api_key",
"project_id": 123,
"page": 1,
"order": "desc"
}
Content Management
list_pages
List all pages/sources for an agent.
{
"api_key": "your_customgpt_api_key",
"project_id": 123,
"page": 1,
"limit": 20,
"crawl_status": "all",
"index_status": "all"
}
get_agent_stats
Get statistics for an agent.
{
"api_key": "your_customgpt_api_key",
"project_id": 123
}
get_agent_settings
Get configuration settings for an agent.
{
"api_key": "your_customgpt_api_key",
"project_id": 123
}
Documentation Tools
search_api_documentation
Search the CustomGPT API documentation.
{
"query": "create agent",
"category": "Agents"
}
get_api_endpoint_details
Get detailed information about a specific API endpoint.
{
"endpoint_path": "/api/v1/projects",
"method": "POST"
}
Utility Tools
validate_api_key
Validate your CustomGPT API key.
{
"api_key": "your_customgpt_api_key"
}
📊 Usage Examples
Basic Agent Interaction
# 1. Validate your API key
validate_api_key({"api_key": "your_key"})
# 2. List your agents
agents = list_agents({"api_key": "your_key", "page": 1})
# 3. Send a message to an agent
response = send_message({
"api_key": "your_key",
"project_id": 123,
"message": "What can you help me with?"
})
Creating and Managing Agents
# Create a new agent from a sitemap
new_agent = create_agent({
"api_key": "your_key",
"project_name": "Customer Support Bot",
"sitemap_path": "https://mycompany.com/sitemap.xml"
})
# Get agent statistics
stats = get_agent_stats({
"api_key": "your_key",
"project_id": new_agent["agent"]["id"]
})
# List the agent's content pages
pages = list_pages({
"api_key": "your_key",
"project_id": new_agent["agent"]["id"]
})
🚀 Deployment Options
Railway (Recommended)
Railway provides the best hosting experience for MCP servers with automatic HTTPS, custom domains, and easy scaling.
- Fork this repository
- Connect to Railway
- Set environment variables
- Deploy with automatic builds
Environment Variables for Railway:
CUSTOMGPT_API_BASE=https://app.customgpt.ai
PORT=8000
PYTHONPATH=.
Vercel
Serverless deployment option for lighter workloads.
- Install Vercel CLI:
npm i -g vercel - Deploy:
vercel - Set environment variables in Vercel dashboard
Docker
For containerized deployment on any platform.
# Build and run
docker-compose up -d
# Or build manually
docker build -t customgpt-mcp .
docker run -p 8000:8000 -e CUSTOMGPT_API_BASE=https://app.customgpt.ai customgpt-mcp
Self-Hosted
For complete control over your deployment.
# Install dependencies
pip install -r requirements.txt
# Run with Gunicorn (production)
gunicorn -w 4 -k uvicorn.workers.UvicornWorker server:app
# Or run directly (development)
python server.py
🔍 API Reference
The server provides comprehensive API documentation integration. Use the following tools to explore:
search_api_documentation- Search for specific functionalityget_api_endpoint_details- Get detailed endpoint information- Access the built-in resource:
customgpt://api-documentation
Security Considerations
API Key Management
- API keys are masked in all logs (only last 4 characters shown)
- Keys are never stored persistently on the server
- Each request validates the API key independently
- Failed authentication attempts are logged for monitoring
Network Security
- CORS configuration for production environments
- HTTPS enforcement in production
- Request rate limiting (when deployed with proper infrastructure)
- Input validation for all parameters
Best Practices
- Use environment variables for configuration
- Deploy with HTTPS enabled
- Configure CORS appropriately for your use case
- Monitor logs for unusual activity
- Regularly rotate API keys
Troubleshooting
Common Issues
"Invalid API key format"
- Ensure your API key is correctly formatted
- Check that there are no extra spaces or characters
- Verify the key is from CustomGPT.ai dashboard
"Authentication failed"
- API key may be invalid or expired
- Check API key permissions in CustomGPT.ai dashboard
- Try regenerating your API key
"Connection timeout"
- Check internet connectivity
- Verify CustomGPT.ai service status
- Ensure firewall isn't blocking requests
"API documentation not available"
- Ensure
docs/openapi.jsonexists in the project - Check file permissions
- Verify the JSON file is valid
Debug Mode
Enable debug logging by setting DEBUG=true in your environment:
DEBUG=true python server.py
Health Checks
The server provides health check endpoints:
/health- Basic server health/api/v1/health- API health with version info
Contributing
We welcome contributions! Please see our Contributing Guide for details.
Development Setup
# Clone and setup
git clone https://github.com/customgpt-ai/customgpt-mcp.git
cd customgpt-mcp
# Install development dependencies
pip install -r requirements.txt
pip install -e ".[dev]"
# Run tests
pytest
# Format code
black .
ruff --fix .
# Type checking
mypy .
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
- Documentation: https://docs.customgpt.ai/mcp
- Email: hello@customgpt.ai
- Slack: Join our community
Roadmap
- [ ] Streaming Support: Real-time message streaming
- [ ] File Upload: Direct file upload to agents
- [ ] Webhook Integration: Real-time notifications and events
- [ ] Multi-tenancy: Support for multiple organizations
- [ ] Rate Limiting: Built-in rate limiting and quota management
- [ ] Caching: Intelligent response caching for better performance
*this is still in beta.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.