docs / grandstack-agents / Agents
AGENTS.md: guide for coding agents
How agents work with GraphQL: an MCP server that runs GraphQL statements, and a direct agent-loop example. It uses the open grandstack-server (no auth); docs/adding-auth.md shows the auth variant.
Commands
npm ci
npm test # unit and integration tests, no Docker needed
npm run typecheck
npm run docs:check # links, anchors, alt text, SVGs, diagram legends
npm run mcp:http # MCP over HTTP on :4100 (needs the stack for real use)
npm run mcp:stdio
npm run live # needs the open stack up
The stack (grandstack umbrella): docker compose -f compose.yaml -f compose.agents.yaml up --build.
Where things are
src/graphql.tsthe guarded executor (parse, classify, timeout, size cap); every request goes through it.src/tools.tsthe four tools;src/mcp.tsregisters them;src/agent.tshas the loop and the singlegraphqltool.docs/explains all of it;docs/diagrams/has annotated SVGs (the checker verifies legends).
Rules
- Keep mutations off by default (
ALLOW_MUTATIONS). Do not weaken that or the lane checks without a test. - Tool errors are returned as text with
isError, not thrown. - No auth in this repo’s default path. Auth lives in
examples/with-authandgrandstack-auth. - Pin
@modelcontextprotocol/sdkand use v1-style imports.graphqlmust stay 16.x. - Do not claim in docs what you did not run. The live Claude run is not exercised by tests; keep saying so until it is.
- Add a test for every new tool or guardrail (
test/tools.test.ts,test/mcp.test.ts). - New code files need the copyright header (two lines:
Copyright (c) "Neo4j"andNeo4j Sweden AB [http://neo4j.com], in the file’s comment syntax). Runnode ../grandstack/scripts/add-headers.mjs(ornode ../.github/scripts/headers.mjs --root .for one repository) to add it;--checklists what is missing. Generated files are exempt. - Releases use the release-cut workflow (Actions tab), which sets the version in every
package.json, tags and publishes. Do not bump versions or push tags by hand; seegrandstack/docs/releasing.md.
Source: grandstack-agents/AGENTS.md (this page is a copy; edit it in the repository)