[agent/claude] Create a migration plan to replace the MCP SDK from github.c... #2

Closed
Virgil wants to merge 0 commits from agent/create-a-migration-plan-to-replace-the-m into dev
Member

Task

Create a migration plan to replace the MCP SDK from github.com/modelcontextprotocol/go-sdk to github.com/mark3labs/mcp-go.

Current state: 13 Go files in pkg/mcp/ import the official SDK. The package wraps an MCP server with tools, subsystems, and multiple transports (stdio, HTTP, TCP, Unix).

The new SDK (mcp-go) has:

  • server.NewMCPServer() instead of mcp.NewServer()
  • server.ServerFromContext(ctx) to get server in tool handlers
  • SendNotificationToAllClients(method, params) for pushing notifications
  • SendNotificationToClient(ctx, method, params) for targeted notifications
  • Session management with RegisterSession/UnregisterSession
  • server.WithToolCapabilities(true) etc for capabilities

The key motivation: we need to add claude/channel support (experimental capability) so the server can push events (inbox messages, dispatch completions, webhook events) into a running Claude Code session. The official SDK has unexported fields that make custom notifications impossible.

Please:

  1. Read ALL .go files in pkg/mcp/ (not tests) to understand current SDK usage
  2. Check mcp-go docs at github.com/mark3labs/mcp-go for the equivalent APIs
  3. Create a file-by-file migration plan mapping old types/functions to new ones
  4. Note any breaking changes or features that don't have direct equivalents
  5. Write the plan to docs/plans/2026-03-21-mcp-sdk-migration.md

Agent: claude
Commits: 1
Branch: agent/create-a-migration-plan-to-replace-the-m


Auto-created by core-agent dispatch system.
Co-Authored-By: Virgil virgil@lethean.io

## Task Create a migration plan to replace the MCP SDK from github.com/modelcontextprotocol/go-sdk to github.com/mark3labs/mcp-go. Current state: 13 Go files in pkg/mcp/ import the official SDK. The package wraps an MCP server with tools, subsystems, and multiple transports (stdio, HTTP, TCP, Unix). The new SDK (mcp-go) has: - server.NewMCPServer() instead of mcp.NewServer() - server.ServerFromContext(ctx) to get server in tool handlers - SendNotificationToAllClients(method, params) for pushing notifications - SendNotificationToClient(ctx, method, params) for targeted notifications - Session management with RegisterSession/UnregisterSession - server.WithToolCapabilities(true) etc for capabilities The key motivation: we need to add claude/channel support (experimental capability) so the server can push events (inbox messages, dispatch completions, webhook events) into a running Claude Code session. The official SDK has unexported fields that make custom notifications impossible. Please: 1. Read ALL .go files in pkg/mcp/ (not tests) to understand current SDK usage 2. Check mcp-go docs at github.com/mark3labs/mcp-go for the equivalent APIs 3. Create a file-by-file migration plan mapping old types/functions to new ones 4. Note any breaking changes or features that don't have direct equivalents 5. Write the plan to docs/plans/2026-03-21-mcp-sdk-migration.md **Agent:** claude **Commits:** 1 **Branch:** `agent/create-a-migration-plan-to-replace-the-m` --- Auto-created by core-agent dispatch system. Co-Authored-By: Virgil <virgil@lethean.io>
Virgil added 3 commits 2026-03-21 11:59:20 +00:00
Co-Authored-By: Virgil <virgil@lethean.io>
Co-Authored-By: Virgil <virgil@lethean.io>
Maps all 27 source files and 55 tool registrations from
github.com/modelcontextprotocol/go-sdk to github.com/mark3labs/mcp-go.
Covers handler signature adapter, transport strategy, subsystem interface
changes, and consumer impact. Key motivation: unlock SendNotificationToClient
for claude/channel event push.

Co-Authored-By: Virgil <virgil@lethean.io>
Author
Member

Verification Failed

Command: go test ./...

