Documentation

Diameter is an AI-native workspace. Bring your own agent — connect any AI to your workspace via our APIs. We provide the context, you provide the intelligence.

  • REST API — read and write tasks, artifacts, threads, and more
  • Real-Time Subscribe — WebSocket connection for live workspace events
  • CLI (di) — manage your workspace from the terminal
  • MCP Server (diameter-mcp) — give AI agents like Claude full access to your workspace context

Quick Start

Get up and running with Diameter in five minutes.

1. Create your account

Sign up at diameter.app/signup with your invite code. You'll need to verify your email before continuing.

2. Generate an API token

In the web app, go to your personal space (the ~ space) and open Settings. Under API Tokens, create a new token. Copy it — you'll need it for the CLI and MCP server.

3. Install the CLI

curl -fsSL https://raw.githubusercontent.com/dperrera/diameter/main/scripts/install.sh | sh

Or install via npm: npm install -g @diameter/cli

4. Connect Claude to your workspace

For Claude Desktop, add this to your claude_desktop_config.json:

{
  "mcpServers": {
    "diameter": {
      "command": "diameter-mcp",
      "env": {
        "DIAMETER_API_TOKEN": "your_token_here",
        "DIAMETER_API_URL": "https://diameter.app"
      }
    }
  }
}

For Claude Code, add to your .claude/settings.json:

{
  "mcpServers": {
    "diameter": {
      "command": "diameter-mcp",
      "env": {
        "DIAMETER_API_TOKEN": "your_token_here",
        "DIAMETER_API_URL": "https://diameter.app"
      }
    }
  }
}

5. Try it out

Ask Claude to interact with your workspace:

  • "List my spaces"
  • "Create a new document in my personal space about project ideas"
  • "What's the context of my workspace?"
  • "Create a task to review the Q1 report"

Troubleshooting

MCP server not connecting

Make sure the diameter-mcp binary is in your PATH. Run which diameter-mcp to verify. If not found, reinstall the CLI.

Permission denied errors

Your API token may have expired or have insufficient scopes. Generate a new token in the web app with all scopes enabled.

Tools not showing in Claude

Restart Claude Desktop or Claude Code after updating your MCP configuration. The MCP server should connect automatically on restart.

Getting Started

Install the CLI

curl -fsSL https://raw.githubusercontent.com/dperrera/diameter/main/scripts/install.sh | sh

Or install via npm:

npm install -g @diameter/cli

Log in

Authenticate by opening a browser-based login flow:

di login --url https://diameter.app

Verify

Confirm your session is active:

di whoami

Configure Claude Desktop for MCP

Add the Diameter MCP server to your claude_desktop_config.json:

{
  "mcpServers": {
    "diameter": {
      "command": "diameter-mcp",
      "env": {
        "DIAMETER_API_TOKEN": "your_token_here",
        "DIAMETER_API_URL": "https://diameter.app"
      }
    }
  }
}

Configure Claude Code for MCP

Add the Diameter MCP server to your .claude/settings.json or use claude mcp add:

{
  "mcpServers": {
    "diameter": {
      "command": "diameter-mcp",
      "env": {
        "DIAMETER_API_TOKEN": "your_token_here",
        "DIAMETER_API_URL": "https://diameter.app"
      }
    }
  }
}

Generate an API token in the Diameter web app under Settings.

REST API

All endpoints require a Bearer token with appropriate scopes. Base URL: https://api.diameter.app

curl https://api.diameter.app/v1/tasks \
  -H "Authorization: Bearer slp_your_token_here"

Endpoints

CommandDescription
GET /v1/spacesList your spaces
POST /v1/spacesCreate a shared space
GET /v1/tasksList tasks (filter by spaceId, status, assigneeId)
POST /v1/tasksCreate a task
PUT /v1/tasks/:idUpdate a task
DELETE /v1/tasks/:idDelete a task
GET /v1/artifactsList artifacts
POST /v1/artifactsCreate an artifact
PUT /v1/artifacts/:idUpdate an artifact
DELETE /v1/artifacts/:idDelete an artifact
GET /v1/threadsList threads
POST /v1/threadsCreate a thread
POST /v1/threads/:idAdd a message
GET /v1/eventsList events (activity timeline)
GET /v1/linksList links between entities
POST /v1/linksCreate a link

Creating Documents

Create a document artifact with content populated — the document is immediately editable in the workspace with full collaborative editing support.

curl -X POST https://api.diameter.app/v1/artifacts \
  -H "Authorization: Bearer slp_your_token_here" \
  -H "Content-Type: application/json" \
  -d '{
    "spaceId": "spc_xxx",
    "type": "document",
    "title": "Meeting Notes",
    "content": "# Summary\n\nKey decisions from today..."
  }'

The content field accepts plain text or markdown. The server generates the collaborative editing state automatically — no WebSocket connection required.

Context Endpoints

Structured summaries designed for AI consumption — everything an agent needs in one call.

CommandDescription
GET /v1/context/space/:idFull space context: tasks, artifacts, threads, events, members
GET /v1/context/artifact/:idArtifact with linked items, threads, and history
GET /v1/context/task/:idTask with dependencies, linked artifacts, and events

Authentication

Generate an API token in the web app under Settings. Tokens use the slp_ prefix and support scoped access.

Available scopes: spaces:read spaces:write tasks:read tasks:write artifacts:read artifacts:write threads:read threads:write events:read links:read links:write memories:read memories:write

Real-Time Subscribe

Connect via WebSocket to receive workspace events in real-time. Your agent maintains one persistent connection and sends context updates over the wire.

Connect

ws://api.diameter.app/v1/subscribe?token=slp_your_token_here

Token must have the events:read scope.

Server Messages

On connect, you receive your accessible spaces:

{
  "type": "connected",
  "userId": "usr_xxx",
  "spaces": [
    { "id": "spc_xxx", "name": "My Project", "slug": "my-project", "role": "owner" }
  ]
}

When something changes, you receive an event:

{
  "type": "event",
  "event": {
    "id": "evt_xxx",
    "spaceId": "spc_xxx",
    "spaceName": "My Project",
    "type": "created",
    "entityType": "task",
    "entityId": "tsk_xxx",
    "agentName": "Dan",
    "data": { "title": "New task" },
    "createdAt": "2026-02-20T13:55:29.376Z"
  }
}

Client Messages

Tell the server what you're focused on to filter events:

// Focus on a space (only receive events from this space)
{ "type": "focus", "spaceId": "spc_xxx" }

// Focus on a specific entity
{ "type": "focus", "spaceId": "spc_xxx", "entityType": "task", "entityId": "tsk_xxx" }

// Remove focus (receive all events)
{ "type": "unfocus" }

// Keep connection alive (5 min idle timeout)
{ "type": "ping" }

Event Types

CommandDescription
createdEntity was created
updatedEntity was modified
deletedEntity was removed
status_changedTask status changed (includes from/to)
commentedMessage added to a thread
linkedEntities were linked together
unlinkedLink was removed

Example

const ws = new WebSocket(
  "ws://api.diameter.app/v1/subscribe?token=slp_xxx"
);

ws.onmessage = (e) => {
  const msg = JSON.parse(e.data);

  if (msg.type === "connected") {
    // Focus on a specific space
    ws.send(JSON.stringify({
      type: "focus",
      spaceId: msg.spaces[0].id
    }));
  }

  if (msg.type === "event") {
    // React to workspace changes
    console.log(msg.event.agentName, msg.event.type, msg.event.entityType);
  }
};

// Keep alive
setInterval(() => {
  ws.send(JSON.stringify({ type: "ping" }));
}, 120_000);

Memory

Give your agent persistent, semantic memory scoped to each workspace. Store facts, search by meaning, and extract knowledge from conversations — all through the API.

Memory is bring-your-own-key. Configure your preferred embedding provider per space — OpenAI, Voyage AI, Cohere, or Ollama (local).

Configure a Provider

Before using memory, set up an embedding provider for your space:

curl -X PUT https://api.diameter.app/v1/memories/config \
  -H "Authorization: Bearer slp_your_token" \
  -H "Content-Type: application/json" \
  -d '{
    "spaceId": "spc_abc",
    "provider": "openai",
    "model": "text-embedding-3-small",
    "apiKey": "sk-your-openai-key",
    "dimensions": 1536
  }'

Available Providers

GET /v1/memories/providers

# Returns all supported providers and models:
# - OpenAI: text-embedding-3-small (1536d), text-embedding-3-large (3072d)
# - Voyage AI: voyage-3-lite (512d), voyage-3 (1024d)
# - Cohere: embed-english-v3.0 (1024d), embed-multilingual-v3.0 (1024d)
# - Ollama: nomic-embed-text (768d), mxbai-embed-large (1024d)

Store a Memory

curl -X POST https://api.diameter.app/v1/memories \
  -H "Authorization: Bearer slp_your_token" \
  -H "Content-Type: application/json" \
  -d '{
    "spaceId": "spc_abc",
    "content": "User prefers dark mode and compact layouts",
    "category": "preference"
  }'

# Categories: preference, decision, context, instruction, fact

Search Memories

Semantic search — find memories by meaning, not just keywords:

curl "https://api.diameter.app/v1/memories/search?spaceId=spc_abc&q=what+theme+does+the+user+like" \
  -H "Authorization: Bearer slp_your_token"

# Returns memories ranked by semantic similarity, each with a score (0-1)

Ingest from Conversations

Feed raw text and let Diameter extract discrete facts automatically. Duplicate facts (> 92% similarity) are skipped:

curl -X POST https://api.diameter.app/v1/memories/ingest \
  -H "Authorization: Bearer slp_your_token" \
  -H "Content-Type: application/json" \
  -d '{
    "spaceId": "spc_abc",
    "text": "The client wants the dashboard redesigned by March. They prefer minimal UI with lots of whitespace. Budget is $15k."
  }'

# Extracts and stores:
# - "Client wants dashboard redesigned by March" (context)
# - "Client prefers minimal UI with lots of whitespace" (preference)
# - "Project budget is $15k" (fact)

Memory Profile

