persona-mcp-server

mickdarling/persona-mcp-server

3.2

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.

Tools
  1. list_personas

    Display all available personas with metadata.

  2. activate_persona

    Activate a specific persona by name or filename.

  3. get_active_persona

    Get information about the currently active persona.

  4. deactivate_persona

    Deactivate current persona and return to default mode.

  5. get_persona_details

    View complete details and content of a persona.

  6. reload_personas

    Refresh personas from the filesystem.

Persona MCP Server

npm version License: MIT TypeScript Node.js

Platform Support Docker Test Coverage

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

FeatureDescription
๐ŸŽญ Multiple PersonasLoad different AI personalities from markdown files
๐Ÿ“ Markdown-BasedEasy to create and edit persona files with YAML frontmatter
๐Ÿ”„ Hot ReloadDynamically reload personas without restarting the server
๐ŸŽฏ Flexible ActivationActivate personas by name or filename
๐Ÿ“Š Rich MetadataSupport for versioning, authors, triggers, and detailed descriptions
๐Ÿ”ง Professional StructureClean 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:

  1. Save the file
  2. Restart Claude Desktop completely
  3. The persona tools will be available in your next conversation

๐Ÿ“– Usage

Available Tools

ToolDescriptionParameters
list_personasDisplay all available personas with metadataNone
activate_personaActivate a specific persona by name or filenamepersona: string
get_active_personaGet information about the currently active personaNone
deactivate_personaDeactivate current persona and return to default modeNone
get_persona_detailsView complete details and content of a personapersona: string
reload_personasRefresh personas from the filesystemNone

Example Workflow

  1. ๐Ÿ“‹ List available personas:

    Use the list_personas tool to see all available personas
    
  2. ๐ŸŽญ Activate a persona:

    Use activate_persona with "Creative Writer" or "creative-writer.md"
    
  3. ๐Ÿ’ฌ Interact in persona mode:

    Ask questions - Claude will respond using the activated persona's style and instructions
    
  4. ๐Ÿ”„ 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

FieldRequiredDescription
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

  1. ๐ŸŽฏ Clear Purpose: Each persona should have a distinct, focused role
  2. ๐Ÿ“‹ Specific Instructions: Be explicit about how the persona should behave
  3. ๐Ÿ—ฃ๏ธ Consistent Voice: Define communication style and tone clearly
  4. ๐Ÿ’ก Include Examples: Show expected transformations or response patterns
  5. โšก Actionable Guidelines: Provide implementable instructions, not just descriptions

๐Ÿ—๏ธ Development

Available Scripts

ScriptDescription
npm run buildCompile TypeScript to JavaScript
npm run startRun the compiled server
npm run devRun in development mode with auto-reload
npm run cleanRemove compiled files
npm run rebuildClean and rebuild the project
npm run setupInstall 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

IssueCauseSolution
Personas not loadingFiles not in personas/ directoryCheck file location and permissions
Persona won't activateName/filename mismatchUse exact name from list_personas
Server won't startBuild errors or missing dependenciesRun npm run rebuild
Path issuesIncorrect personas directoryVerify PERSONAS_DIR or use default

Debug Steps

  1. Check build status:

    npm run build
    
  2. Verify persona files:

    ls -la personas/*.md
    
  3. Test server startup:

    node dist/index.js
    
  4. Validate personas: Use the reload_personas tool to check for loading errors

๐Ÿค Contributing

We welcome contributions! Here's how to help:

Adding Personas

  1. Fork the repository
  2. Create a new persona file in personas/
  3. Follow the established format and naming conventions
  4. Test your persona thoroughly
  5. 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

  1. Follow TypeScript best practices
  2. Maintain existing code style
  3. Add appropriate error handling
  4. Update documentation for new features
  5. 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

PersonaPurposeBest For
Creative WriterImaginative storytelling and creative contentBrainstorming, creative writing, engaging narratives
Technical AnalystDeep technical analysis and systematic problem-solvingArchitecture decisions, debugging, technical docs
ELI5 ExplainerSimplifying complex topics for beginnersTeaching, onboarding, concept explanation
Business ConsultantStrategic business analysis and recommendationsStrategy planning, business decisions, market analysis
Debug DetectiveSystematic debugging and troubleshootingBug 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.