mcp_agent

command
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Example: mcp_agent demonstrates connecting an agent to a Model Context Protocol (MCP) server and importing its tools into the agent's registry.

It launches the official filesystem MCP server over stdio, registers every tool the server exposes, and prints them. If an OpenAI API key is present, the agent then answers a prompt that can use those tools.

Prerequisites (for a live run):

npm install -g @modelcontextprotocol/server-filesystem   # or use npx

Run:

go run ./examples/mcp_agent/

The example degrades gracefully: if the MCP server binary is not installed, it prints the connection error and exits 0 so it stays CI-safe.

Jump to

Keyboard shortcuts

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