MCP remoto: servidor Streamable HTTP como servicio del compose

- mcp/http.js: MCP por HTTP (sin estado). Cada petición lleva la contraseña de aplicación
  del propio usuario (Basic o Bearer); se valida contra WordPress (caché 5 min), exige
  permiso de edición y no se guarda. Límite por IP, /healthz, IP real reenviada a WordPress.
- Herramientas comunes en mcp/src/tools.js (local y remoto); en remoto las fotos van por
  URL o base64 (sin acceso a archivos del servidor).
- Dockerfile del MCP y servicio «mcp» en docker-compose.yml.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-25 11:25:42 +02:00
parent a39f9f170c
commit 68783ca0b7
11 changed files with 493 additions and 216 deletions

View File

@@ -1,12 +1,20 @@
{
"name": "bilagun-mcp",
"version": "1.0.0",
"description": "MCP server to manage the Bilagun website (animals, photos, material needs) through its REST API.",
"version": "1.1.0",
"description": "MCP server to manage the Bilagun website (animals, photos, material needs) through its REST API. Local (stdio) or remote (HTTP).",
"type": "module",
"bin": { "bilagun-mcp": "index.js" },
"bin": {
"bilagun-mcp": "index.js",
"bilagun-mcp-http": "http.js"
},
"main": "index.js",
"engines": { "node": ">=20" },
"scripts": { "start": "node index.js" },
"engines": {
"node": ">=20"
},
"scripts": {
"start": "node index.js",
"start:http": "node http.js"
},
"dependencies": {
"@modelcontextprotocol/sdk": "^1.30.1",
"zod": "^4.6.5"