last9-mcp-server: Instructions file for Codex

AGENTS.md

last9-mcp-server AGENTS.md is an instructions file for Codex, OpenCode from last9/last9-mcp-server. It costs 5,611 tokens per session, scanned A, original, Apache-2.0.

Repository instructions for last9-mcp-server, a Go server that provides tools through the Model Context Protocol (MCP), a standard way for AI agents to use software tools.

In plain words
What is it for?
Use them when adding or changing an MCP tool, its description, or its tool group. They explain which files to edit and which registration path to use.
Why use it?
They keep tool descriptions, registration, filtering, and error handling in the expected places, reducing the chance that a new tool is unavailable or incorrectly configured.

Instructions file for CodexOpenCode

Written for Codex and OpenCode: the file is AGENTS.md. Also seen: mentions CLAUDE.md.

This is last9/last9-mcp-server's own configuration. It tells Codex and OpenCode how to work on last9-mcp-server itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything last9-mcp-server configures →

Reuse

Borrowing it

Nothing to install: this file belongs to last9/last9-mcp-server. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/last9/last9-mcp-server/main/AGENTS.md
Clone the repo
git clone --depth 1 https://github.com/last9/last9-mcp-server

Made for: Codex, OpenCode.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for last9-mcp-server AGENTS.md

README.md
[![agentmods](https://agentmods.dev/badge/instructions/last9/last9-mcp-server/agents-md/github.svg)](https://agentmods.dev/instructions/last9/last9-mcp-server/agents-md)
Your own site
<a href="https://agentmods.dev/instructions/last9/last9-mcp-server/agents-md"><img src="https://agentmods.dev/badge/instructions/last9/last9-mcp-server/agents-md/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for last9-mcp-server AGENTS.md

Your own site · 80×15
<a href="https://agentmods.dev/instructions/last9/last9-mcp-server/agents-md"><img src="https://agentmods.dev/badge/instructions/last9/last9-mcp-server/agents-md.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 5,611 This file is loaded in full into every session.
When invoked 5,611 The same file — it is already loaded in full.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.05611 $0.05611
Opus 5.5 $0.02244 $0.02244
Sonnet 5.5 $0.01122 $0.01122
Haiku 4.5 $0.00561 $0.00561

Measured 4d ago against content hash f70e27770aea, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

last9-mcp-server AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 470 lines

How it starts

The opening of the file, as written. The whole thing — 470 lines — stays where its author put it; the contents beside it link to each section on GitHub.

last9-mcp-server — agent instructions

Canonical agent guidance for this repo. CLAUDE.md is a compatibility shim that includes this file — edit here, not there.

This is a public repo. Never put internal backend paths, handler or route names, customer names, or infrastructure identifiers in code, comments, docs, commits, or PRs.

Orientation

An MCP server in Go (module last9-mcp) that exposes Last9 observability as tools, prompts, and resources.

Root files

file role
main.go startup, config, subcommands, stdio/HTTP transport
tools.go every tool registration
resources.go reference resources (last9://reference/...)
dump.go dump-tools / dump-prompts — builds a server without credentials
http_server.go --http mode

internal/

package role
last9api the single door for HTTP calls to the Last9 API
apm, alerting, dashboards, telemetry, change_events, suggest tool handlers
prompts embedded tool descriptions and reference manuals
workflows MCP prompts
toolsets which tools belong to which --toolsets domain
models, constants, utils, auth, deeplink, otelids shared plumbing

Commands

go build .
go test -race ./...          # integration tests skip without TEST_REFRESH_TOKEN
go run . dump-tools          # served tools/list, name-sorted, plus instructions; no credentials
go run . dump-prompts        # served prompts/list
./scripts/start-local.sh     # run against a local .env
./scripts/eval-r10.sh        # eval suites against a fresh build of this checkout

Adding a tool, end to end

  1. New API endpoint? Add internal/last9api/<area>/<endpoint>.go — see Calling the Last9 API. Skip if the endpoint already exists.
  2. Description — write internal/prompts/descriptions/<tool_name>.md and embed it in internal/prompts/prompts.go as <Tool>Description — see Tool descriptions.
  3. Tool — create <package>/<tool_name>.go with its Args struct, its New<Tool>Handler, and its private helpers — see Go conventions.
  4. Register — add to tools.go via registerIfAllowed (registerWriteTool for a tool that changes state), and add the tool name to its domain in internal/toolsets/toolsets.go — see Registration.
  5. Test — <tool_name>_test.go using httptest.NewServer; run go test -race ./....
  6. Verify — go run . dump-tools shows the tool with the intended description and schema.
  7. CHANGELOG — one bullet at the top of its section in [Unreleased].

Read the full file on GitHub · 470 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago Changed · +11 lines · +131 tokens per session f70e27770aea
  2. 5d ago Changed · +4 lines · +62 tokens per session 5faf70e48ade
  3. 6d ago Changed · +2 lines · +29 tokens per session 035554a71785
  4. 11d ago Changed · +7 lines · +67 tokens per session 147eeff8f2d5
  5. 16d ago Changed · +2 lines · +22 tokens per session 59a428befb3b
  6. 18d ago Changed · +6 lines · +99 tokens per session c68db6acf1e7
  7. 19d ago Changed · +9 lines · +175 tokens per session eb80d676902a
  8. 20d ago Changed · +38 lines · +672 tokens per session 4a3227297f5d
  9. 21d ago Changed · +14 lines · +213 tokens per session 167185c67014
  10. 1mo ago First seen · 377 lines · 4,141 tokens per session scan A 8ed4084af6dc

Subscribe to this mod's changes

last9-mcp-server AGENTS.md is an instructions file published in the GitHub repository last9/last9-mcp-server (63 stars, last pushed yesterday), licensed Apache-2.0. It adds 5,611 tokens to every session, about $0.0224 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

last9-mcp-server AGENTS.md compared with instructions from other repositories

last9-mcp-server AGENTS.md next to 6 instructions from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
last9-mcp-server AGENTS.mdlast9/last9-mcp-serverInstructions file63yesterdayApache-2.0A5,611Codex, OpenCode
vscode buildNext.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA9,719GitHub Copilot
vscode oss-third-party-notices.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA5,516GitHub Copilot
next.js AGENTS.mdvercel/next.jsInstructions file143kyesterdayMITA7,461Codex, OpenCode
langchain AGENTS.mdlangchain-ai/langchainInstructions file149ktodayMITA4,680Codex, OpenCode
vscode copilot-instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA3,093GitHub Copilot
vscode model-prompts.instructions.mdmicrosoft/vscodeInstructions file195ktodayMITA2,022GitHub Copilot