althea-mcp 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Tiptree Advanced Systems Corporation
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,397 @@
1
+ Metadata-Version: 2.4
2
+ Name: althea-mcp
3
+ Version: 0.1.0
4
+ Summary: Connect coding agents to your Althea and her network of ML researchers.
5
+ Author-email: Tiptree Advanced Systems Corporation <martin@tiptreesystems.com>
6
+ License-Expression: MIT
7
+ Project-URL: Homepage, https://althea.tiptreesystems.com
8
+ Project-URL: Documentation, https://github.com/tiptreesystems/althea-mcp#readme
9
+ Project-URL: Repository, https://github.com/tiptreesystems/althea-mcp
10
+ Project-URL: Issues, https://github.com/tiptreesystems/althea-mcp/issues
11
+ Project-URL: Security, https://github.com/tiptreesystems/althea-mcp/security/policy
12
+ Keywords: althea,ai-agent,coding-agent,mcp,model-context-protocol,personal-agent,research-network
13
+ Classifier: Development Status :: 3 - Alpha
14
+ Classifier: Environment :: Console
15
+ Classifier: Intended Audience :: Developers
16
+ Classifier: Operating System :: OS Independent
17
+ Classifier: Programming Language :: Python :: 3
18
+ Classifier: Programming Language :: Python :: 3 :: Only
19
+ Classifier: Programming Language :: Python :: 3.11
20
+ Classifier: Programming Language :: Python :: 3.12
21
+ Classifier: Programming Language :: Python :: 3.13
22
+ Classifier: Programming Language :: Python :: 3.14
23
+ Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
24
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
25
+ Requires-Python: >=3.11
26
+ Description-Content-Type: text/markdown
27
+ License-File: LICENSE
28
+ Requires-Dist: filelock<4,>=3.13
29
+ Requires-Dist: httpx<1,>=0.27.0
30
+ Requires-Dist: mcp<2,>=1.28.1
31
+ Requires-Dist: pydantic<3,>=2.7
32
+ Provides-Extra: test
33
+ Requires-Dist: pytest>=7.4; extra == "test"
34
+ Requires-Dist: pytest-asyncio>=0.23; extra == "test"
35
+ Provides-Extra: dev
36
+ Requires-Dist: pytest>=7.4; extra == "dev"
37
+ Requires-Dist: pytest-asyncio>=0.23; extra == "dev"
38
+ Requires-Dist: ruff>=0.8.0; extra == "dev"
39
+ Dynamic: license-file
40
+
41
+ <!-- mcp-name: io.github.tiptreesystems/althea-mcp -->
42
+
43
+ <p align="center">
44
+ <img src="https://raw.githubusercontent.com/tiptreesystems/althea-mcp/main/assets/althea-logo.svg" alt="Althea" width="156" />
45
+ </p>
46
+
47
+ <h1 align="center">Althea MCP</h1>
48
+
49
+ <p align="center">
50
+ <strong>A direct line from your coding agent to your Althea.</strong><br />
51
+ Shared research memory and a consent-first network of verified ML researchers.
52
+ </p>
53
+
54
+ <p align="center">
55
+ <a href="https://github.com/tiptreesystems/althea-mcp/actions/workflows/ci.yml"><img src="https://github.com/tiptreesystems/althea-mcp/actions/workflows/ci.yml/badge.svg" alt="CI status" /></a>
56
+ <a href="https://pypi.org/project/althea-mcp/"><img src="https://img.shields.io/pypi/v/althea-mcp?label=PyPI" alt="PyPI version" /></a>
57
+ <a href="https://www.python.org/"><img src="https://img.shields.io/badge/Python-3.11%2B-3776AB?logo=python&amp;logoColor=white" alt="Python 3.11+" /></a>
58
+ <a href="https://modelcontextprotocol.io/"><img src="https://img.shields.io/badge/MCP-local%20server-638B8D" alt="Local MCP server" /></a>
59
+ <a href="https://github.com/tiptreesystems/althea-mcp/blob/main/LICENSE"><img src="https://img.shields.io/badge/license-MIT-2F6D70.svg" alt="MIT license" /></a>
60
+ </p>
61
+
62
+ Give Codex, Claude Code, and other coding agents a direct line to your personal
63
+ [Althea](https://althea.tiptreesystems.com). They can hand her questions, code,
64
+ and context from the repository in front of them. Althea brings your shared
65
+ research memory and, when useful, can ask a consent-first network of verified
66
+ ML researchers for help.
67
+
68
+ - **Agents that can talk to each other.** Pass questions, code, experiment
69
+ results, and repository context between your coding agent and Althea.
70
+ - **Your Althea, with your context.** MCP uses your existing account, profile,
71
+ and long-term research memory.
72
+ - **A route into the researcher network.** Althea can ask verified ML
73
+ researchers for help, with consent before private context is shared.
74
+ - **Client-specific conversations.** Codex and Claude stay separate when you
75
+ give them distinct thread keys, while Althea keeps your shared context.
76
+ - **Work asynchronously.** Wait for a reply, leave a message for longer work,
77
+ or read the thread later.
78
+
79
+ [Setup](#setup) · [Connect a client](#connect-an-mcp-client) ·
80
+ [First conversation](#start-a-conversation) · [Tools](#tools) ·
81
+ [Security and privacy](#security-and-privacy) ·
82
+ [Development](#local-development)
83
+
84
+ ## Setup
85
+
86
+ You need access to Althea and [uv](https://docs.astral.sh/uv/getting-started/installation/).
87
+ Install Althea MCP from PyPI, then sign in with an emailed verification code:
88
+
89
+ ```bash
90
+ uv tool install althea-mcp
91
+ althea-mcp setup
92
+ ```
93
+
94
+ If the install succeeds but the command is not found, run `uv tool update-shell`
95
+ and open a new terminal.
96
+
97
+ Run setup yourself in an interactive terminal. Enter your email and verification
98
+ code there, not in an AI chat.
99
+
100
+ ```text
101
+ Connect your personal Althea
102
+ -----------------------------
103
+ Email: you@example.com
104
+ A verification code was sent to you@example.com.
105
+ Verification code:
106
+
107
+ Althea MCP is ready.
108
+ Credentials saved to ~/.config/althea-mcp/credentials.json
109
+ ```
110
+
111
+ Setup follows the same account journey as the Althea web app:
112
+
113
+ - Existing accounts receive a verification code by email.
114
+ - Eligible new accounts are asked for a name, then receive a verification code.
115
+ - Accounts that still need access are sent to the
116
+ [Althea application](https://tiptreesystems.com/apply). Complete it, then run
117
+ setup again.
118
+
119
+ The installed server starts without fetching code on every launch. Its tools
120
+ still need a network connection to Althea. Upgrade the package later with:
121
+
122
+ ```bash
123
+ uv tool upgrade althea-mcp
124
+ ```
125
+
126
+ ## Connect an MCP client
127
+
128
+ Complete setup once, then add the local stdio server. Give each client a
129
+ different thread key.
130
+
131
+ > [!CAUTION]
132
+ > This server can read private Althea history and send real messages. Register
133
+ > it only in clients and projects you trust.
134
+
135
+ ### Codex
136
+
137
+ ```bash
138
+ codex mcp add althea \
139
+ --env ALTHEA_THREAD_KEY=codex \
140
+ -- althea-mcp
141
+ codex mcp list
142
+ ```
143
+
144
+ `codex mcp add` writes to your user configuration. Equivalent
145
+ `~/.codex/config.toml`:
146
+
147
+ ```toml
148
+ [mcp_servers.althea]
149
+ command = "althea-mcp"
150
+
151
+ [mcp_servers.althea.env]
152
+ ALTHEA_THREAD_KEY = "codex"
153
+ ```
154
+
155
+ ### Claude Code
156
+
157
+ ```bash
158
+ claude mcp add althea \
159
+ -e ALTHEA_THREAD_KEY=claude-code \
160
+ -- althea-mcp
161
+ claude mcp list
162
+ ```
163
+
164
+ That command uses Claude Code's project-local scope. Add `--scope user`
165
+ immediately before `althea` only if you want the server available in every
166
+ project you open.
167
+
168
+ A user-wide manual entry under the top-level `mcpServers` object in
169
+ `~/.claude.json` looks like this:
170
+
171
+ ```json
172
+ {
173
+ "mcpServers": {
174
+ "althea": {
175
+ "type": "stdio",
176
+ "command": "althea-mcp",
177
+ "env": {
178
+ "ALTHEA_THREAD_KEY": "claude-code"
179
+ }
180
+ }
181
+ }
182
+ }
183
+ ```
184
+
185
+ ### Claude Desktop and other local clients
186
+
187
+ Find the installed command:
188
+
189
+ ```bash
190
+ command -v althea-mcp
191
+ ```
192
+
193
+ On Windows PowerShell:
194
+
195
+ ```powershell
196
+ (Get-Command althea-mcp).Source
197
+ ```
198
+
199
+ GUI applications sometimes receive a smaller `PATH` than your terminal. If
200
+ `althea-mcp` is not found, use the absolute path returned above:
201
+
202
+ ```json
203
+ {
204
+ "mcpServers": {
205
+ "althea": {
206
+ "command": "/absolute/path/to/althea-mcp",
207
+ "env": {
208
+ "ALTHEA_THREAD_KEY": "claude-desktop"
209
+ }
210
+ }
211
+ }
212
+ }
213
+ ```
214
+
215
+ Restart the client after changing its MCP configuration.
216
+
217
+ ## Start a conversation
218
+
219
+ Try one of these prompts in your MCP client:
220
+
221
+ ```text
222
+ Ask my Althea whether anyone in the researcher network has worked on this
223
+ failure mode. Share only the sanitized summary below:
224
+ [summary]
225
+ ```
226
+
227
+ ```text
228
+ Send this context to my Althea without waiting for a reply:
229
+ The latest experiment rules out the data-loader hypothesis. The remaining
230
+ failure starts after gradient accumulation.
231
+ ```
232
+
233
+ ```text
234
+ Check whether my Althea has replied in the MCP thread.
235
+ ```
236
+
237
+ Messages continue the configured thread. They are real messages to your
238
+ personal Althea and may cause her to begin work.
239
+
240
+ ## Tools
241
+
242
+ | Tool | What it does |
243
+ | --- | --- |
244
+ | `ask_althea(message)` | Sends a message and uses a 120-second polling window by default for the first reply. If the window expires, the work may still continue. |
245
+ | `send_message_to_althea(message)` | Sends a message immediately and returns a receipt without waiting. Use it for context, notes, and longer requests. |
246
+ | `get_althea_messages(sender=None, limit=10)` | Returns 1 to 100 recent messages in chronological order. Optionally filter by `user`, `assistant`, or `system`. |
247
+
248
+ The two send tools are marked as state-changing. Message retrieval is read-only.
249
+ The current tool surface is text-only. It does not expose attachments or other
250
+ Althea artifacts.
251
+
252
+ ## How it works
253
+
254
+ ```text
255
+ Codex / Claude Code / another coding agent
256
+ │ local stdio
257
+ ▼
258
+ Althea MCP
259
+ │ HTTPS
260
+ ▼
261
+ your Althea
262
+ │
263
+ ├── your profile and long-term research memory
264
+ ├── a persisted conversation for this thread key
265
+ └── a consent-first network of verified ML researchers
266
+ ```
267
+
268
+ Althea MCP is a small public adapter. The frontend authenticates the user,
269
+ resolves their canonical Althea, sends messages, and stores the resulting
270
+ conversation. The package polls those persisted messages when a caller waits
271
+ for a reply. The coding agent talks to Althea, and Althea coordinates with the
272
+ researcher network when a request would benefit from outside expertise.
273
+
274
+ ## Sign-in and sessions
275
+
276
+ Setup creates a normal Althea usage session:
277
+
278
+ - The access session lasts 7 days.
279
+ - Its rotating refresh-token family lasts 14 days from sign-in.
280
+ - Access tokens refresh automatically before expiry.
281
+ - A cross-process lock lets several local MCP clients share the credential file
282
+ without racing refresh-token rotation.
283
+ - When the session expires or is revoked, run `althea-mcp setup` again in a
284
+ separate terminal. Running MCP processes reload the replacement credentials.
285
+
286
+ Credentials are stored as plaintext JSON at
287
+ `~/.config/althea-mcp/credentials.json`. On operating systems that support Unix
288
+ file modes, the credential file is set to `0600`. A parent directory created by
289
+ Althea MCP is requested as `0700`; check the permissions yourself when using a
290
+ pre-existing custom directory.
291
+
292
+ ## Security and privacy
293
+
294
+ - Messages sent through these tools are persisted in your Althea account, like
295
+ messages from Althea's other channels.
296
+ - The local stdio process sends messages and credentials to Althea over HTTPS.
297
+ Even with local transport, conversation data leaves your machine.
298
+ - The connected MCP host and model can see tool arguments and replies. They may
299
+ retain that data under their own privacy and retention policies.
300
+ - When Althea asks the researcher network for help, she requests consent before
301
+ sharing information drawn from a private conversation.
302
+ - The package sends access credentials only to the Althea origin they were
303
+ issued for. Changing `ALTHEA_APP_URL` requires a new setup.
304
+ - The refresh token is sent only to the session rotation endpoint.
305
+ - Email verification codes and the credential file are secrets. Never paste
306
+ them into an AI chat, terminal transcript, issue, or pull request.
307
+ - To remove the local session, close MCP clients and delete the credential file.
308
+ This forgets the session on that machine. Contact Tiptree if a copied session
309
+ must also be revoked.
310
+
311
+ Please report vulnerabilities using
312
+ [the security policy](https://github.com/tiptreesystems/althea-mcp/security/policy).
313
+
314
+ ## Configuration
315
+
316
+ Most users only need `althea-mcp setup` and a client-specific thread key.
317
+
318
+ | Environment variable | Default | Purpose |
319
+ | --- | --- | --- |
320
+ | `ALTHEA_APP_URL` | `https://althea.tiptreesystems.com` | Althea API origin. Saved credentials are bound to it. Plain HTTP is accepted only for loopback development. |
321
+ | `ALTHEA_PUBLIC_SITE_URL` | `https://tiptreesystems.com` | Base URL for terms, privacy, and access requests. Dev Althea selects `https://dev.tiptreesystems.com` automatically. |
322
+ | `ALTHEA_THREAD_KEY` | `mcp` | Stable conversation identifier. Use 1 to 128 letters, digits, dots, underscores, colons, or hyphens, starting with a letter or digit. |
323
+ | `ALTHEA_MCP_CREDENTIALS_FILE` | `~/.config/althea-mcp/credentials.json` | Override the local credential path. |
324
+ | `ALTHEA_MCP_HTTP_TIMEOUT` | `60` | HTTP timeout in seconds. |
325
+ | `ALTHEA_MCP_POLL_INTERVAL` | `2` | Delay between response polls in seconds. |
326
+ | `ALTHEA_MCP_POLL_TIMEOUT` | `120` | Maximum wait for `ask_althea` in seconds. |
327
+ | `ALTHEA_MCP_LOG_LEVEL` | `WARNING` | Python log level. |
328
+
329
+ Setup also accepts `--credentials-file` to override the credential path and
330
+ `--no-browser` to print an access-request URL without opening it.
331
+
332
+ ## Troubleshooting
333
+
334
+ **`Althea MCP is not configured`**
335
+
336
+ Run `althea-mcp setup` in a terminal, then restart the MCP client.
337
+
338
+ **`Your Althea MCP sign-in has expired or was revoked`**
339
+
340
+ Run setup again. The refresh-token family has a 14-day absolute lifetime.
341
+
342
+ **Saved credentials are bound to another URL**
343
+
344
+ Run setup with the same origin the MCP client will use:
345
+
346
+ ```bash
347
+ althea-mcp setup --app-url https://althea.example
348
+ ```
349
+
350
+ Then set the matching `ALTHEA_APP_URL` in the client configuration.
351
+
352
+ **`ask_althea` timed out**
353
+
354
+ Althea may still be working. Call `get_althea_messages` after a short wait.
355
+
356
+ **The client cannot find `althea-mcp`**
357
+
358
+ Run `command -v althea-mcp` in a terminal and use that absolute path in the
359
+ client configuration.
360
+
361
+ **Two clients are sharing a conversation**
362
+
363
+ Assign a distinct `ALTHEA_THREAD_KEY` to each client and restart them.
364
+
365
+ ## Local development
366
+
367
+ ```bash
368
+ git clone https://github.com/tiptreesystems/althea-mcp.git
369
+ cd althea-mcp
370
+ uv sync --locked --extra dev
371
+ uv run pytest -q
372
+ uv run ruff check althea_mcp tests
373
+ uv run ruff format --check .
374
+ uv build
375
+ uvx twine check dist/*
376
+ ```
377
+
378
+ Run setup against a local frontend:
379
+
380
+ ```bash
381
+ uv run althea-mcp setup --app-url http://localhost:8080
382
+ ```
383
+
384
+ Running `althea-mcp` with no subcommand starts the stdio server. The explicit
385
+ equivalent is `althea-mcp serve`.
386
+
387
+ ## Contributing
388
+
389
+ Bug reports and focused pull requests are welcome. Read
390
+ [the contribution guide](https://github.com/tiptreesystems/althea-mcp/blob/main/CONTRIBUTING.md)
391
+ before opening one. Remove all email addresses, messages, OTPs, and credentials
392
+ from logs and fixtures.
393
+
394
+ ## License
395
+
396
+ [MIT](https://github.com/tiptreesystems/althea-mcp/blob/main/LICENSE) © Tiptree
397
+ Advanced Systems Corporation.