Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions go/pkg/mcp/mcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
"sync"

core "dappco.re/go"
corelog "dappco.re/go/log"
"dappco.re/go/process"
"dappco.re/go/ws"
"github.com/modelcontextprotocol/go-sdk/mcp"
Expand All @@ -32,7 +31,7 @@ type Service struct {
workspaceRoot string // Root directory for file operations (empty = cwd unless Unrestricted)
medium *coreMedium // Filesystem medium for sandboxed operations
subsystems []Subsystem // Additional subsystems registered via Options.Subsystems
logger *corelog.Logger // Logger for tool execution auditing
logger *core.Log // Logger for tool execution auditing
processService *process.Service // Process management service (optional)
wsHub *ws.Hub // WebSocket hub for real-time streaming (optional)
wsServer *http.Server // WebSocket HTTP server (optional)
Expand Down Expand Up @@ -83,7 +82,7 @@ func New(opts Options) (
server: server,
processService: opts.ProcessService,
wsHub: opts.WSHub,
logger: corelog.Default(),
logger: core.Default(),
processMeta: make(map[string]processRuntime),
}

Expand Down
14 changes: 9 additions & 5 deletions go/pkg/mcp/register.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func Register(c *core.Core) core.Result {
for _, name := range c.Services() {
r := c.Service(name)
if !r.OK {
continue
return r
}
if sub, ok := r.Value.(Subsystem); ok {
subsystems = append(subsystems, sub)
Expand Down Expand Up @@ -73,7 +73,7 @@ func (s *Service) OnStartup(ctx context.Context) core.Result {
return core.Ok(nil)
}

c.Command("mcp", core.Command{
if r := c.Command("mcp", core.Command{
Description: "Start the MCP server on stdio",
Action: func(opts core.Options) core.Result {
s.logger.Info("MCP stdio server starting")
Expand All @@ -82,9 +82,11 @@ func (s *Service) OnStartup(ctx context.Context) core.Result {
}
return core.Ok(nil)
},
})
}); !r.OK {
return r
}

c.Command("serve", core.Command{
if r := c.Command("serve", core.Command{
Description: "Start the MCP server with auto-selected transport",
Action: func(opts core.Options) core.Result {
s.logger.Info("MCP server starting")
Expand All @@ -93,7 +95,9 @@ func (s *Service) OnStartup(ctx context.Context) core.Result {
}
return core.Ok(nil)
},
})
}); !r.OK {
return r
}

return core.Ok(nil)
}
Expand Down
Loading