Files
agentic-coding-workflow/internal/mcp/server.go
T
q792602257 7d9164d478 feat(mcp): 16 PM tools + chat tool + 6 resource URIs + admin token UI
Phase F: tools_pm.go — list/get/create/update/close/reopen/assign for
projects, workspaces, requirements, issues (16 tools total).

Phase G: tools_chat.go — list_recent_messages tool; resources.go — 6 PM
resource URI templates (projects, project-detail, requirements, issues,
workspaces, workspace-detail).

Phase H: frontend admin UI — mcpTokens API client, Pinia store,
MCPTokenAdminView with create/revoke/list, router entry, NavBar link.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-05-08 11:27:47 +08:00

43 lines
1.2 KiB
Go

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
}
// registerChatTools 已在 tools_chat.go 中实现。
// registerResources 已在 resources.go 中实现。
// registerPMTools 已在 tools_pm.go 中实现。