---
title: "Mcp Put Context"
method: PUT
path: "/v1/mcp/projects/{project_id}/context"
tags: ["mcp"]
---

# Mcp Put Context

`PUT /v1/mcp/projects/{project_id}/context`

## Request

- Base URL: `https://api.sonenta.dev`
- URL: `https://api.sonenta.dev/v1/mcp/projects/{project_id}/context`
- Auth: none declared

Upsert the project's context document (`mcp:*` OR `project:settings:write`).

Accepts a plain agent key (`mcp:*`) — like this route's GET twin and the
glossary writes (`mcp_create_glossary`, McpPrincipal). The context document is
the SAME class of translator prompt-knowledge as the glossary (brand voice,
tone, glossary notes) — already `mcp:*`-READABLE — and its "propagates to every
translation" property is shared with the glossary, so it does not justify a
stricter gate than the glossary has. Gating the very `mcp:*` credential our
docs tell the CLI to mint protected nothing (cf. task 1844). An admin-minted
`project:settings:write` key still works. The HUMAN dashboard PUT
(`routes/project_context.py`) stays `ProjectAdmin` — unchanged.

## Path parameters

- `project_id` string, required

## Request body

- McpContextIn
  - `content` string, required: UTF-8 markdown; size limit 100 KiB

## Response `200`

Successful Response

- McpContextOut: MCP-side view of the project context document. `updated_by_user_uuid` is null when an API key (not a user) wrote the document — the audit log holds the precise actor (user_uuid OR api_key_uuid) for every write. `updated_at=null` AND the previous field being null means the document was never written, content is the default.
  - `content` string, required
  - `updated_at` string, date-time, nullable, required
  - `updated_by_user_uuid` string, nullable, required
  - `size_bytes` integer, required

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/sonenta/apis/sonenta-api.md) · [All operations](https://skmtc.dev/sonenta/apis/sonenta-api/llms.txt) · [OpenAPI document](https://skmtc.dev/sonenta/apis/sonenta-api/revisions/f853ea49fb05?raw)
