You've already forked agentic-coding-workflow
feat(mcp): add MCP Go SDK v1.6.0 + NewMCPServer scaffold with register stubs
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
package mcp
|
||||
|
||||
import (
|
||||
mcpsdk "github.com/modelcontextprotocol/go-sdk/mcp"
|
||||
|
||||
"github.com/yan1h/agent-coding-workflow/internal/chat"
|
||||
"github.com/yan1h/agent-coding-workflow/internal/project"
|
||||
"github.com/yan1h/agent-coding-workflow/internal/workspace"
|
||||
)
|
||||
|
||||
// ServerDeps 是装配 mcp.Server 所需的下游 service 集合。
|
||||
type ServerDeps struct {
|
||||
Caller *CallerResolver
|
||||
Projects project.ProjectService
|
||||
Reqs project.RequirementService
|
||||
Issues project.IssueService
|
||||
Workspaces workspace.WorkspaceService
|
||||
Templates chat.TemplateService
|
||||
Messages chat.MessageService
|
||||
Conversations chat.ConversationService
|
||||
}
|
||||
|
||||
// NewMCPServer 装配 SDK Server 实例并注册所有工具/prompts/resources。
|
||||
func NewMCPServer(deps ServerDeps) *mcpsdk.Server {
|
||||
srv := mcpsdk.NewServer(&mcpsdk.Implementation{
|
||||
Name: "agent-coding-workflow",
|
||||
Version: "0.1.0",
|
||||
}, nil)
|
||||
|
||||
// Phase F: 16 PM 工具
|
||||
registerPMTools(srv, deps)
|
||||
// Phase G: chat / prompts / resources
|
||||
registerChatTools(srv, deps)
|
||||
registerPrompts(srv, deps)
|
||||
registerResources(srv, deps)
|
||||
|
||||
return srv
|
||||
}
|
||||
|
||||
// register* 占位函数在后续 Phase F/G 实装时替换函数体。
|
||||
func registerPMTools(_ *mcpsdk.Server, _ ServerDeps) {}
|
||||
func registerChatTools(_ *mcpsdk.Server, _ ServerDeps) {}
|
||||
func registerPrompts(_ *mcpsdk.Server, _ ServerDeps) {}
|
||||
func registerResources(_ *mcpsdk.Server, _ ServerDeps) {}
|
||||
Reference in New Issue
Block a user