# MCP server



threadapi runs a remote MCP server. There's nothing to install: point your client at the URL, then sign in to threadapi when the client asks, or send an API key.

|               |                                                                                    |
| :------------ | :--------------------------------------------------------------------------------- |
| **URL**       | `https://api.threadapi.dev/mcp`                                                    |
| **Transport** | Streamable HTTP                                                                    |
| **Auth**      | OAuth sign-in, or `Authorization: Bearer <YOUR_API_KEY>`                           |
| **Billing**   | Tool calls cost the same as the REST routes. Connecting and listing tools is free. |

No account yet? An agent can create one for its user: see [Agent sign-up](/agent-signup).

Tools [#tools]

| Tool                   | What it does                                                                                                                                                                                                                                                                                 | Credits                                      |
| :--------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :------------------------------------------- |
| `get_reddit_post`      | A post with its comment tree and a digest: the original poster's replies, the most upvoted and the controversial comments. Arguments: `post` (URL, comment permalink or ID), `comment` and `context` to focus on one comment, `max_comments` (default 200), `format` (`markdown` or `json`). | 1 for up to 500 comments, +1 per further 100 |
| `get_reddit_items`     | Up to 100 posts and comments by ID or URL. Arguments: `ids` (comma-separated).                                                                                                                                                                                                               | 1                                            |
| `list_subreddit_posts` | Hot, new, top, rising or controversial posts. Arguments: `subreddit`, `sort`, `time`, `limit`, `after`, `nsfw`.                                                                                                                                                                              | 1                                            |
| `get_subreddit`        | A subreddit's description, subscribers and rules. Arguments: `subreddit`.                                                                                                                                                                                                                    | 1                                            |
| `get_reddit_user`      | A user's karma and badges, and with `include` their recent `posts` or `comments`. Arguments: `name`, `include`.                                                                                                                                                                              | 1, or 2 with `include`                       |
| `search_reddit`        | Posts, comments, subreddits or users matching a query. Arguments: `query`, `type` (`post`, `comment`, `subreddit` or `user`), `subreddit`, `sort`, `time`, `limit`, `after`, `nsfw`.                                                                                                         | 1                                            |
| `get_monitor_matches`  | New matches from one of your [monitors](/monitors), oldest first. Arguments: `monitor_id`, `after` (the last match ID you saw), `limit` (default 100).                                                                                                                                       | 0                                            |

Errors come back as tool errors with a hint for the model, and cost nothing.

Claude (claude.ai and Claude Desktop) [#claude-claudeai-and-claude-desktop]

Add threadapi as a custom connector; no key needed:

1. Open **Settings → Connectors**, click **Add custom connector**.
2. Enter `https://api.threadapi.dev/mcp` and click **Connect**.
3. Sign in to threadapi, or create an account (200 free credits, no card), then click **Allow**.

Then ask, for example: *"Read the top posts in r/selfhosted this week and tell me which backup tools people trust."* Requests use your credits and show up in your [logs](https://stage.threadapi.dev/app/logs?utm_source=docs). To disconnect, revoke the connected app under [API keys](https://stage.threadapi.dev/app/api-keys?utm_source=docs).

Claude Code [#claude-code]

```bash
claude mcp add --transport http threadapi https://api.threadapi.dev/mcp
```

Then run `/mcp`, pick `threadapi` and choose **Authenticate**. To use an API key instead:

```bash
claude mcp add --transport http threadapi https://api.threadapi.dev/mcp \
  --header "Authorization: Bearer YOUR_API_KEY"
```

Codex [#codex]

```bash
export THREADAPI_API_KEY=YOUR_API_KEY
codex mcp add threadapi --url https://api.threadapi.dev/mcp --bearer-token-env-var THREADAPI_API_KEY
```

Or in `~/.codex/config.toml`:

```toml
[mcp_servers.threadapi]
url = "https://api.threadapi.dev/mcp"
bearer_token_env_var = "THREADAPI_API_KEY"
```

Cursor [#cursor]

In `~/.cursor/mcp.json` (all projects) or `.cursor/mcp.json` (one project). Cursor opens the sign-in page the first time:

```json
{
  "mcpServers": {
    "threadapi": {
      "url": "https://api.threadapi.dev/mcp"
    }
  }
}
```

VS Code [#vs-code]

In `.vscode/mcp.json`. VS Code asks for the key once and stores it securely:

```json
{
  "inputs": [
    {
      "type": "promptString",
      "id": "threadapi-key",
      "description": "threadapi API key",
      "password": true
    }
  ],
  "servers": {
    "threadapi": {
      "type": "http",
      "url": "https://api.threadapi.dev/mcp",
      "headers": { "Authorization": "Bearer ${input:threadapi-key}" }
    }
  }
}
```

Other clients [#other-clients]

Any client that speaks Streamable HTTP works. Clients that only support stdio can use a bridge such as `mcp-remote`:

```bash
npx mcp-remote https://api.threadapi.dev/mcp --header "Authorization: Bearer YOUR_API_KEY"
```

Documentation for models [#documentation-for-models]

* [threadapi.dev/llms.txt](https://stage.threadapi.dev/llms.txt) summarises the API.
* [threadapi.dev/llms-full.txt](https://stage.threadapi.dev/llms-full.txt) has every endpoint and response.
* Append `.mdx` to any docs URL for the raw page.
