---
name: curtext-brain
description: Use when you need knowledge held in a Curtext brain at https://curtxt.com - team reference documents, standing instructions and skills, readable over MCP or a plain REST API.
---

# Reading a Curtext brain

Curtext (https://curtxt.com) hosts workspaces whose knowledge bases ("brains") are
served over the Model Context Protocol, and over a REST API for callers
that speak no MCP. Both doors are read-only and serve the same brain.

## Connecting

- Endpoint: `https://curtxt.com/mcp` (MCP Streamable HTTP, JSON-RPC 2.0, POST only)
- Auth: `Authorization: Bearer <token>` on every request. Two kinds of
  token work, and both read exactly what the PERSON behind them can read.

### Sign in as yourself (OAuth 2.1)

If your client speaks OAuth, use it - it needs no shared secret, and the
person authorizes their own access:

- Discovery: `https://curtxt.com/.well-known/oauth-protected-resource` and
  `https://curtxt.com/.well-known/oauth-authorization-server`. The endpoint's own
  401 names the first of those in `WWW-Authenticate`.
- Register yourself at `https://curtxt.com/oauth/register` (RFC 7591) if you have
  no client id, then run the authorization code flow. PKCE with S256 is
  required; `resource=https://curtxt.com/mcp` should be sent on both requests.
- One consent gets you every brain that person can read, and it follows
  their access from then on. Access tokens start `cta_` and last an
  hour; refresh to renew.
- A workspace can keep its own brain out of outside connections, and an
  account can close the door for all of its workspaces. A brain you
  expected and cannot see is a setting, not a bug: ask the team, do not
  retry.

### Or a key someone gives you

A key is minted by a person in Curtext under **User settings ->
Connections**; unlike a token it is scoped to ONE workspace's brain, and
like a token it reads exactly what its issuer can read. Keys start
`ctk_` and do not expire until revoked. They exist for callers with no
browser to sign in with - prefer OAuth if you have one.

Example, Claude Code:

```
claude mcp add --transport http curtext https://curtxt.com/mcp --header "Authorization: Bearer <key>"
```

## What the server offers

- Tool `list_documents` - every brain document as path, title and
  one-line summary. Call this first. It answers from ONE brain - the
  default the person chose - because two teams' standing instructions in
  one context contradict each other.
- Tool `list_brains` - every brain you can read, and which is the
  default. Call it when the task might be served by another one, then
  pass that name as `brain` to `list_documents`. Work in one brain
  at a time.
- Tool `read_document {path}` - the full markdown of one document. Read
  a document when it bears on your task rather than guessing at
  something it would settle.
- `resources/list` + `resources/read` - the same documents for
  resource-aware clients (`curtext:///<path>` URIs). The list is the
  default brain; a URI from any brain you can read will open.
- `prompts/list` + `prompts/get` - the default brain's skills: how
  this team wants particular tasks done. Each prompt's description says when
  it applies; when one matches your task, fetch it and follow it.

## If you cannot speak MCP

The same brain is served over plain HTTP at `https://curtxt.com/v1` - for batch
jobs, scripts and systems with no MCP client. Prefer MCP if you have it:
this door has to be switched on by an account, and a 403 means it is not.

- Auth: `Authorization: Bearer <key>` with an ACCOUNT key - it starts
  `ctx_` and is minted by an owner or admin under **Account settings ->
  Integrations**. Like every credential here it reads exactly what the
  person who minted it can read.
- `GET /v1/workspaces` - which brains this key serves, with a document
  count each. Start here; it is `list_brains`.
- `GET /v1/documents?workspace=NAME` - that brain's manifest, as JSON.
  It is `list_documents`, and `workspace` may only be left off when
  the key serves exactly one.
- `GET /v1/documents/<path>` - one document as raw markdown, not JSON.
  It is `read_document`. Any path from any listing this key can reach
  will open; anything else is a 404.
- `GET /v1` lists the endpoints back to you. Human docs, with worked
  examples: `https://curtxt.com/docs`.

## Rules

- Read-only: neither door mutates the workspace. Do not try to write.
- Both are stateless: no MCP session id is issued or required, and the
  REST door takes its workspace per request - there is nothing to switch.
- Rate-limit yourself to what a person reading would need; list once,
  read the few documents that matter.
