Skip to main content

Overview

Pcnaid MCP Hub provides flexible authentication mechanisms to secure your MCP server management platform. The system supports multiple authentication methods and role-based access control.

Authentication Methods

Environment-based Authentication

Configure basic authentication using environment variables:

Database Authentication

For production deployments, enable database-backed user management:

User Management

Creating Users

Create users via the admin interface or API:

User Roles

Pcnaid MCP Hub supports role-based access control:
  • Admin: Full system access, user management, server configuration
  • Manager: Server management, group management, monitoring
  • User: Basic server access within assigned groups
  • Viewer: Read-only access to assigned resources

Group-based Access Control

Assigning Users to Groups

Group Permissions

Configure group-level permissions:

API Authentication

JWT Token Authentication

API Key Authentication

For service-to-service communication:

Security Configuration

HTTPS Setup

Configure HTTPS for production:

CORS Configuration

Configure CORS for web applications:

Rate Limiting

Protect against abuse with rate limiting:

Session Management

Session Configuration

Logout and Session Cleanup

Security Best Practices

Password Security

  • Use strong password requirements
  • Implement password hashing with bcrypt
  • Support password reset functionality
  • Enable two-factor authentication (2FA)

Token Security

  • Use secure JWT secrets
  • Implement token rotation
  • Set appropriate expiration times
  • Store tokens securely in httpOnly cookies

Network Security

  • Use HTTPS in production
  • Implement proper CORS policies
  • Enable request validation
  • Use security headers (helmet.js)

Monitoring Security Events

Troubleshooting

Common Authentication Issues

Invalid Credentials
Token Expiration
Permission Denied

Debug Authentication

Enable authentication debugging:

Integration Examples

Frontend Integration

Middleware Integration