MC

MCP Server Plexus: Multi-Tenant Python OAuth 2.1 Platform

Deploy a secure, multi-tenant MCP server with OAuth 2.1 integration for scalable, multi-user AI applications and seamless external service access.

Quick Install
npx -y @Super-I-Tech/mcp_plexus

Overview

MCP Server Plexus is a multi-tenant Python server that implements the Model Context Protocol (MCP) with built-in OAuth 2.1 integration. It centralizes per-tenant model context management, access control, and secure delegation to external services (APIs, data stores, identity providers) so teams can build multi-user AI applications while enforcing consistent security, observability, and policy across tenants.

Plexus is designed for deployment in cloud environments or on-premises. It provides tenant isolation, OAuth 2.1-compliant authorization flows (including Authorization Code with PKCE), token introspection, and a simplified developer API for provisioning tenants and model contexts. This makes it useful when you need to expose model-aware functionality to many users and services while keeping authentication and third-party access consistent and auditable.

Features

  • Multi-tenant model context management with per-tenant isolation
  • OAuth 2.1-compatible flows (Authorization Code with PKCE, token refresh, introspection)
  • Delegated access to external services via short-lived tokens
  • Administrative APIs and CLI for tenant lifecycle management
  • Built-in integration points for databases and caching (Postgres, Redis)
  • Policy and scope enforcement for fine-grained permissions
  • Observability hooks: request logging, metrics, and audit trails
  • Docker Compose and production-ready deployment patterns

Installation / Configuration

Quick start — clone and run with Docker Compose:

git clone https://github.com/Super-I-Tech/mcp_plexus.git
cd mcp_plexus
docker-compose up -d

Local development (Python virtual environment):

python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
# Apply database migrations (example)
alembic upgrade head
# Start the ASGI server
uvicorn mcp_plexus.app:app --reload --host 0.0.0.0 --port 8000

Important environment variables

VariablePurposeExample
DATABASE_URLPostgres connection stringpostgres://user:pass@db:5432/mcp
REDIS_URLRedis connection string for caching/locksredis://redis:6379/0
SECRET_KEYApplication secret for signing cookies/tokensgenerated-secret
OAUTH_PROVIDER_URLBase URL of external OAuth providerhttps://auth.example.com
OAUTH_CLIENT_IDClient ID for server-to-provider communicationyour-client-id
OAUTH_CLIENT_SECRETClient secret (use vault in production)your-client-secret
ADMIN_API_KEYKey for bootstrapping admin CLI/API callssupersecretadminkey

Example Docker Compose fragment

version: "3.8"
services:
  mcp-plexus:
    build: .
    ports:
      - "8000:8000"
    environment:
      - DATABASE_URL=postgres://mcp:mcp@db:5432/mcp
      - REDIS_URL=redis://redis:6379/0
      - SECRET_KEY=change_this
  db:
    image: postgres:15
    environment:
      POSTGRES_DB: mcp
      POSTGRES_USER: mcp
      POSTGRES_PASSWORD: mcp
  redis:
    image: redis:7

Available Resources

  • REST API: endpoints for tenant provisioning, model context CRUD, and token introspection
  • Admin UI: web interface for tenant and policy management (if enabled)
  • CLI: tenant lifecycle commands (create, update, rotate-keys)
  • SDK: lightweight Python client helpers for authenticating and calling the MCP API
  • Monitoring hooks: Prometheus-compatible metrics and structured logs

Check the repository for API docs, OpenAPI/Swagger spec, and the admin UI assets.

Use Cases

  1. Multi-tenant AI platform

    • Problem: A company hosts multiple customer instances of an LLM-powered assistant and needs strict tenant isolation and centralized access control.
    • How Plexus helps: manage per-tenant model context (prompts, safety settings, rate limits), issue short-lived tokens, and enforce scopes for model access.
  2. Delegated third-party access

    • Problem: Your AI app needs to access user data in external systems (calendars, CRMs) on behalf of the user.
    • How Plexus helps: integrate with OAuth 2.1 providers to obtain delegated tokens, store minimal long-lived refresh secrets centrally, and issue short-lived credentials to downstream services to reduce blast radius.
  3. Centralized security and auditing

    • Problem: Multiple services call different model endpoints, making it hard to apply consistent policy or audit usage.
    • How Plexus helps: all model requests pass through the MCP server, which enforces scopes, logs access, and exposes metrics and audit trails for compliance.
  4. Scalable multi-user apps

    • Problem: Developers want to let many users interact with AI models while dynamically assigning context and permissions.
    • How Plexus helps: provision tenants with isolated model contexts, publish per-tenant keys or OAuth clients, and scale horizontally with standard database and cache backends.

Getting started tips

  • Use PKCE for public clients (single-page apps, mobile).
  • Store secrets in a vault in production; keep SECRET_KEY and OAUTH_CLIENT_SECRET out of source control.
  • Enable TLS/HTTPS in front of the service (reverse proxy like Nginx or cloud load balancer).
  • Review the OpenAPI spec included in the repo to see exact endpoints and request/response shapes before integrating.

For full reference and examples, see the GitHub repository: https://github.com/Super-I-Tech/mcp_plexus.