charly

vielhuber/charly

3.2

If you are the rightful owner of charly and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

The Model Context Protocol (MCP) server is a specialized server designed to manage and facilitate communication between clients and machine learning models, ensuring efficient data exchange and model execution.

🦸🏽‍♂️ charly 🦸🏽‍♂️

a comprehensive model context protocol (mcp) server gateway that integrates multiple mcp servers with unified authentication through oauth2 and bearer tokens including a convenient web client.

requirements

  • python (>= 3.0)
  • php (>=8.1)
  • mysql (>=8.0)

usage

server

  • uvicorn app:app --host 0.0.0.0 --port 8000
  • cloudflared tunnel run --url http://localhost:8000 TUNNEL

client

  • open https://your-client-tld.local

installation

setup

  • git clone git@github.com:vielhuber/charly.git .
server
  • cd server
  • cp config.example.json config.json
  • vi config.json
  • python -m venv venv
  • source venv/bin/activate
  • pip install -r requirements.txt
client
  • cd client
  • cp .env.example .env
  • vi .env
  • php ./_php/auth/index.php migrate
  • php ./_php/auth/index.php create "david@vielhuber.de" "secret"
  • setup vhost (apache/nginx with ssl) that points to /client/_public
worker

development

php ./_php/api/Worker.php

production

sudo apt-get install supervisor
sudo nano /etc/supervisor/conf.d/charly-worker.conf
[program:charly-worker]
command=php /var/www/charly/client/_php/api/Worker.php
directory=/var/www/charly/client
autostart=true
autorestart=true
redirect_stderr=true
stdout_logfile=/var/log/supervisor/charly-worker.log
sudo service supervisor start
sudo supervisorctl reread
sudo supervisorctl update
sudo supervisorctl start charly-worker
tail -f /var/log/supervisor/charly-worker.log

update

  • git pull

cloudflare

auth0

browser
  • applications > applications > create application
    • type: Single Page Web Applications
    • allowed callback urls: https://*.ngrok-free.app/auth/auth/callback,https://your-custom-domain.com/auth/auth/callback
    • copy Client ID and Client Secret (and fill in ./server/config.json)
  • test
    • chatgpt.com / claude.ai: login via browser
    • mcp inspector: start oauth flow or simply click "connect" (the browser redirects); remove "add custom headers"!
api
  • applications > applications > create application
    • type: Machine to Machine Applications
    • api: auth0 management api > permissions: all
    • copy Domain, Client ID and Client Secret (and fill in ./client/.env))
  • test
    • create token xxx (e.g. via curl) to authorize with bearer token
    • mcp inspector: add custom headers: Authorization: Bearer xxx
    • claude api / chatgpt api / openai playground: "authorization_token": "xxx"
curl \
    -s -X POST \
    https://%YOUR_API_DOMAIN%/oauth/token \
    -H "Content-Type: application/json" \
    -d '
        {
            "client_id":"%YOUR_CLIENT_ID%",
            "client_secret":"%YOUR_CLIENT_SECRET%",
            "audience":"%YOUR_API_DOMAIN%/api/v2/",
            "grant_type":"client_credentials"
        }
    ' \
    | jq -r '.access_token' | xclip -selection clipboard

recommended mcp servers

for example configurations of the following servers, see .

filesystem

mcp-filesystem-server

word

Office-Word-MCP-Server

email

mailhelper

whatsapp

wahelper

browser

playwright

anki

anki-mcp-server

  • url
  • installation
    • Anki Desktop > Extras > Erweiterungen > Erweiterungen herunterladen > 2055492159 > Neustart
    • /root/.nvm/versions/node/v22.20.0/bin/npm install -g anki-mcp-server
    • nano /root/.nvm/versions/node/v22.20.0/lib/node_modules/anki-mcp-server/dist/index.js
      • replace localhost with 192.168.0.2 (2 times)
    • cmd (admin):
      • netsh interface portproxy show v4tov4
      • netsh interface portproxy delete v4tov4 listenaddress=192.168.0.2 listenport=12306
      • netsh interface portproxy add v4tov4 listenaddress=192.168.0.2 listenport=12306 connectaddress=127.0.0.1 connectport=12306
      • if these rules are available but don't work
        • net stop iphlpsvc && net start iphlpsvc
    • powershell (admin):
      • New-NetFirewallRule -DisplayName "chrome-mcp" -Direction Inbound -LocalPort 12306 -Action Allow -Protocol TCP

local chrome

mcp-chrome

  • url
  • installation
    • add fresh chrome profile
    • unzip downloaded extension in ~/
    • open chrome://extensions/ > load unpacked extension > choose folder
    • windows (not wsl)
      • npm install -g mcp-chrome-bridge
      • mcp-chrome-bridge register
    • start server in chrome extension
    • wsl
      • cmd (admin):
        • netsh interface portproxy show v4tov4
        • netsh interface portproxy delete v4tov4 listenaddress=192.168.0.2 listenport=12306
        • netsh interface portproxy add v4tov4 listenaddress=192.168.0.2 listenport=12306 connectaddress=127.0.0.1 connectport=12306
        • if these rules are available but don't work
          • net stop iphlpsvc && net start iphlpsvc
      • powershell (admin):
        • New-NetFirewallRule -DisplayName "chrome-mcp" -Direction Inbound -LocalPort 12306 -Action Allow -Protocol TCP
      • test:
        • windows: http://127.0.0.1:12306/mcp
        • wsl: http://192.168.0.2:12306/mcp (local ip from ipconfig)

custom php application

php-mcp

<?php
require_once __DIR__ . '/vendor/autoload.php';
use Monolog\Logger;
use Monolog\Level;
use Monolog\Handler\StreamHandler;
use PhpMcp\Server\Server;
use PhpMcp\Server\Transports\StdioServerTransport;
try {
    $server = Server::make()
        ->withServerInfo('MCP Server', '1.0.0')
        ->withLogger((new Logger('mcp'))->pushHandler(new StreamHandler(__DIR__ . '/mcp-server.log', Level::Debug)))
        ->build();
    $server->discover(basePath: __DIR__, scanDirs: ['.']);
    $server->listen(new StdioServerTransport());
} catch (\Throwable $e) {
    fwrite(STDERR, '[CRITICAL ERROR] ' . $e->getMessage() . "\n");
    die();
}

custom js application

typescript-sdk