Skip to content

TutorialEdge/go-ai-examples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go AI Examples

Companion code for the TutorialEdge AI-in-Go tutorials. Clone it, cd into any example, and run it — each one is small, self-contained, and matches the written tutorial (and video) step for step.

How this repo is organised

Every top-level directory is one tutorial and its own Go module, so each example is independently runnable and they never fight over dependencies. Pick the one you want and follow its steps below.

Example What you build Tutorial
adk-go-agent/ Your first AI agent with Google's Agent Development Kit (Gemini + agent + session + runner, streaming the reply) Build Your First AI Agent in Go with the ADK
mcp-server-go/ A Model Context Protocol server exposing a search_tutorials tool over stdio Building an MCP Server in Go
mcp-server-security-go/ Harden an MCP server: break it with path traversal, then add path confinement, input limits, output hygiene, rate limiting, and tool annotations MCP Server Security in Go

Also part of the series

Prerequisites

  • Go 1.23 or newer — some examples use range-over-function iterators (Go 1.23+).
  • An API key for whichever provider an example uses (see each example below). Keep keys in your environment or a secrets manager — never commit them.

adk-go-agent

Your first agent with the ADK for Go. Needs a Google AI Studio API key (get one free).

cd adk-go-agent
export GOOGLE_API_KEY="your-key-here"
go run .

It sends a question to a Gemini-backed agent and streams the answer to your terminal. Change the Instruction field in main.go to change the agent's whole personality — that's the heart of the tutorial.

mcp-server-go

A minimal MCP server built with mark3labs/mcp-go, speaking the Model Context Protocol over stdio. No API key required.

cd mcp-server-go
go build -o te-mcp .
./te-mcp        # speaks MCP over stdio

See mcp-server-go/README.md for a one-liner smoke test and how to wire it into a client like Claude.

mcp-server-security-go

The security follow-up to mcp-server-go: a deliberately vulnerable read_doc tool that the tutorial attacks with path traversal, then hardens step by step. No API key required.

cd mcp-server-security-go
go build -o te-mcp-secure .
./te-mcp-secure   # speaks MCP over stdio

See mcp-server-security-go/README.md for the attack payload and the three hardening steps.

License

MIT © Elliot Forbes / TutorialEdge.

About

Runnable companion code for the TutorialEdge AI-in-Go tutorials (ADK agents, MCP servers, and more).

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages