Agents

Built for two kinds of agents

Two kinds of agents, two layers of MCP. In production, the agents your users bring call your data with the same login and permissions the users have. While you build, gofastr dev hands your coding agent the running app.

production MCPdev MCPauto llm.mddiscoverylocal search

Production MCP tools

Turn on MCP and every CRUD entity gets tools an agent can call. The tools run through the same auth, owner, and tenant checks as your HTTP API — an agent gets exactly the access its user has, and nothing more.

main.go
5 lines
fwApp := framework.NewUIHostApp(host,    framework.WithConfig(framework.AppConfig{Name: "app"}),    framework.WithMCP(),              // entities get MCP tools at /mcp    framework.WithMCPIntrospection(),)
/docs/agent-ready →

Dev MCP

gofastr dev hands your coding agent — Claude Code, Codex — the running app over MCP: it reads routes, config, readiness, embedded docs, and recent logs, and it can write app data through the same entity tools your API serves. It's livereload for agents; opt out with GOFASTR_DEV_MCP=0.

4 lines
# GOFASTR_DEV=1 mounts the dev MCP tools for your coding agent:#   app_routes, app_config, app_readiness, framework_docs_*, log_recent#   + every CRUD entity's data tools (posts_list, posts_create, …)gofastr dev
/docs/dev-livereload →

Auto llm.md

Every screen and every entity ships an llm.md automatically — a plain-text description an agent reads to understand the page or the API. On by default; opt one out with NoLLMMD.

/docs/agent-ready →

Discovery endpoints

Turn on the agent-ready host options and your app serves the files agent scanners look for — an llms.txt and the .well-known endpoints — so an agent can find what your app does.

3 lines
GET /llms.txtGET /.well-known/agent-card.jsonGET /.well-known/agent.json
/docs/agent-ready →

battery/semantic indexes a corpus locally and answers similarity queries — no external API key, works offline.

search.go
6 lines
idx, _ := semantic.Open(semantic.Options{    Embedder: semantic.NewStubEmbedder(128),    Keyword:  semantic.NewMemoryKeyword(),})idx.Add(ctx, docs...)hits, _ := idx.Query(ctx, semantic.Query{Text: "how do hooks work", K: 5, Hybrid: true})
/docs/semantic-search →