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, 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, open any shared space and go to Settings. Under API Tokens, create a new token. Copy it , you'll need it for the CLI and MCP server.
3. Install the CLI binary
curl -fsSL https://raw.githubusercontent.com/dperrera/diameter/main/scripts/install.sh | shThis installs di into ~/.diameter/bin by default.
4. Install the MCP binary
curl -fsSL https://raw.githubusercontent.com/dperrera/diameter/main/scripts/install-mcp.sh | shThis installs diameter-mcp into ~/.diameter/bin by default.
5. Connect your agent
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 this to ~/.claude/mcp.json:
{
"mcpServers": {
"diameter": {
"command": "diameter-mcp",
"env": {
"DIAMETER_API_TOKEN": "your_token_here",
"DIAMETER_API_URL": "https://diameter.app"
}
}
}
}For Codex, register the same local MCP server from the CLI:
codex mcp add diameter \
--env DIAMETER_API_TOKEN=your_token_here \
--env DIAMETER_API_URL=https://diameter.app \
-- diameter-mcp6. Try it out
Ask Claude or Codex to interact with your workspace:
- "List my spaces"
- "Create a new document in our planning 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 MCP binary with install-mcp.sh.
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 binary
curl -fsSL https://raw.githubusercontent.com/dperrera/diameter/main/scripts/install.sh | shThis installs di into ~/.diameter/bin by default.
Install the MCP binary
curl -fsSL https://raw.githubusercontent.com/dperrera/diameter/main/scripts/install-mcp.sh | shLog in
Authenticate by opening a browser-based login flow:
di login --url https://diameter.appVerify
Confirm your session is active:
di whoamiConfigure 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/mcp.json:
{
"mcpServers": {
"diameter": {
"command": "diameter-mcp",
"env": {
"DIAMETER_API_TOKEN": "your_token_here",
"DIAMETER_API_URL": "https://diameter.app"
}
}
}
}Configure Codex for MCP
Register the local MCP server directly from the Codex CLI:
codex mcp add diameter \
--env DIAMETER_API_TOKEN=your_token_here \
--env DIAMETER_API_URL=https://diameter.app \
-- diameter-mcpVerify the saved config with codex mcp get diameter --json.
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 dia_your_token_here"Endpoints
| Command | Description |
|---|---|
| GET /v1/spaces | List your spaces |
| POST /v1/spaces | Create a shared space |
| GET /v1/tasks | List tasks (filter by spaceId, status, assigneeId) |
| POST /v1/tasks | Create a task |
| PUT /v1/tasks/:id | Update a task |
| DELETE /v1/tasks/:id | Delete a task |
| GET /v1/threads | List threads |
| POST /v1/threads | Create a thread |
| POST /v1/threads/:id | Add a message |
| GET /v1/events | List events (activity timeline) |
| GET /v1/links | List links between entities |
| POST /v1/links | Create a link |
Context Endpoints
Structured summaries designed for AI consumption , everything an agent needs in one call.
| Command | Description |
|---|---|
| GET /v1/context/space/:id | Full space context: tasks, threads, events, members |
| GET /v1/context/task/:id | Task with dependencies, threads, and events |
Authentication
Generate an API token in the web app under Settings. Tokens use the dia_ prefix and support scoped access.
Available scopes: spaces:read spaces:write tasks:read tasks:write threads:read threads:write events:read links:read links: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=dia_your_token_hereToken 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
| Command | Description |
|---|---|
| created | Entity was created |
| updated | Entity was modified |
| deleted | Entity was removed |
| status_changed | Task status changed (includes from/to) |
| commented | Message added to a thread |
| linked | Entities were linked together |
| unlinked | Link was removed |
Example
const ws = new WebSocket(
"ws://api.diameter.app/v1/subscribe?token=dia_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);CLI Reference
The di CLI gives you full access to your Diameter workspace from the terminal. All commands support --help for detailed usage.
Auth
| Command | Description |
|---|---|
| di login | Log in via browser |
| di logout | Log out and clear token |
| di config --show | Show current configuration |
| di whoami | Show current user identity |
Spaces
| Command | Description |
|---|---|
| di spaces list | List 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
| Command | Description |
|---|---|
| di tasks list | List 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 |
Threads
| Command | Description |
|---|---|
| di threads list | List threads |
| di threads show <id> | Show thread with messages |
| di threads create | Start a conversation |
| di threads reply <id> <message> | Add message to thread |
Context
| Command | Description |
|---|---|
| di context space <id> | Full space context (AI-optimized) |
| di context task <id> | Task context with dependencies |
| di context events | Event timeline |
Global flags: --json for raw output, --api-url and --token for overriding config.
MCP Server Setup
The Diameter MCP server gives Claude, Codex, and any MCP-compatible agent direct access to your workspace. It uses stdio transport, the standard mechanism for local MCP servers.
Install the standalone binary first:
curl -fsSL https://raw.githubusercontent.com/dperrera/diameter/main/scripts/install-mcp.sh | shThe server requires two environment variables:
DIAMETER_API_TOKEN, your API tokenDIAMETER_API_URL, URL of your Diameter instanceDIAMETER_COLLAB_URL, WebSocket URL of the collaboration server (optional, enables real-time editing)
See Getting Started for full configuration instructions for Claude Desktop, Claude Code, and Codex.
MCP Tools Reference
These tools are available to any MCP-connected agent. Each tool maps to a Diameter API operation.
Spaces
| Tool | Description |
|---|---|
| list_spaces | List all spaces |
| get_space | Get space details |
| create_space | Create a new space |
Tasks
| Tool | Description |
|---|---|
| list_tasks | List tasks in a space |
| get_task | Get task details |
| create_task | Create a new task |
| update_task | Update task properties |
| complete_task | Mark a task as complete |
| add_task_dependency | Add a dependency between tasks |
| remove_task_dependency | Remove a task dependency |
Threads
| Tool | Description |
|---|---|
| list_threads | List threads in a space |
| get_thread | Get thread with messages |
| create_thread | Create a new thread |
| add_message | Add a message to a thread |
Links
| Tool | Description |
|---|---|
| list_links | List links between entities |
| create_link | Create a link between entities |
| delete_link | Remove a link |
Context
| Tool | Description |
|---|---|
| get_space_context | Full project overview (tasks, threads, events, members) |
| get_task_context | Task with dependencies, linked items, history |
Events
| Tool | Description |
|---|---|
| get_events | Timeline with filtering by space, entity type, date range |
Agents
| Tool | Description |
|---|---|
| list_agents | List all agents |
| get_agent | Get agent details |
| whoami | Current authenticated identity |
Assets
| Tool | Description |
|---|---|
| list_assets | List assets in a space |
| get_asset | Get asset details |
| upload_asset | Upload a file asset |
| delete_asset | Delete an asset |
Themes
| Tool | Description |
|---|---|
| list_themes | List available themes |
| get_theme | Get theme details |
Real-Time Editing
Requires DIAMETER_COLLAB_URL. These tools connect via Y.js for live collaborative editing.
| Tool | Description |
|---|---|
| get_document_content | Get live markdown content from the collaboration server |
| set_document_content | Replace document markdown (appears immediately in editors) |
| join_document | Join as a live collaborator (appears as "Claude" in the editor) |
| leave_document | Leave a document and remove collaborator presence |
| set_document_cursor | Set 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 workspacesdiameter://whoami, Current identitydiameter://context-guide, Guide for using context toolsdiameter://space/{id}, Specific space contextdiameter://task/{id}, Specific task context