Skip to content

Commit b05ea85

Browse files
committed
document mcp setup and quiet http request logging
1 parent 0986eaf commit b05ea85

2 files changed

Lines changed: 45 additions & 4 deletions

File tree

README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ npmx effect-devtui
3636
- ⌨️ **Keyboard Navigation** - Vim-style navigation (j/k) with intuitive shortcuts
3737
- 🎨 **Split Panel Layout** - Side-by-side view of data and detailed information
3838
- 🚀 **Lightweight** - Runs in any terminal, no GUI required
39+
- 🤖 **MCP Server for Agents** - Exposes read-only observability tools for LLM agents over HTTP
3940

4041
## Setup
4142

@@ -93,6 +94,48 @@ const DevToolsLive = DevTools.layer("ws://host.docker.internal:34437");
9394

9495
If you're using `@effect/opentelemetry`, provide the `DevTools` layer **before** your tracing layers to ensure the tracer is patched correctly.
9596

97+
### MCP Server (Agent Access)
98+
99+
`effect-devtui` also starts an MCP server automatically when the TUI starts.
100+
101+
- **Transport**: HTTP
102+
- **Default endpoint**: `http://localhost:34438/mcp`
103+
- **Server name**: `effect-devtools`
104+
- **Access model**: read-only tools over in-memory DevTools state
105+
106+
Available tools:
107+
108+
- `list_spans`
109+
- `get_span`
110+
- `get_active_spans`
111+
- `list_clients`
112+
- `get_metrics`
113+
- `get_span_tree`
114+
115+
This lets coding agents query live observability data (spans/metrics/clients) while you run your Effect app and the DevTools TUI.
116+
117+
#### Client setup examples
118+
119+
Claude Code (recommended via CLI, no JSON editing):
120+
121+
```bash
122+
claude mcp add --transport http effect-devtui http://localhost:34438/mcp
123+
```
124+
125+
OpenCode (`~/.config/opencode/opencode.json`):
126+
127+
```json
128+
{
129+
"mcp": {
130+
"effect-devtools": {
131+
"type": "remote",
132+
"url": "http://127.0.0.1:34438/mcp",
133+
"enabled": true
134+
}
135+
}
136+
}
137+
```
138+
96139
## Comparison with VS Code Extension
97140

98141
This TUI complements the VS Code extension by focusing on **observability and code analysis**, while the extension provides debugging capabilities and IDE integration.

src/mcp/server.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77

88
import * as McpServer from "@effect/ai/McpServer";
9-
import { HttpRouter, HttpServer, HttpMiddleware } from "@effect/platform";
9+
import { HttpRouter, HttpServer } from "@effect/platform";
1010
import { BunHttpServer } from "@effect/platform-bun";
1111
import * as Layer from "effect/Layer";
1212
import * as Effect from "effect/Effect";
@@ -56,9 +56,7 @@ export const makeMcpLayer = (getStore: () => StoreState) => {
5656
const HttpServerLive = BunHttpServer.layer({ port: MCP_PORT });
5757

5858
// Combine everything: serve the router with MCP routes
59-
return HttpRouter.Default.unwrap(
60-
HttpServer.serve(HttpMiddleware.logger),
61-
).pipe(
59+
return HttpRouter.Default.unwrap(HttpServer.serve()).pipe(
6260
HttpServer.withLogAddress,
6361
Layer.provide(McpLive),
6462
Layer.provide(HttpServerLive),

0 commit comments

Comments
 (0)