mcpserver

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 5, 2026 License: GPL-3.0 Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package mcpserver 用官方 go-sdk 构建 sctl 的 stdio MCP server:把 protocol.json 定义的 bridge action 暴露成 MCP 工具,并在阻塞等待(写审批 / 源码披露)期间周期发送 progress 通知(支持的 客户端可借此续期工具超时)。

扁平信任:接入(enrollment)建立可信通道后,MCP agent 继承信任、无需各自配对,故 tools/list 暴露全部工具;权威授权仍在扩展侧(写操作审批 / 源码披露闸门)。

stdout 由 MCP 协议独占:本包绝不向 stdout 写任何东西,日志走全局 stderr/文件 logger。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(d Deps) *mcp.Server

New 按依赖构建 MCP server,注册 protocol.json 里定义的全部 bridge action 工具。

Types

type BridgeCaller

type BridgeCaller interface {
	Call(ctx context.Context, action string, input json.RawMessage) (control.CallResult, error)
}

BridgeCaller 抽象「向 daemon 转发一次 bridge action 调用」,便于测试注入桩。

type Deps

type Deps struct {
	Name    string
	Version string
	Proto   *protocol.Protocol
	Caller  BridgeCaller
}

Deps 是构建 MCP server 所需依赖。扁平信任下不再按客户端 scope 过滤:注册 protocol.json 中 定义了的全部工具。

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL