Skip to main content
Glama
README.md
# threadline-mcp

MCP server for [Threadline](https://www.threadline.to) — the memory governance layer for AI agents.

Use Threadline's persistent, user-consented memory in any MCP-compatible client: Cursor, Claude Desktop, or your own agent.

## Install

```bash
npm install -g threadline-mcp
```

## Setup

Get your API key at [threadline.to/dashboard](https://www.threadline.to/dashboard).

### Claude Desktop

Add to `claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "threadline": {
      "command": "threadline-mcp",
      "env": {
        "THREADLINE_API_KEY": "tl_live_your_key_here"
      }
    }
  }
}
```

### Cursor

Add to your MCP config in Cursor settings:

```json
{
  "threadline": {
    "command": "threadline-mcp",
    "env": {
      "THREADLINE_API_KEY": "tl_live_your_key_here"
    }
  }
}
```

### Any MCP client

```bash
THREADLINE_API_KEY=tl_live_your_key_here threadline-mcp
```

## Tools

### `inject`

Inject user context into a base system prompt before an LLM call.

```json
{
  "userId": "user-uuid",
  "basePrompt": "You are a helpful assistant."
}
```

Returns an enriched prompt with relevant facts about the user automatically inserted.

### `update`

Update a user's context after an LLM interaction. Extracts and stores structured facts for future sessions.

```json
{
  "userId": "user-uuid",
  "userMessage": "I prefer concise answers and I'm building in TypeScript.",
  "agentResponse": "Got it, keeping it brief."
}
```

## How it works

```
Your MCP client (Cursor / Claude Desktop)
        │
        ▼
threadline-mcp (this package)
        │
        ▼
api.threadline.to
        │
   ┌────┴────┐
   ▼         ▼
Supabase   Redis
(context)  (<50ms)
```

- `inject()` — fetches stored context, scores by recency + relevance, returns enriched prompt
- `update()` — two-stage extraction pipeline classifies and stores new facts across 7 scopes

## Links

- Docs: [threadline.to/docs](https://www.threadline.to/docs)
- Dashboard: [threadline.to/dashboard](https://www.threadline.to/dashboard)
- Support: vidur@threadline.to

TDQS

B3.2/5.0

Scored across 2 tools

Disambiguation5/5

The two tools have clearly distinct purposes: 'inject' handles pre-LLM call context insertion, while 'update' handles post-interaction context extraction and storage. There is no overlap in functionality, making them easily distinguishable for an agent.

Naming Consistency5/5

Both tools use simple, imperative verb names ('inject' and 'update') that are consistent in style and length. This follows a predictable pattern without any deviations or mixed conventions.

Tool Count2/5

With only 2 tools, the server feels thin for its apparent purpose of managing user context across LLM interactions. A typical context management system might benefit from additional operations like retrieving or deleting context, making this set under-scoped.

Completeness3/5

The tools cover the core workflow of injecting and updating user context, but there are notable gaps. For example, there is no tool to retrieve stored context for review or delete outdated context, which could limit agent functionality in multi-session scenarios.

Maintenance

ActivityInactive
ResponsivenessNo issues