Get an aggregated view of all memories for a space, grouped by category:

GET /v1/memories/profile?spaceId=spc_abc

# Returns: { facts: { preference: [...], decision: [...], context: [...] }, count: 42 }

All Endpoints

MethodEndpointDescription
PUT/v1/memories/configConfigure embedding provider
GET/v1/memories/providersList available providers
POST/v1/memoriesStore a memory
GET/v1/memories/searchSemantic search
POST/v1/memories/ingestExtract and store facts from text
GET/v1/memories/profileAggregated facts by category
GET/v1/memoriesList all memories
GET/v1/memories/:idGet a single memory
DELETE/v1/memories/:idDelete a memory

Scopes

Memory endpoints require memories:read and/or memories:write scopes on your API token. New tokens include these by default.

CLI Reference

The di CLI gives you full access to your Diameter workspace from the terminal. All commands support --help for detailed usage.

Auth

CommandDescription
di loginLog in via browser
di logoutLog out and clear token
di config --showShow current configuration
di whoamiShow current user identity

Spaces

CommandDescription
di spaces listList all spaces
di spaces show <id>Show space details
di spaces create <name>Create a shared space
di spaces context <id>Get full AI-readable context

Tasks

CommandDescription
di tasks listList tasks (filter with --status, --mine)
di tasks create <title>Create a task (-p priority, -d description)
di tasks update <id>Update task properties
di tasks done <id>Mark task complete
di tasks start <id>Mark task in progress
di tasks depends <id> <depends-on>Add dependency

Artifacts

CommandDescription
di artifacts listList artifacts (-t filter by type)
di artifacts show <id>Show artifact details (--content for full text)
di artifacts create [title]Create artifact (-t type, -c content)
di artifacts update <id>Update artifact
di artifacts upload <file>Upload a file

Threads

CommandDescription
di threads listList threads
di threads show <id>Show thread with messages
di threads createStart a conversation
di threads reply <id> <message>Add message to thread

Context

CommandDescription
di context space <id>Full space context (AI-optimized)
di context artifact <id>Artifact context
di context task <id>Task context with dependencies
di context eventsEvent timeline

Global flags: --json for raw output, --api-url and --token for overriding config.

MCP Server Setup

The Diameter MCP server gives Claude (or any MCP-compatible agent) direct access to your workspace. It uses stdio transport, the standard mechanism for local MCP servers.

The server requires two environment variables:

  • DIAMETER_API_TOKEN — your personal API token
  • DIAMETER_API_URL — URL of your Diameter instance
  • DIAMETER_COLLAB_URL — WebSocket URL of the collaboration server (optional, enables real-time editing)

See Getting Started for full configuration instructions for Claude Desktop and Claude Code.

MCP Tools Reference

These tools are available to any MCP-connected agent. Each tool maps to a Diameter API operation.

Spaces

ToolDescription
list_spacesList all spaces
get_spaceGet space details
create_spaceCreate a new space

Tasks

ToolDescription
list_tasksList tasks in a space
get_taskGet task details
create_taskCreate a new task
update_taskUpdate task properties
complete_taskMark a task as complete
add_task_dependencyAdd a dependency between tasks
remove_task_dependencyRemove a task dependency

Artifacts

ToolDescription
list_artifactsList artifacts in a space
get_artifactGet artifact details
create_artifactCreate a new artifact
update_artifactUpdate an artifact
delete_artifactDelete an artifact

Threads

ToolDescription
list_threadsList threads in a space
get_threadGet thread with messages
create_threadCreate a new thread
add_messageAdd a message to a thread

Links

ToolDescription
list_linksList links between entities
create_linkCreate a link between entities
delete_linkRemove a link

Context

ToolDescription
get_space_contextFull project overview (artifacts, tasks, threads, events, members)
get_artifact_contextEverything about an artifact and its connections
get_task_contextTask with dependencies, linked items, history

Events

ToolDescription
get_eventsTimeline with filtering by space, entity type, date range

Agents

ToolDescription
list_agentsList all agents
get_agentGet agent details
whoamiCurrent authenticated identity

Assets

ToolDescription
list_assetsList assets in a space
get_assetGet asset details
upload_assetUpload a file asset
delete_assetDelete an asset

Themes

ToolDescription
list_themesList available themes
get_themeGet theme details

Real-Time Editing

Requires DIAMETER_COLLAB_URL. These tools connect via Y.js for live collaborative editing.

ToolDescription
get_document_contentGet live markdown content from the collaboration server
set_document_contentReplace document markdown (appears immediately in editors)
join_documentJoin as a live collaborator (appears as "Claude" in the editor)
leave_documentLeave a document and remove collaborator presence
set_document_cursorSet visible cursor/selection in a document

MCP Resources

MCP resources provide read-only context that agents can pull into their working memory. These URIs are available via the standard MCP resource protocol.

  • diameter://spaces — List of workspaces
  • diameter://whoami — Current identity
  • diameter://context-guide — Guide for using context tools
  • diameter://space/{id} — Specific space context
  • diameter://task/{id} — Specific task context
  • diameter://artifact/{id} — Specific artifact context