Secure multi-tenant MCP gateway with Forgejo OAuth and isolated Mnemosyne memory
  • JavaScript 73.7%
  • HTML 9.5%
  • Python 8.9%
  • CSS 7.9%
Find a file
2026-07-20 09:52:49 +00:00
bin Open source Atractio Agent Hub 2026-07-20 09:33:41 +00:00
config Open source Atractio Agent Hub 2026-07-20 09:33:41 +00:00
public Link prebuilt tool installer from hub 2026-07-20 09:52:49 +00:00
searxng Open source Atractio Agent Hub 2026-07-20 09:33:41 +00:00
tests Open source Atractio Agent Hub 2026-07-20 09:33:41 +00:00
.env.example Open source Atractio Agent Hub 2026-07-20 09:33:41 +00:00
.gitignore Open source Atractio Agent Hub 2026-07-20 09:33:41 +00:00
compose.yml Open source Atractio Agent Hub 2026-07-20 09:33:41 +00:00
Dockerfile.agent-gateway Open source Atractio Agent Hub 2026-07-20 09:33:41 +00:00
Dockerfile.mnemosyne Open source Atractio Agent Hub 2026-07-20 09:33:41 +00:00
LICENSE Open source Atractio Agent Hub 2026-07-20 09:33:41 +00:00
README.md Open source Atractio Agent Hub 2026-07-20 09:33:41 +00:00

Atractio Agent Hub

A self-hosted, multi-tenant MCP gateway with Forgejo OAuth, per-user Mnemosyne memory, policy enforcement, approvals, audit records, a control console, and a context-light client bridge.

Live deployment: https://agent.atractio.lol
Forgejo: https://git.barem.atractio.lol/rethinger/atractio-agent-hub
Client tool: https://git.barem.atractio.lol/rethinger/atractio-tool

What is included

  • Forgejo OAuth 2.0 login and rotating hub tokens.
  • A stable isolated Mnemosyne bank for every Forgejo identity.
  • SSE MCP routing for memory, search, browser, docs, code, repositories and Git.
  • Scope checks, tenant ownership, server deny policies and exact-operation approvals.
  • Account-wide Always approve without bypassing hard security boundaries.
  • Audit, sessions, policies, jobs, temporary outputs, CI and notifications.
  • Public landing page, status page and authenticated control console.
  • A compact local MCP bridge that keeps only four meta-tools in model context.

Requirements

  • Docker Engine with Compose v2.
  • A Forgejo instance reachable from the gateway.
  • A TLS reverse proxy for the public hub URL.
  • At least 8 GiB RAM for the full browser/code/media tool image.

Quick start

  1. Clone the repository.

  2. Copy the environment template and generate independent random secrets:

    cp .env.example .env
    openssl rand -base64 48
    
  3. In Forgejo, create an OAuth application with callback:

    https://agent.example.com/auth/callback
    
  4. Put the OAuth client ID, client secret, Forgejo URLs and generated secrets in .env.

  5. Start the stack:

    docker compose up -d --build
    
  6. Reverse proxy your public HTTPS hostname to 127.0.0.1:8080.

  7. Open /auth/login, sign in through Forgejo, then use /console to manage the account.

The Compose file intentionally binds the gateway to loopback by default. Do not expose port 8080 directly to the internet.

Forgejo OAuth

The gateway needs a confidential Forgejo OAuth application. FORGEJO_PUBLIC_URL is the browser-facing URL; FORGEJO_API_URL is the URL reachable from the gateway container. They may be the same URL.

Existing installations can bind legacy bootstrap memory to an administrator with LEGACY_MCP_BANK. New Forgejo identities receive stable user_<forgejo-id> banks and cannot select another user's bank.

Client installation

Download a ready-to-run bundle or use the installer from the companion repository:

curl -fsSL https://git.barem.atractio.lol/rethinger/atractio-tool/raw/branch/main/install.sh | sh

Windows PowerShell:

irm https://git.barem.atractio.lol/rethinger/atractio-tool/raw/branch/main/install.ps1 | iex

The installer stores the token separately with user-only permissions, asks which MCP services to enable initially, and writes ready-to-copy client configurations. It never places the token inside a repository.

Development

Run the focused platform tests:

node --test tests/hub_platform.test.js

Validate client scripts:

node --check public/console.js
node --check public/landing.js
node --check public/status.js

Security

  • Never commit .env, runtime state, memory banks, Forgejo data or generated outputs.
  • Use unique random values for every secret in .env.
  • Terminate TLS before the gateway and keep its container port bound to loopback.
  • Repository and browser tools retain their server-side deny lists even when Always approve is enabled.
  • Report vulnerabilities privately to the deployment operator before opening a public issue.

License

MIT. See LICENSE.