spoolman-mcp
# π§΅ Spoolman MCP Server
[](https://github.com/Disane87/spoolman-mcp)
[](https://opensource.org/licenses/MIT)
[](https://www.typescriptlang.org/)
[](https://modelcontextprotocol.io/)
[](https://github.com/Donkie/Spoolman)
> **A [Model Context Protocol](https://modelcontextprotocol.io/) server for [Spoolman](https://github.com/Donkie/Spoolman) β manage your entire 3D printer filament inventory through natural language with Claude and other AI assistants!** π
<p align="center">
<a href="https://subthiel.eu">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="assets/subthiel-logo-dark-bg.svg">
<source media="(prefers-color-scheme: light)" srcset="assets/subthiel-logo-light-bg.svg">
<img src="assets/subthiel-logo-light-bg.svg" alt="Subthiel" height="40">
</picture>
</a>
</p>
<p align="center">
This project grew out of <a href="https://subthiel.eu">Subthiel</a>, my own company for 3D printing & software development.
</p>
---
## π What is this?
This MCP server bridges the gap between AI assistants (like Claude) and your self-hosted [Spoolman](https://github.com/Donkie/Spoolman) instance. Instead of clicking through the Spoolman UI, you can simply **ask** your AI assistant:
> _"How much PLA do I have left?"_
> _"Add a new Bambu Lab PETG spool, 1kg, red."_
> _"Mark spool #12 as used by 50g."_
The server exposes the **full Spoolman REST API v1** as MCP tools β every vendor, filament, spool, setting, custom field, lookup, and export endpoint is covered.
---
## β¨ Features
- π **Vendor Management** β Create, read, update, delete vendors
- π¨ **Filament Management** β Full CRUD with color, temperature settings, article numbers
- π§΅ **Spool Management** β Track spools, log usage (by weight or length), weight measurement, archiving
- βοΈ **Settings** β Read and write Spoolman configuration
- π·οΈ **Custom Fields** β Manage extra fields for vendors, filaments, and spools
- π **Lookups** β Browse all materials, locations, lot numbers, article numbers
- π¦ **Export** β Export data as JSON or CSV
- π **System** β Health check, info, and backup trigger
> [!NOTE]
> This server communicates with your **local/self-hosted** Spoolman instance. You need a running Spoolman before using this MCP server.
---
## π Requirements
| Requirement | Version |
|---|---|
| Node.js | β₯ 18 |
| npm | β₯ 9 |
| Spoolman | Any recent version |
| Claude Desktop / Claude Code | Any |
---
## β‘ Quick Start
### 1. Clone & Install
```bash
git clone https://github.com/Disane87/spoolman-mcp.git
cd spoolman-mcp
npm install
npm run build
```
### 2. Configure Claude Desktop
Add the following to your `claude_desktop_config.json`:
**macOS / Linux:** `~/.config/claude/claude_desktop_config.json`
**Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
```json
{
"mcpServers": {
"spoolman": {
"command": "node",
"args": ["/absolute/path/to/spoolman-mcp/dist/index.js"],
"env": {
"SPOOLMAN_URL": "http://localhost:7912"
}
}
}
}
```
> [!IMPORTANT]
> Replace `/absolute/path/to/spoolman-mcp` with the actual path where you cloned the repository, and `http://localhost:7912` with the URL of your Spoolman instance.
### 3. Restart Claude Desktop & Start Chatting! π
---
## π§ Configuration
The server is configured via **environment variables**:
| Variable | Required | Description | Example |
|---|---|---|---|
| `SPOOLMAN_URL` | β
Yes | Base URL of your Spoolman instance | `http://localhost:7912` |
| `SPOOLMAN_API_KEY` | β No | Bearer token (if behind a proxy with auth) | `my-secret-key` |
---
## π οΈ Available MCP Tools
### π Vendors
| Tool | Description |
|---|---|
| `spoolman_list_vendors` | Search and list all vendors |
| `spoolman_get_vendor` | Get a single vendor by ID |
| `spoolman_create_vendor` | Create a new vendor |
| `spoolman_update_vendor` | Update an existing vendor |
| `spoolman_delete_vendor` | Delete a vendor (cascades to filaments!) |
### π¨ Filaments
| Tool | Description |
|---|---|
| `spoolman_list_filaments` | Search filaments by name, material, color, vendor... |
| `spoolman_get_filament` | Get a single filament by ID |
| `spoolman_create_filament` | Create a new filament definition |
| `spoolman_update_filament` | Update an existing filament |
| `spoolman_delete_filament` | Delete a filament |
### π§΅ Spools
| Tool | Description |
|---|---|
| `spoolman_list_spools` | Search spools with extensive filters |
| `spoolman_get_spool` | Get a single spool by ID |
| `spoolman_create_spool` | Register a new spool |
| `spoolman_update_spool` | Update spool metadata |
| `spoolman_delete_spool` | Delete a spool |
| `spoolman_use_spool` | Log filament consumption (g or mm) |
| `spoolman_measure_spool` | Update remaining weight via scale measurement |
### βοΈ Settings
| Tool | Description |
|---|---|
| `spoolman_get_all_settings` | Get all Spoolman settings |
| `spoolman_get_setting` | Get a specific setting by key |
| `spoolman_set_setting` | Change a setting value |
### π·οΈ Custom Fields
| Tool | Description |
|---|---|
| `spoolman_list_fields` | List custom fields for an entity type |
| `spoolman_upsert_field` | Add or update a custom field |
| `spoolman_delete_field` | Remove a custom field |
### π Lookups
| Tool | Description |
|---|---|
| `spoolman_list_materials` | List all known material types |
| `spoolman_list_locations` | List all storage locations |
| `spoolman_list_lot_numbers` | List all lot/batch numbers |
| `spoolman_list_article_numbers` | List all article numbers |
| `spoolman_rename_location` | Rename a storage location |
### π¦ Export
| Tool | Description |
|---|---|
| `spoolman_export_spools` | Export all spools as JSON or CSV |
| `spoolman_export_filaments` | Export all filaments as JSON or CSV |
| `spoolman_export_vendors` | Export all vendors as JSON or CSV |
### π System
| Tool | Description |
|---|---|
| `spoolman_get_info` | Get Spoolman version and config info |
| `spoolman_health_check` | Check if Spoolman is reachable |
| `spoolman_trigger_backup` | Trigger a database backup (SQLite only) |
---
## π¬ Example Conversations
Once connected, you can have natural conversations like:
```
You: How many spools do I currently have?
Claude: You have 14 spools in Spoolman. 3 of them are archived.
The active spools include 5x PLA, 4x PETG, and 2x ABS.
```
```
You: Add a new Bambu Lab PLA Basic spool. It's red, 1kg, 1.75mm.
Claude: I'll create that for you right away!
β
Spool created: Bambu Lab PLA Basic (Red) β 1000g remaining.
```
```
You: I just printed something and used about 45g from spool #7.
Claude: Done! Spool #7 now has 623g remaining (was 668g).
```
```
You: I just weighed spool #3 on my kitchen scale β it's 312g total.
Claude: Got it! Based on the empty spool weight of 190g, spool #3
now shows 122g of filament remaining.
```
---
## ποΈ Project Structure
```
spoolman-mcp/
βββ src/
β βββ index.ts # MCP server entry point & transport
β βββ client.ts # Typed Spoolman REST API client
β βββ tools/
β βββ system.ts # System tools (health, info, backup)
β βββ vendors.ts # Vendor CRUD tools
β βββ filaments.ts # Filament CRUD tools
β βββ spools.ts # Spool management tools
β βββ settings.ts # Settings tools
β βββ fields.ts # Custom field tools
β βββ lookup.ts # Lookup / discovery tools
β βββ export.ts # Data export tools
βββ dist/ # Compiled JavaScript (after npm run build)
βββ package.json
βββ tsconfig.json
βββ README.md
```
---
## π¨ Development
```bash
# Install dependencies
npm install
# Build TypeScript
npm run build
# Watch mode (auto-rebuild on changes)
npm run watch
# Run directly with ts-node (no build step)
SPOOLMAN_URL=http://localhost:7912 npm run dev
```
---
## π€ Contributing
Contributions are welcome! Feel free to open an issue or pull request if you find a bug, have a feature idea, or want to improve the documentation.
1. Fork the repository
2. Create a feature branch (`git checkout -b feat/my-feature`)
3. Commit your changes (`git commit -m 'feat: add my feature'`)
4. Push to the branch (`git push origin feat/my-feature`)
5. Open a Pull Request
---
## π License
MIT License β see [LICENSE](./LICENSE) for details.
---
## π Related Spoolman Projects
Check out these other projects from the Spoolman ecosystem:
| Project | Description |
|---------|-------------|
| [π Spoolman Home Assistant](https://github.com/Disane87/spoolman-homeassistant) | Integrate Spoolman with Home Assistant β track spools, get notifications, automate your printing workflow |
| [π¨ Spoolman Filament Swatch](https://github.com/Disane87/spoolman-filament-swatch) | Beautiful, interactive filament color browser for Spoolman. [Live Demo](https://spoolswatch.disane.dev/) |
| [π¦ Spoolman Filament Extractor](https://github.com/Disane87/Spoolman-filament-extractor) | Extract your filaments from Spoolman to SpoolmanDB format |
| [ποΈ SpoolmanDB](https://github.com/Donkie/SpoolmanDB) | Centralized community filament database used by Spoolman |
| [π¨οΈ Spoolman](https://github.com/Donkie/Spoolman/) | The awesome filament manager that powers everything |
---
## π Credits
- [Spoolman](https://github.com/Donkie/Spoolman) by [@Donkie](https://github.com/Donkie) β the awesome filament management system that makes this possible
- [Model Context Protocol](https://modelcontextprotocol.io/) by Anthropic β the open standard powering AI tool integration
- Inspired by [spoolman-homeassistant](https://github.com/Disane87/spoolman-homeassistant) π
---
<p align="center">Made with β€οΈ for the 3D printing community</p>
<p align="center">
<a href="https://subthiel.eu">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="assets/subthiel-logo-dark-bg.svg">
<source media="(prefers-color-scheme: light)" srcset="assets/subthiel-logo-light-bg.svg">
<img src="assets/subthiel-logo-light-bg.svg" alt="Subthiel" height="32">
</picture>
</a>
<br>
Made by me at <a href="https://subthiel.eu">Subthiel</a> β my company for 3D printing & software development
</p>
TDQS
Scored across 34 tools
Most tools have clear, distinct purposes (e.g., list_filaments vs list_materials vs list_article_numbers). Some potential confusion exists between use_spool and measure_spool, or get_info and health_check, but descriptions clarify these differences.
Tools generally follow the spoolman_<verb>_<noun> pattern (e.g., list_vendors, create_filament). Minor deviations like health_check (object before verb) and trigger_backup are present but not disruptive.
With 34 tools, the server is well above the typical 3-15 range for coherence. While the breadth covers many Spoolman features, the large number makes it heavy and more complex for agents to navigate.
Full CRUD exists for vendors, filaments, and spools, plus exports and settings. However, locations only have list and renameβmissing create, delete, and get-by-idβwhich is a notable gap for that entity.