mickdarling/persona-mcp-server
If you are the rightful owner of persona-mcp-server 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.
Persona MCP Server is a professional Model Context Protocol server designed for dynamic AI persona management using markdown files.
list_personas
Display all available personas with metadata.
activate_persona
Activate a specific persona by name or filename.
get_active_persona
Get information about the currently active persona.
deactivate_persona
Deactivate current persona and return to default mode.
get_persona_details
View complete details and content of a persona.
reload_personas
Refresh personas from the filesystem.
Persona MCP Server
A professional Model Context Protocol (MCP) server that enables dynamic AI persona management from markdown files. This server allows Claude and other compatible AI assistants to activate and switch between different behavioral personas, transforming how they respond and interact.
โจ Features
Feature | Description |
---|---|
๐ญ Multiple Personas | Load different AI personalities from markdown files |
๐ Markdown-Based | Easy to create and edit persona files with YAML frontmatter |
๐ Hot Reload | Dynamically reload personas without restarting the server |
๐ฏ Flexible Activation | Activate personas by name or filename |
๐ Rich Metadata | Support for versioning, authors, triggers, and detailed descriptions |
๐ง Professional Structure | Clean TypeScript codebase with proper build pipeline |
๐ Quick Start
Installation
# Clone or download the repository
git clone https://github.com/mickdarling/persona-mcp-server.git
cd persona-mcp-server
# Install dependencies and build
npm run setup
Project Structure
persona-mcp-server/
โโโ src/
โ โโโ index.ts # Main server implementation
โโโ dist/ # Compiled JavaScript (auto-generated)
โโโ personas/ # Persona definition files
โ โโโ creative-writer.md
โ โโโ technical-analyst.md
โ โโโ eli5-explainer.md
โ โโโ business-consultant.md
โ โโโ debug-detective.md
โโโ package.json # Project configuration
โโโ tsconfig.json # TypeScript configuration
โโโ LICENSE # MIT license
โโโ README.md # This file
Claude Desktop Configuration
Add the persona server to your Claude Desktop configuration file:
Location: ~/Library/Application Support/Claude/claude_desktop_config.json
(macOS)
If you have no existing MCP servers:
{
"mcpServers": {
"persona-mcp-server": {
"command": "node",
"args": ["/path/to/persona-mcp-server/dist/index.js"]
}
}
}
If you already have other MCP servers:
Add the persona server entry to your existing mcpServers
section:
{
"mcpServers": {
"your-existing-server": {
"command": "node",
"args": ["/path/to/your/existing/server.js"]
},
"another-server": {
"command": "npx",
"args": ["-y", "@some/mcp-package@latest"]
},
"persona-mcp-server": {
"command": "node",
"args": ["/path/to/persona-mcp-server/dist/index.js"]
}
}
}
๐ After updating the configuration:
- Save the file
- Restart Claude Desktop completely
- The persona tools will be available in your next conversation
๐ Usage
Available Tools
Tool | Description | Parameters |
---|---|---|
list_personas | Display all available personas with metadata | None |
activate_persona | Activate a specific persona by name or filename | persona : string |
get_active_persona | Get information about the currently active persona | None |
deactivate_persona | Deactivate current persona and return to default mode | None |
get_persona_details | View complete details and content of a persona | persona : string |
reload_personas | Refresh personas from the filesystem | None |
Example Workflow
-
๐ List available personas:
Use the list_personas tool to see all available personas
-
๐ญ Activate a persona:
Use activate_persona with "Creative Writer" or "creative-writer.md"
-
๐ฌ Interact in persona mode:
Ask questions - Claude will respond using the activated persona's style and instructions
-
๐ Switch or deactivate:
Use activate_persona for a different persona, or deactivate_persona to return to default
๐ Creating Custom Personas
Persona File Format
Create a .md
file in the personas/
directory using this structure:
---
name: "Your Persona Name"
description: "Brief description of what this persona does"
triggers: ["keyword1", "keyword2", "keyword3"]
version: "1.0"
author: "Your Name"
---
# Your Persona Name
Your persona instructions go here. This content will be injected as context when the persona is activated.
## Response Style
- Guideline 1: How to communicate
- Guideline 2: Tone and approach
- Guideline 3: Specific behaviors
## Key Techniques
- Technique 1: Specific method or approach
- Technique 2: Problem-solving strategy
Remember to end with key reminders that ensure consistent persona behavior.
Metadata Fields
Field | Required | Description |
---|---|---|
name | โ | Display name for the persona |
description | โ | Brief description of the persona's purpose |
triggers | โ | Keywords that suggest this persona |
version | โ | Version number for tracking changes |
author | โ | Creator of the persona |
Best Practices
- ๐ฏ Clear Purpose: Each persona should have a distinct, focused role
- ๐ Specific Instructions: Be explicit about how the persona should behave
- ๐ฃ๏ธ Consistent Voice: Define communication style and tone clearly
- ๐ก Include Examples: Show expected transformations or response patterns
- โก Actionable Guidelines: Provide implementable instructions, not just descriptions
๐๏ธ Development
Available Scripts
Script | Description |
---|---|
npm run build | Compile TypeScript to JavaScript |
npm run start | Run the compiled server |
npm run dev | Run in development mode with auto-reload |
npm run clean | Remove compiled files |
npm run rebuild | Clean and rebuild the project |
npm run setup | Install dependencies and build |
Environment Variables
Customize server behavior with these environment variables:
export PERSONAS_DIR="/custom/path/to/personas" # Custom personas directory
Building from Source
# Development setup
npm install
npm run build
# Development with auto-reload
npm run dev
# Production build
npm run rebuild
๐งช Testing
Running Tests
The project includes comprehensive tests for cross-platform compatibility:
# Run all tests
npm test
# Run tests with coverage
npm run test:coverage
# Run tests in watch mode (for development)
npm run test:watch
# Run tests for CI/CD
npm run test:ci
Manual Verification
Verify your setup works correctly:
# Build the project
npm run build
# Test the server (should output server info)
node dist/index.js --help 2>/dev/null || echo "Server compiled successfully"
# Verify personas directory
ls -la personas/
Cross-Platform Testing
The test suite validates:
- โ Windows, macOS, and Linux compatibility
- โ Path handling across different file systems
- โ Environment variable configuration
- โ Package integrity and dependencies
- โ Build process and artifacts
๐ณ Docker Support
Quick Start with Docker
# Build the Docker image
docker build -t persona-mcp-server .
# Run the container
docker run -d --name persona-mcp-server \
-v $(pwd)/custom-personas:/app/custom-personas:ro \
persona-mcp-server
# Using Docker Compose
docker-compose up -d
# Development mode
docker-compose --profile dev up
Docker Configuration
The Docker image is optimized for:
- Multi-stage builds for smaller production images
- Non-root user for security
- Health checks for monitoring
- Custom persona mounting via volumes
- Cross-platform support (linux/amd64, linux/arm64)
Environment Variables for Docker
# Set custom personas directory
docker run -e PERSONAS_DIR=/app/custom-personas persona-mcp-server
# Production mode
docker run -e NODE_ENV=production persona-mcp-server
โ๏ธ Cloud Deployment
Container Registries
The project supports deployment to:
- GitHub Container Registry (ghcr.io)
- Docker Hub
- AWS ECR
- Google Container Registry
Example Cloud Deployments
AWS ECS
{
"family": "persona-mcp-server",
"containerDefinitions": [{
"name": "persona-mcp-server",
"image": "ghcr.io/mickdarling/persona-mcp-server:latest",
"memory": 512,
"cpu": 256,
"environment": [
{"name": "NODE_ENV", "value": "production"},
{"name": "PERSONAS_DIR", "value": "/app/personas"}
]
}]
}
Google Cloud Run
gcloud run deploy persona-mcp-server \
--image ghcr.io/mickdarling/persona-mcp-server:latest \
--platform managed \
--region us-central1 \
--set-env-vars NODE_ENV=production
Azure Container Instances
az container create \
--name persona-mcp-server \
--resource-group myResourceGroup \
--image ghcr.io/mickdarling/persona-mcp-server:latest \
--environment-variables NODE_ENV=production
๐ ๏ธ Troubleshooting
Common Issues
Issue | Cause | Solution |
---|---|---|
Personas not loading | Files not in personas/ directory | Check file location and permissions |
Persona won't activate | Name/filename mismatch | Use exact name from list_personas |
Server won't start | Build errors or missing dependencies | Run npm run rebuild |
Path issues | Incorrect personas directory | Verify PERSONAS_DIR or use default |
Debug Steps
-
Check build status:
npm run build
-
Verify persona files:
ls -la personas/*.md
-
Test server startup:
node dist/index.js
-
Validate personas: Use the
reload_personas
tool to check for loading errors
๐ค Contributing
We welcome contributions! Here's how to help:
Adding Personas
- Fork the repository
- Create a new persona file in
personas/
- Follow the established format and naming conventions
- Test your persona thoroughly
- Submit a pull request with a clear description
Reporting Issues
Please include:
- Node.js version (
node --version
) - Operating system
- Complete error messages
- Steps to reproduce the issue
- Relevant persona files (if applicable)
Development Guidelines
- Follow TypeScript best practices
- Maintain existing code style
- Add appropriate error handling
- Update documentation for new features
- Test thoroughly before submitting PRs
๐ API Reference
MCP Tool Specifications
Each tool follows the MCP specification:
interface PersonaTool {
name: string;
description: string;
inputSchema: {
type: "object";
properties: Record<string, any>;
required?: string[];
};
}
Error Handling
The server provides detailed error messages for:
- Invalid persona identifiers
- File system issues
- Malformed persona files
- Runtime errors
๐ Built-in Personas
Persona | Purpose | Best For |
---|---|---|
Creative Writer | Imaginative storytelling and creative content | Brainstorming, creative writing, engaging narratives |
Technical Analyst | Deep technical analysis and systematic problem-solving | Architecture decisions, debugging, technical docs |
ELI5 Explainer | Simplifying complex topics for beginners | Teaching, onboarding, concept explanation |
Business Consultant | Strategic business analysis and recommendations | Strategy planning, business decisions, market analysis |
Debug Detective | Systematic debugging and troubleshooting | Bug hunting, system troubleshooting, root cause analysis |
๐ License
This project is licensed under the MIT License - see the file for details.
๐ท๏ธ Version History
v1.0.0
- Initial professional release
- TypeScript implementation with proper build pipeline
- Comprehensive persona library
- Hot reload functionality
- Full MCP integration
- Professional project structure
Made with โค๏ธ for the MCP community
For support, please open an issue on GitHub.