fix: actually wire STDIO attach for docker-image MCP servers
All checks were successful
CI/CD / typecheck (pull_request) Successful in 52s
CI/CD / lint (pull_request) Successful in 1m43s
CI/CD / test (pull_request) Successful in 1m2s
CI/CD / build (pull_request) Successful in 1m45s
CI/CD / publish-rpm (pull_request) Has been skipped
CI/CD / publish-deb (pull_request) Has been skipped
CI/CD / smoke (pull_request) Successful in 9m51s
All checks were successful
CI/CD / typecheck (pull_request) Successful in 52s
CI/CD / lint (pull_request) Successful in 1m43s
CI/CD / test (pull_request) Successful in 1m2s
CI/CD / build (pull_request) Successful in 1m45s
CI/CD / publish-rpm (pull_request) Has been skipped
CI/CD / publish-deb (pull_request) Has been skipped
CI/CD / smoke (pull_request) Successful in 9m51s
Commit 1bd5087 added attachInteractive to the orchestrator interface
but never hooked it up in mcp-proxy-service — sendViaPersistentAttach
was promised in the commit message but missing from the diff. Servers
with a distroless image whose entrypoint IS the MCP server (gitea-mcp)
ended up needing a bogus `command: [node, dist/index.js]` workaround
that silently failed on every exec, leaving clients with empty tool
lists.
Changes:
- PersistentStdioClient: take a StdioMode discriminated union. Exec
mode runs a command via execInteractive; attach mode talks to PID 1
via attachInteractive.
- mcp-proxy-service: dispatch by config — command → exec; packageName
→ exec via runtime runner; dockerImage-only → attach. Error
serialization no longer drops non-Error objects as "[object Object]".
- templates/gitea.yaml: remove the command workaround; the image CMD
runs as PID 1 and mcpd attaches.
- Add unit tests covering both modes and the unsupported-orchestrator
paths.
Also required (separate repo): mcpd's k8s Role needed pods/attach
added alongside pods/exec; updated in kubernetes-deployment/…/mcpctl/server.ts
and kubectl-patched on the live cluster.
Verified end-to-end against mcpctl.ad.itaz.eu:
- gitea (attach): 49 tools listed, real tools/call round-trip.
- aws-docs (exec via packageName): 4 tools, no regression.
- docmost (exec via command): 11 tools, no regression.
- mcpd suite: 634/634 passing.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -4,12 +4,10 @@ description: Gitea MCP server for repositories, issues, PRs, and code management
|
||||
dockerImage: "docker.gitea.com/gitea-mcp-server:latest"
|
||||
transport: STDIO
|
||||
repositoryUrl: https://gitea.com/gitea/gitea-mcp
|
||||
command:
|
||||
- /app/gitea-mcp
|
||||
- -t
|
||||
- stdio
|
||||
# Health check disabled: STDIO health probe requires packageName (npm-based servers).
|
||||
# This server uses a custom dockerImage. Probe support for dockerImage STDIO servers is TODO.
|
||||
# No command: the image's entrypoint IS the MCP server. mcpd attaches to PID 1
|
||||
# stdin/stdout (attach mode) rather than exec-ing a new process. The image is
|
||||
# distroless and has no node/shell, so exec-based STDIO would fail.
|
||||
# Health check disabled: STDIO health probe requires node in the container.
|
||||
env:
|
||||
- name: GITEA_HOST
|
||||
description: Gitea instance URL (e.g. https://gitea.example.com)
|
||||
|
||||
Reference in New Issue
Block a user