vindepemarte/Persona-MCP
If you are the rightful owner of Persona-MCP and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
The Persona MCP Server is a sophisticated tool designed to emulate your personality and communication style, providing personalized interactions through AI agents.
Persona MCP Server
A Model Context Protocol (MCP) server that learns and emulates your personality, thinking patterns, communication style, goals, and preferences. This server enables AI agents to understand and respond as if they were you, making interactions more personalized and authentic.
Features
- Personality Learning: Analyzes your communication patterns, preferences, and decision-making style
- Goal Management: Tracks and manages your personal and professional goals
- Communication Emulation: Generates responses in your unique voice and style
- Compatibility Analysis: Evaluates how well content aligns with your persona
- PostgreSQL Integration: Robust data storage with full ACID compliance
- MCP Protocol: Compatible with n8n AI agents and other MCP clients
- Docker Support: Easy deployment with Docker and Docker Compose
- Coolify Ready: One-click deployment on Coolify platform
Quick Start
Prerequisites
- Node.js 18+ and npm
- PostgreSQL 12+ (or use Docker)
- Git
Local Development
-
Clone the repository
git clone <your-repo-url> cd persona-mcp-server
-
Install dependencies
npm install
-
Set up environment variables
cp .env.example .env # Edit .env with your database credentials
-
Set up PostgreSQL database
# Create database createdb persona_mcp # Run migrations npm run migrate
-
Start the development server
npm run dev
Docker Deployment
-
Using Docker Compose (Recommended)
# Copy environment file cp .env.example .env # Start all services docker-compose up -d # View logs docker-compose logs -f persona-mcp
-
Access the services
- MCP Server:
http://localhost:3000
- PostgreSQL:
localhost:5432
- pgAdmin (optional):
http://localhost:8080
- MCP Server:
š Deployment Options
Option 1: Coolify (Recommended for Production)
- Connect your Git repository to Coolify
- Configure environment variables in Coolify's Environment Variables section (not .env files)
- Required variables:
DATABASE_PASSWORD
,DOMAIN
,JWT_SECRET
,API_KEY
,NODE_ENV=production
- Click "Deploy" - Coolify automatically detects the
coolify.yml
configuration - PostgreSQL and the MCP server will be set up automatically with SSL and backups
Coolify Deployment Details
-
In your Coolify dashboard:
- Create a new project
- Connect your Git repository
- Coolify will automatically detect the
coolify.yml
configuration
-
Set environment variables in Coolify Environment Variables section:
DATABASE_PASSWORD
: Strong password for PostgreSQLDOMAIN
: Your domain name (e.g.,persona-mcp.yourdomain.com
)JWT_SECRET
: Random secret for JWT tokensAPI_KEY
: API key for external accessNODE_ENV
: Set toproduction
AUTO_MIGRATE
: Set totrue
for automatic database setupLOG_LEVEL
: Set toinfo
orwarn
for production
Important: Do NOT use
.env
files for Coolify deployment. All environment variables must be configured through Coolify's Environment Variables interface. -
Deploy:
- Click "Deploy" in Coolify
- The system will automatically set up PostgreSQL and the MCP server
- Database migrations will run automatically if
AUTO_MIGRATE=true
MCP Tools Available
The server provides these MCP tools for AI agents:
1. learn_persona
Learn about your personality from provided content.
{
"name": "learn_persona",
"arguments": {
"content": "I prefer working in quiet environments and like to plan things in advance.",
"content_type": "preference",
"context": "work preferences"
}
}
2. get_persona
Retrieve persona information for AI understanding.
{
"name": "get_persona",
"arguments": {
"query_type": "communication",
"context": "writing email",
"format": "detailed"
}
}
3. emulate_response
Generate responses in your style.
{
"name": "emulate_response",
"arguments": {
"prompt": "How should I respond to this meeting invitation?",
"context": "professional email",
"response_type": "email",
"tone": "professional"
}
}
4. analyze_compatibility
Analyze how well content matches your persona.
{
"name": "analyze_compatibility",
"arguments": {
"content": "Let's schedule a quick call to discuss this.",
"analysis_type": "communication_fit"
}
}
5. update_goals
Manage your goals and objectives.
{
"name": "update_goals",
"arguments": {
"action": "add",
"goal_data": {
"title": "Learn Spanish",
"description": "Become conversational in Spanish within 6 months",
"category": "learning",
"priority": "medium"
}
}
}
Integration with n8n
-
Install n8n MCP node (if available) or use HTTP requests
-
Configure MCP connection:
- Server URL:
http://your-server:3000
- Protocol: MCP
- Authentication: API Key (if configured)
- Server URL:
-
Example n8n workflow:
{ "nodes": [ { "name": "Learn from Email", "type": "MCP", "parameters": { "tool": "learn_persona", "content": "{{$json.email_content}}", "content_type": "text" } }, { "name": "Generate Response", "type": "MCP", "parameters": { "tool": "emulate_response", "prompt": "{{$json.original_message}}", "response_type": "email" } } ] }
Database Schema
The server uses PostgreSQL with the following main tables:
- personality_traits: Core personality characteristics
- communication_patterns: Writing and speaking patterns
- goals: Personal and professional objectives
- preferences: User preferences and settings
- thinking_patterns: Decision-making and problem-solving approaches
- learning_inputs: Historical learning data
- persona_snapshots: Versioned persona states
- mcp_interactions: Interaction logs and analytics
Configuration
Environment Variables
Variable | Description | Default |
---|---|---|
DB_HOST | PostgreSQL host | localhost |
DB_PORT | PostgreSQL port | 5432 |
DB_NAME | Database name | persona_mcp |
DB_USER | Database user | postgres |
DB_PASSWORD | Database password | `` |
AUTO_MIGRATE | Run migrations on start | true |
PORT | Server port | 3000 |
NODE_ENV | Environment | development |
LOG_LEVEL | Logging level | info |
Database Management
# Run migrations
npm run migrate
# Reset database (WARNING: Deletes all data)
ts-node src/database/migrate.ts reset
# Drop all tables
ts-node src/database/migrate.ts down
API Endpoints
While primarily an MCP server, basic HTTP endpoints are available:
GET /health
- Health checkPOST /mcp
- MCP protocol endpointGET /persona/overview
- Get persona summaryPOST /persona/learn
- Learn from input
Security Considerations
- Database Security: Use strong passwords and enable SSL in production
- Network Security: Run behind a reverse proxy (nginx, Traefik)
- API Security: Implement API key authentication for HTTP endpoints
- Data Privacy: Persona data is sensitive - ensure proper access controls
- Backup Strategy: Regular database backups are essential
Monitoring and Logging
- Application Logs: Stored in
/app/logs/
directory - Database Logs: PostgreSQL logs for query analysis
- Health Checks: Built-in health endpoints for monitoring
- Metrics: MCP interaction logs for usage analytics
Troubleshooting
Common Issues
-
Database Connection Failed
# Check PostgreSQL is running pg_isready -h localhost -p 5432 # Verify credentials psql -h localhost -U postgres -d persona_mcp
-
Migration Errors
# Reset and retry npm run migrate -- reset
-
MCP Connection Issues
- Verify server is running on correct port
- Check firewall settings
- Validate MCP client configuration
Logs
# View application logs
docker-compose logs -f persona-mcp
# View database logs
docker-compose logs -f postgres
# View all logs
docker-compose logs -f
Development
Project Structure
src/
āāā database/ # Database configuration and migrations
ā āāā config.ts # Database connection
ā āāā migrate.ts # Migration runner
ā āāā schema.sql # Database schema
āāā services/ # Business logic
ā āāā PersonaService.ts
āāā types/ # TypeScript type definitions
ā āāā persona.ts # Persona-related types
ā āāā mcp.ts # MCP protocol types
āāā server.ts # MCP server implementation
āāā index.ts # Application entry point
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
Testing
# Run tests
npm test
# Run with coverage
npm run test:coverage
# Lint code
npm run lint
License
MIT License - see LICENSE file for details.
Support
For issues and questions:
- Check the troubleshooting section
- Search existing GitHub issues
- Create a new issue with detailed information
Note: This server learns and stores personal information. Ensure you comply with relevant privacy laws and regulations in your jurisdiction.