docHamster MCP
by batman
README.md
# docHamster MCP adapter
Lets an assistant – Claude or any other MCP client – work with a [docHamster](https://github.com/batman/doc-hamster) server: read bank
bookings and documents and link them. It runs **on your computer**, next to the assistant, and talks to docHamster's
own interface (`/api/v1`) with an access key. The docHamster server itself contains no AI and needs nothing extra.
- No dependencies – one file, Node.js 18 or newer.
- The key acts as **you**: your rights, your role's restriction, only your organisation.
- A key is either **"Nur lesen"** (read only) or **"Lesen + Verknüpfen"** (read and link). Nothing deletes documents or
bookings.
- Text only: the assistant sees what docHamster read from a document (amount, date, sender, text), never the scans.
- Every link the assistant makes is in docHamster's audit log, marked with the key.
## Set up
1. **Make a key.** In docHamster: *Einstellungen → Mein Konto → Zugangsschlüssel → Schlüssel anlegen*. Give it a name,
choose *Nur lesen* or *Lesen + Verknüpfen*, confirm with your password. Copy the **address** and the **key** – the
key is shown only once.
2. **Add the adapter to your assistant.** Claude Code:
```bash
claude mcp add dochamster --scope user -e DOCHAMSTER_URL=https://dochamster.example.com -e DOCHAMSTER_KEY=dha_… -- node /path/to/DocHamster-mcp/dochamster-mcp.mjs
```
Claude Desktop (`claude_desktop_config.json`):
```json
{
"mcpServers": {
"dochamster": {
"command": "node",
"args": ["/path/to/DocHamster-mcp/dochamster-mcp.mjs"],
"env": { "DOCHAMSTER_URL": "https://dochamster.example.com", "DOCHAMSTER_KEY": "dha_…" }
}
}
}
```
The key stays in your assistant's local configuration – never put it into a repository.
3. **Check it.** Ask the assistant: "Wer bin ich in docHamster?" – it calls `whoami`.
To stop it: remove the key in *Mein Konto* (it stops working at once) and the entry in your assistant.
## Tools
| Tool | Does |
|------|------|
| `whoami` | Whose key, which organisation, may it link |
| `list_accounts` | Bank accounts with bookings per status |
| `list_transactions` | Bookings (account, status `open`/`suggested`/`linked`/`none`, in/out, period, search), 100 per page |
| `get_transaction` | One booking, its documents and up to 10 candidates with score and reasons |
| `list_folders` | Folders, and whether their documents may be linked |
| `list_documents` | Documents (only free ones, folder, period, search), 50 per page |
| `get_document` | One document with its properties and recognised text |
| `link_document` | Link a document to a booking (key "Lesen + Verknüpfen") |
| `confirm_suggestion` | Turn docHamster's suggestion into a link |
| `reject_suggestion` | Drop a suggestion; it is not made again |
| `unlink_document` | Remove a link or suggestion |
Amounts come as `amount_minor` (cents) and `amount` (decimal string); negative = money out. Dates are `YYYY-MM-DD`.
## Safety
- `DOCHAMSTER_URL` must be `https://` (plain `http://` only for `localhost`), so the key never travels unencrypted.
- The key is never written to stdout, stderr or a log.
- The server limits a key to 300 requests a minute.
## License
MIT – see [LICENSE](LICENSE).