Admin tools for Claude: an MCP server, connected with an admin's approval
- services/mcp: the MCP server at /mcp (Streamable HTTP, stateless): the admin's reading tools, the daily tasks and the forum's moderation; every tool calls the site's API with the caller's token, and members' e-mail addresses and names are masked in the answers. - Backend: OAuth 2.1 for MCP clients (registration with Claude's or a local return address only, PKCE, rotating refresh tokens, revocation); the admin guards accept the token for reading and the writes in MCP_WRITES only. - Forum: an admin's token reaches the moderator endpoints only. - Frontend: the approval page (/oauth/engedely), Admin → Claude to revoke a connection, the authorization server's metadata at its standard address. - Deploy: the mcp service in compose, Caddy, CI; the worker removes old codes, tokens and clients. docs/mcp.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
@@ -113,6 +113,8 @@ services:
|
||||
# Cloudflare Turnstile on the e-mail sign-up and reset forms (the
|
||||
# TURNSTILE_SECRET_KEY is in .env.secrets). Without both: no check.
|
||||
TURNSTILE_SITE_KEY: ${TURNSTILE_SITE_KEY:-}
|
||||
# The MCP server's address, the audience of its tokens (docs/mcp.md).
|
||||
MCP_RESOURCE_URL: https://${DOMAIN}/mcp
|
||||
# The log also goes to the logs volume, one file a day, kept 30 days
|
||||
# (deploy/README.md: Logs).
|
||||
LOG_DIR: /logs
|
||||
@@ -238,6 +240,24 @@ services:
|
||||
logging: *logging
|
||||
restart: unless-stopped
|
||||
|
||||
# The admin tools for Claude (docs/mcp.md): Claude connects to
|
||||
# https://${DOMAIN}/mcp (Caddy), an admin approves it on the site, and every
|
||||
# tool calls the site's API through the frontend with that admin's token.
|
||||
mcp:
|
||||
image: ${REGISTRY_PREFIX:-registry.sagifer.com/sagifer/sorsfonalak}-mcp:${TAG_MCP:-${TAG:-latest}}
|
||||
environment:
|
||||
API_URL: http://frontend:3000/api/v1
|
||||
PUBLIC_BASE_URL: https://${DOMAIN}
|
||||
MCP_PUBLIC_URL: https://${DOMAIN}/mcp
|
||||
LOG_DIR: /logs
|
||||
depends_on:
|
||||
- frontend
|
||||
read_only: true
|
||||
volumes:
|
||||
- logs:/logs
|
||||
logging: *logging
|
||||
restart: unless-stopped
|
||||
|
||||
# Beszel agent: CPU, memory, disk, network and per-container stats for the
|
||||
# Beszel hub on the home NAS. Off unless COMPOSE_PROFILES=monitoring and
|
||||
# BESZEL_KEY (the hub's public key) are in .env. It listens only on the
|
||||
@@ -257,7 +277,7 @@ services:
|
||||
|
||||
volumes:
|
||||
pgdata:
|
||||
# Backend, worker and forum logs (backend.YYYY-MM-DD.log, worker…, worker-ai…, forum…).
|
||||
# Backend, worker, forum and MCP logs (backend.YYYY-MM-DD.log, worker…, worker-ai…, forum…, mcp…).
|
||||
logs:
|
||||
caddy-data:
|
||||
caddy-config:
|
||||
|
||||
Reference in New Issue
Block a user