Help us shape the future of Go! Take the 2026 Go Developer Survey

mcptool

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package mcptool provides integration with the Model Context Protocol (MCP). It allows agents to connect to external MCP servers via stdio (subprocess) or HTTP (SSE / streamable HTTP) and expose their tools as tool.Tool / tool.FuncTool instances.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddTool

func AddTool(src *mcp.Server, tl tool.FuncTool)

AddTool registers a tool.FuncTool on the given mcp.Server so it is exposed to MCP clients.

func Connect

func Connect(ctx context.Context, transport mcp.Transport) (*mcp.ClientSession, error)

Connect dials an MCP server over the given transport and returns a client session.

func ListTools

func ListTools(ctx context.Context, session *mcp.ClientSession) ([]tool.Tool, error)

ListTools enumerates the remote server's tools and wraps each as a tool.Tool.

Types

This section is empty.

Jump to

Keyboard shortcuts

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