revert: remove MCP Gitea integration, restore direct REST client

Remove all MCP-related infrastructure in favor of direct REST API calls.
MCP added layers without value: Docker container, stdio bridge, hybrid fallback,
healthchecks, SSE transport — all of which added failure modes and token overhead.

Deleted:
- docker/mcp-gitea/docker-compose.yml (MCP container config)
- scripts/mcp-gitea-stdio.cjs (stdio bridge)
- scripts/e2e-mcp-stdio-test*.py (MCP E2E tests)
- scripts/test-kilo-mcp-integration.py
- src/kilocode/agent-manager/mcp-gitea-client.ts (548 lines of MCP wrapper)
- MCP-STDIO-SETUP.md (MCP documentation)
- .vscode/settings.json (hardcoded MCP config with token)
- .kilo/skills/mcp-gitea-connection/ and mcp-gitea.research.md

Restored:
- pipeline-runner.ts: HybridGiteaClient → GiteaClient (direct REST)
  Removed MCP dependency, imports, and initialization.
  No healthcheck waits, no container startup delays.
- process-continuity.md: removed MCP-specific failure modes
- e2e-gns2-test.py: removed Basic Auth, use token auth; fixed spec reference
This commit is contained in:
NW
2026-05-09 01:55:52 +01:00
parent 0f522e61c3
commit 67e8d2e41a
14 changed files with 50 additions and 1697 deletions

View File

@@ -1,88 +0,0 @@
# GNS-2: MCP Gitea Integration Container
# Operator-Free Design — lessons learned from Phase 8 failures
# See: .kilo/rules/process-continuity.md
#
# FIXED: No service_healthy deadlock, no hardcoded IP, no SSE-only transport
# Uses Hybrid MCP↔REST client with automatic fallback
# MCP SSE supported for clients that support it; REST fallback for shell
services:
mcp-gitea:
build:
context: https://github.com/Sqcows/forgejo-mcp.git#main
dockerfile: Dockerfile
container_name: mcp-gitea
environment:
# Gitea/Forgejo instance config
FORGEJO_URL: https://git.softuniq.eu
# Fallback dummy token allows container startup; replace in .env
FORGEJO_TOKEN: ${FORGEJO_TOKEN:-dummy-fallback-token}
# MCP server HTTP mode
PORT: 3001
FORGEJO_MCP_API_KEY: ${FORGEJO_MCP_API_KEY:-changeme}
RATE_LIMIT_MAX: 1000
RATE_LIMIT_WINDOW_MS: 60000
LOG_LEVEL: info
ports:
- "3001:3001"
networks:
- gns-network
# Resilience: on-failure with generous start window
restart: on-failure:3
stop_grace_period: 10s
healthcheck:
# /tools is always available (list of 103 tools)
test: ["CMD", "wget", "-qO-", "http://localhost:3001/tools"]
interval: 15s
timeout: 10s
retries: 5
start_period: 60s
# Security: non-root user built into Dockerfile; no new privileges
cap_drop:
- ALL
security_opt:
- no-new-privileges:true
# tmpfs for Node.js /tmp needs (read-write, but noexec)
tmpfs:
- /tmp:noexec,nosuid,size=50m
deploy:
resources:
limits:
cpus: '0.5'
memory: 256M
reservations:
cpus: '0.25'
memory: 128M
# Optional metrics sidecar — NO service_health dependency
# Starts even if main container unhealthy; checks periodically
mcp-gitea-health:
image: busybox:latest
container_name: mcp-gitea-health
command: >
sh -c "
sleep 30; # Wait for main container to start
while true; do
if wget -qO- http://mcp-gitea:3001/tools > /dev/null 2>&1; then
echo '$(date -u +%Y-%m-%dT%H:%M:%SZ) MCP Gitea: HEALTHY';
else
echo '$(date -u +%Y-%m-%dT%H:%M:%SZ) MCP Gitea: UNHEALTHY';
fi;
sleep 30;
done
"
networks:
- gns-network
depends_on:
mcp-gitea:
condition: service_started # Just wait for start, not healthy
restart: on-failure:3
networks:
gns-network:
driver: bridge
# --- Operator check after start ---
# Run: docker compose -f docker/mcp-gitea/docker-compose.yml logs -f mcp-gitea
# Look for: "HTTP server listening on port 3001"
# Then test: curl http://localhost:3001/tools | head