---
title: "Build with AI — JustTCG API"
description: "Use the JustTCG docs with AI agents and LLMs: Markdown for every page, llms.txt, a public docs MCP server, the OpenAPI spec, changelog feeds, and a ready-made AGENTS.md snippet."
url: https://justtcg.com/docs/ai
markdown_url: https://justtcg.com/docs/ai.md
---

# Build with AI

New

Everything an AI coding agent or LLM needs to use JustTCG correctly: Markdown for every docs page, llms.txt, a public docs MCP server, the OpenAPI spec, and changelog feeds.

## Markdown for every page

Every docs page is available as clean Markdown, without the navigation and page chrome. Append `.md` to any docs URL, or send an `Accept: text/markdown` header to the normal page URL. Each Markdown file starts with front matter (`title`, `description`, `url`, `markdown_url`).

```bash
# Append .md to any docs URL
curl https://justtcg.com/docs/errors.md

# Or ask for Markdown with the Accept header
curl -H "Accept: text/markdown" https://justtcg.com/docs/errors
```

Reading in the browser? The **Copy page** menu at the top of each docs page copies the Markdown or opens the page in your AI assistant of choice.

## llms.txt and llms-full.txt

Two plain-text files follow the [llms.txt](https://llmstxt.org) convention. [/llms.txt](https://justtcg.com/llms.txt) is a short index of the API and its docs pages. [/llms-full.txt](https://justtcg.com/llms-full.txt) adds a longer overview (plans, licensing, FAQ) and then the full Markdown of every docs page in one file, for agents that want everything in a single fetch.

## Docs MCP server

A public, read-only [Model Context Protocol](https://modelcontextprotocol.io) server lets your agent search and read these docs directly. No API key is needed.

`POST https://justtcg.com/mcp/docs`

### Tools

| Tool | What it does |
| --- | --- |
| search\_docs | Keyword search across every docs page. Returns the best-matching sections with the page URL, section heading and a snippet. |
| get\_doc | Return one docs page as Markdown. Accepts /docs/errors, docs/errors, a full URL, or any of those ending in .md. |
| list\_docs | List every docs page with its title, URL, Markdown URL and description. |
| get\_changelog | Return API changelog entries, optionally only those on or after a date (since, YYYY-MM-DD). |

### Install

```bash
npx add-mcp https://justtcg.com/mcp/docs
```

```bash
claude mcp add --transport http justtcg-docs https://justtcg.com/mcp/docs
```

```json
{
  "mcpServers": {
    "justtcg-docs": {
      "url": "https://justtcg.com/mcp/docs"
    }
  }
}
```

**Docs, not prices.** The docs server only returns documentation. To query live card prices from an agent, use the [pricing MCP server](https://justtcg.com/docs/api/mcp) below.

## Pricing MCP server

To let an agent query card prices, connect the hosted JustTCG pricing MCP server at `https://mcp.justtcg.com`. It is a separate server from the docs one and needs your API key. Setup and example prompts are on the [/mcp](https://justtcg.com/docs/api/mcp) page.

## OpenAPI spec

The machine-readable definition of the REST API is published at [https://justtcg.com/docs/swagger.json](https://justtcg.com/docs/swagger.json) (no key needed). Agent frameworks that build tools from OpenAPI can load it directly. See the [OpenAPI (Swagger)](https://justtcg.com/docs/openapi) page for import and client-generation instructions.

## Changelog feeds

Useful for agents and scheduled jobs that need to answer "what changed since my last sync?". The same entries are available in three formats, and the docs MCP server's `get_changelog` tool reads them too.

-   RSS: [/docs/changelog/feed.xml](https://justtcg.com/docs/changelog/feed.xml)
-   JSON Feed: [/docs/changelog.json](https://justtcg.com/docs/changelog.json)
-   Markdown: [/docs/changelog.md](https://justtcg.com/docs/changelog.md)

## Add JustTCG to your AGENTS.md or CLAUDE.md

Coding agents work best when your repo tells them how to use an API. Paste this into your `AGENTS.md` (or `CLAUDE.md`, `.cursorrules`, or similar) so the agent authenticates, batches, syncs and handles missing prices the way the API expects.

```markdown
## JustTCG API (trading card game pricing)

- Base URL: `https://api.justtcg.com/v1`. Authenticate with the `x-api-key` request header.
- Read the key from the `JUSTTCG_API_KEY` environment variable. Never hardcode it or commit it.
- In JavaScript/TypeScript, prefer the official SDK (`npm install justtcg-js`) over hand-written fetch calls. It reads `JUSTTCG_API_KEY` by default.
- Fetch many cards with one `POST /v1/cards` (a JSON array of lookups) instead of looping over `GET /v1/cards`. The array limit depends on the plan: 20 (Free), 100 (Starter, Pro), 200 (Enterprise). Chunk larger lists.
- For incremental sync, pass `updated_after` (Unix seconds) and store the time of your last successful sync, instead of re-fetching everything.
- Respect rate limits (https://justtcg.com/docs/rate-limits). On `429`, back off exponentially with jitter and honor `Retry-After` when present.
- Prices can be `null`. Branch on `priceStatus` (`current`, `expired`, `unpriced`) and use `lastKnownPrice` for expired variants. Never treat `null` as `0`. See https://justtcg.com/docs/thin-markets.
- Read the docs as Markdown: append `.md` to any docs URL (https://justtcg.com/docs/errors.md), or connect the docs MCP server at https://justtcg.com/mcp/docs (no key needed). Page index: https://justtcg.com/llms.txt.
- Before changing integration code, or when behavior changes unexpectedly, check the changelog JSON feed: https://justtcg.com/docs/changelog.json.
```

Details behind each line: [Quickstart](https://justtcg.com/docs/quickstart), [SDK](https://justtcg.com/docs/sdk), [/cards](https://justtcg.com/docs/api/cards), [Rate limits](https://justtcg.com/docs/rate-limits) and [Thin markets](https://justtcg.com/docs/thin-markets).
