Skip to content

Commit fa6e7b9

Browse files
committed
🤖 refactor: remove mcp-stdio mode
1 parent 039ab0b commit fa6e7b9

4 files changed

Lines changed: 6 additions & 103 deletions

File tree

‎app_dispatch.go‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,19 @@ import (
1111
"github.com/coder/coder-k8s/internal/app/mcpapp"
1212
)
1313

14-
const supportedAppModes = "controller, aggregated-apiserver, mcp-stdio, mcp-http"
14+
const supportedAppModes = "controller, aggregated-apiserver, mcp-http"
1515

1616
var (
1717
runControllerApp = controllerapp.Run
1818
runAggregatedAPIServerApp = apiserverapp.Run
19-
runMCPStdioApp = mcpapp.RunStdio
2019
runMCPHTTPApp = mcpapp.RunHTTP
2120
setupSignalHandler = ctrl.SetupSignalHandler
2221
)
2322

2423
func run(args []string) error {
2524
fs := flag.NewFlagSet("coder-k8s", flag.ContinueOnError)
2625
var appMode string
27-
fs.StringVar(&appMode, "app", "", "Application mode (controller, aggregated-apiserver, mcp-stdio, mcp-http)")
26+
fs.StringVar(&appMode, "app", "", "Application mode (controller, aggregated-apiserver, mcp-http)")
2827
if err := fs.Parse(args); err != nil {
2928
return err
3029
}
@@ -34,8 +33,6 @@ func run(args []string) error {
3433
return runControllerApp(setupSignalHandler())
3534
case "aggregated-apiserver":
3635
return runAggregatedAPIServerApp(setupSignalHandler())
37-
case "mcp-stdio":
38-
return runMCPStdioApp(setupSignalHandler())
3936
case "mcp-http":
4037
return runMCPHTTPApp(setupSignalHandler())
4138
case "":

‎docs/how-to/mcp-server.md‎

Lines changed: 4 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22

33
This guide shows how to run the `coder-k8s` **MCP server** for local development and in-cluster access.
44

5-
The MCP server supports two app modes:
6-
7-
- `mcp-stdio` for stdio-based MCP clients (for example, Mux).
8-
- `mcp-http` for HTTP-based MCP clients.
5+
The MCP server runs in HTTP mode (`--app=mcp-http`).
96

107
## 1. Overview
118

@@ -17,43 +14,7 @@ The MCP server provides tools for inspecting Kubernetes resources managed by `co
1714
- Namespace events
1815
- Pod logs
1916

20-
## 2. Stdio mode (Mux / local development)
21-
22-
Run stdio mode locally from this repository:
23-
24-
```bash
25-
GOFLAGS=-mod=vendor go run . --app=mcp-stdio
26-
```
27-
28-
Run stdio mode in-cluster via `kubectl exec`:
29-
30-
```bash
31-
kubectl exec -i -n coder-system deploy/coder-k8s-mcp -- /coder-k8s --app=mcp-stdio
32-
```
33-
34-
Example Mux MCP configuration (`~/.mux/mcp.jsonc`):
35-
36-
```jsonc
37-
{
38-
"mcpServers": {
39-
"coder-k8s": {
40-
"command": "kubectl",
41-
"args": [
42-
"exec",
43-
"-i",
44-
"-n",
45-
"coder-system",
46-
"deploy/coder-k8s-mcp",
47-
"--",
48-
"/coder-k8s",
49-
"--app=mcp-stdio"
50-
]
51-
}
52-
}
53-
}
54-
```
55-
56-
## 3. HTTP mode (port-forward / remote clients)
17+
## 2. HTTP mode (port-forward / remote clients)
5718

5819
Apply RBAC, deployment, and service manifests:
5920

@@ -75,7 +36,7 @@ Connect MCP clients to:
7536
http://127.0.0.1:8090/mcp
7637
```
7738

78-
## 4. Available tools
39+
## 3. Available tools
7940

8041
The server exposes MCP tools for:
8142

@@ -84,7 +45,7 @@ The server exposes MCP tools for:
8445
- Listing namespace events for troubleshooting
8546
- Reading pod logs for debugging
8647

87-
## 5. Health checks
48+
## 4. Health checks
8849

8950
<!-- cspell:ignore healthz readyz -->
9051

‎internal/app/mcpapp/stdio.go‎

Lines changed: 0 additions & 27 deletions
This file was deleted.

‎main_test.go‎

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -119,34 +119,6 @@ func TestRunDispatchesAggregatedAPIServerMode(t *testing.T) {
119119
}
120120
}
121121

122-
func TestRunDispatchesMCPStdioMode(t *testing.T) {
123-
t.Helper()
124-
installMockSignalHandler(t)
125-
126-
previous := runMCPStdioApp
127-
t.Cleanup(func() {
128-
runMCPStdioApp = previous
129-
})
130-
131-
expectedErr := errors.New("sentinel mcp-stdio error")
132-
called := false
133-
runMCPStdioApp = func(ctx context.Context) error {
134-
called = true
135-
if ctx == nil {
136-
t.Fatal("expected non-nil context passed to MCP stdio runner")
137-
}
138-
return expectedErr
139-
}
140-
141-
err := run([]string{"--app=mcp-stdio"})
142-
if !called {
143-
t.Fatal("expected MCP stdio runner to be called")
144-
}
145-
if !errors.Is(err, expectedErr) {
146-
t.Fatalf("expected sentinel error %v, got %v", expectedErr, err)
147-
}
148-
}
149-
150122
func TestRunDispatchesMCPHTTPMode(t *testing.T) {
151123
t.Helper()
152124
installMockSignalHandler(t)

0 commit comments

Comments
 (0)