mcpserver

package
v0.115.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

Package mcpserver exposes selected reads of a separately running local DataTug agent over MCP. It owns neither the agent process nor its policy session.

Index

Constants

View Source
const (
	DefaultAgentURL = "http://127.0.0.1:8989"
)

Variables

This section is empty.

Functions

func New

func New(client *Client, version string) *mcp.Server

New builds the MCP server. The SDK handles protocol negotiation and framing.

func Run

func Run(ctx context.Context, client *Client, version string, in io.ReadCloser, out io.WriteCloser) error

Run serves newline-delimited protocol JSON until stdin closes or ctx ends. The caller owns these streams; no startup text or agent links are printed.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client deliberately has no exported HTTP passthrough or configurable transport.

func NewClient

func NewClient(address string) (*Client, error)

NewClient accepts only a literal loopback address or localhost, with no path, credentials, query or fragment. Proxies and redirects are disabled: a redirect to another port must never receive the original agent's bearer token.

func (*Client) Close

func (c *Client) Close()

Close releases idle HTTP connections; the separately owned agent keeps running.

Jump to

Keyboard shortcuts

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