?   	forge.lthn.ai/core/mcp/cmd/brain-seed	[no test files]
?   	forge.lthn.ai/core/mcp/cmd/core-mcp	[no test files]
?   	forge.lthn.ai/core/mcp/cmd/mcpcmd	[no test files]
[2026-03-21T11:59:23Z] SECURITY sandbox escape detected root=/private/var/folders/k6/c05lqf4j1nz248lbk_n5wbj80000gn/T/TestSandboxing_Symlinks_Blocked2346405882/001 path=link attempted=/private/var/folders/k6/c05lqf4j1nz248lbk_n5wbj80000gn/T/TestSandboxing_Symlinks_Blocked2346405882/002/secret.txt user=snider
11:59:23 [SEC] MCP tool execution tool="process_start" command="echo" args=[hello] dir="" user="snider"
11:59:23 [SEC] MCP tool execution tool="process_start" command="" args=[] dir="" user="snider"
11:59:23 [SEC] MCP tool execution tool="process_start" command="/nonexistent/binary/that/does/not/exist" args=[] dir="" user="snider"
11:59:23 [ERR] mcp: process start failed command="/nonexistent/binary/that/does/not/exist" err=Service.StartWithOptions: failed to start process: fork/exec /nonexistent/binary/that/does/not/exist: no such file or directory op="Service.StartWithOptions" stack="Service.StartWithOptions"
11:59:23 [INF] MCP tool execution tool="process_list" running_only=false user="snider"
11:59:23 [SEC] MCP tool execution tool="process_start" command="echo" args=[listing] dir="" user="snider"
11:59:23 [INF] MCP tool execution tool="process_list" running_only=false user="snider"
11:59:23 [SEC] MCP tool execution tool="process_start" command="echo" args=[done] dir="" user="snider"
11:59:23 [INF] MCP tool execution tool="process_list" running_only=true user="snider"
11:59:23 [SEC] MCP tool execution tool="process_start" command="echo" args=[output_test] dir="" user="snider"
11:59:23 [INF] MCP tool execution tool="process_output" id="proc-1" user="snider"
11:59:23 [INF] MCP tool execution tool="process_output" id="" user="snider"
11:59:23 [INF] MCP tool execution tool="process_output" id="nonexistent-id" user="snider"
11:59:23 [ERR] mcp: process output failed id="nonexistent-id" err=process...

Exit code: 1

## Verification Failed **Command:** `go test ./...` ``` ? forge.lthn.ai/core/mcp/cmd/brain-seed [no test files] ? forge.lthn.ai/core/mcp/cmd/core-mcp [no test files] ? forge.lthn.ai/core/mcp/cmd/mcpcmd [no test files] [2026-03-21T11:59:23Z] SECURITY sandbox escape detected root=/private/var/folders/k6/c05lqf4j1nz248lbk_n5wbj80000gn/T/TestSandboxing_Symlinks_Blocked2346405882/001 path=link attempted=/private/var/folders/k6/c05lqf4j1nz248lbk_n5wbj80000gn/T/TestSandboxing_Symlinks_Blocked2346405882/002/secret.txt user=snider 11:59:23 [SEC] MCP tool execution tool="process_start" command="echo" args=[hello] dir="" user="snider" 11:59:23 [SEC] MCP tool execution tool="process_start" command="" args=[] dir="" user="snider" 11:59:23 [SEC] MCP tool execution tool="process_start" command="/nonexistent/binary/that/does/not/exist" args=[] dir="" user="snider" 11:59:23 [ERR] mcp: process start failed command="/nonexistent/binary/that/does/not/exist" err=Service.StartWithOptions: failed to start process: fork/exec /nonexistent/binary/that/does/not/exist: no such file or directory op="Service.StartWithOptions" stack="Service.StartWithOptions" 11:59:23 [INF] MCP tool execution tool="process_list" running_only=false user="snider" 11:59:23 [SEC] MCP tool execution tool="process_start" command="echo" args=[listing] dir="" user="snider" 11:59:23 [INF] MCP tool execution tool="process_list" running_only=false user="snider" 11:59:23 [SEC] MCP tool execution tool="process_start" command="echo" args=[done] dir="" user="snider" 11:59:23 [INF] MCP tool execution tool="process_list" running_only=true user="snider" 11:59:23 [SEC] MCP tool execution tool="process_start" command="echo" args=[output_test] dir="" user="snider" 11:59:23 [INF] MCP tool execution tool="process_output" id="proc-1" user="snider" 11:59:23 [INF] MCP tool execution tool="process_output" id="" user="snider" 11:59:23 [INF] MCP tool execution tool="process_output" id="nonexistent-id" user="snider" 11:59:23 [ERR] mcp: process output failed id="nonexistent-id" err=process... ``` **Exit code:** 1
Virgil added the
needs-review
label 2026-03-21 11:59:25 +00:00
Author
Member

Needs Review

Tests failed after rebase. Auto-merge gave up after retry.

Labelled needs-review for human attention.

## Needs Review Tests failed after rebase. Auto-merge gave up after retry. Labelled `needs-review` for human attention.
Virgil changed target branch from main to dev 2026-03-24 11:12:20 +00:00
Virgil closed this pull request 2026-03-24 11:19:24 +00:00

Pull request closed

Sign in to join this conversation.
No description provided.