# Rebrickable LEGO MCP

> Rebrickable LEGO MCP Server connects your AI agent to a full, structured catalog of LEGO data. You can search and pull details on sets, individual parts, minifigures, and themes directly through natural conversation. This tool lets you build detailed parts inventories for complex builds (MOCs), check color availability across the entire catalog, or track specific set components without navigating dozens of product pages. It's a deep data dive into LEGO history and mechanics.

## Overview
- **Category:** ecommerce
- **Price:** Free
- **Tags:** lego, catalog-data, hobbyist, parts-database, inventory-tracking

## Description

This MCP Server hooks up your AI agent directly to the whole Rebrickable catalog data. You don't gotta mess around opening a dozen tabs; your agent handles complex LEGO queries just by chatting with it. It treats every set, every brick, and every character like structured data you can actually use.

You want to build a massive custom model (MOC)? You can check the full parts inventory for any specific set number using `get_set_parts`, which lists every required piece along with quantities, and it even flags spare pieces so you know what's left over. If you need to plan out a MOC, you can use `get_part_colors` on any given part number to list all the color IDs and names that brick is manufactured in.

Need to find a specific minifigure? You can run `list_minifigs` to search for characters by name or theme, getting back their numbers, years, and image URLs. If you already know the figure's ID, `get_minifig` pulls all its details: the theme, year, and piece count associated with that single character.

When you’re deep into catalog research, you can use `list_parts` to search the entire parts database using patterns or keywords, getting back names, categories, and images for anything you throw at it. You also can pinpoint a specific part number using `get_part`, which retrieves its name, category, and available colors right away.

To plan big builds, `list_sets` lets you search for entire sets by filtering based on theme ID, year, or even a required part number, giving you the set numbers and total piece counts. For any given set number, `get_set` provides all its specs: the theme, the overall piece count, and how many minifigures it includes.

For mapping out big LEGO eras, your agent can use `list_themes` to list every major LEGO theme and sub-theme, showing you their parent/child relationship and exactly how many sets belong in each category. If you want details on a specific theme's structure, `get_theme` returns that info for one particular ID.

To manage color data across the board, `list_colors` provides a master list of every official LEGO color in the catalog, giving you their IDs and RGB values. When you need to pull details for an entire set, use `get_set` to get its theme, piece count, and minifig count.

It's all about data retrieval: you can search the full parts catalog with `list_parts`, or narrow your focus by checking a specific part number using `get_part`. You’ll find that `list_themes` details every major LEGO category, showing its hierarchy (parent/child) and associated set count. Your agent doesn't just check one thing; it can look up the complete parts inventory for any given set number, including required quantities and identifying spare pieces.

## Tools

### get_minifig
Gets specific details (theme, year, piece count) for a single LEGO minifigure using its ID.

### get_part
Retrieves the name, category, and available colors for one specific LEGO part number.

### get_part_colors
Lists all color IDs and names that a given LEGO part is manufactured in, useful for MOC builders.

### get_set
Gets full details (theme, piece count, minifig count) for an entire specific LEGO set number.

### get_set_parts
Lists the complete parts inventory for any given set, including required quantities and spare parts counts.

### get_theme
Returns details about a specific LEGO theme, including its parent theme and how many sets belong to it.

### list_colors
Provides a master list of every official LEGO color in the catalog, along with their IDs and RGB values.

### list_minifigs
Searches for LEGO minifigures by name or theme, returning numbers, years, and image URLs. Supports pagination.

### list_parts
Searches the entire parts catalog by pattern or keyword, listing names, categories, and images. Supports pagination.

### list_sets
Searches for LEGO sets using filters like theme ID, year, or part number. Returns set numbers and piece counts. Supports pagination.

### list_themes
Lists all major LEGO themes and sub-themes, showing their hierarchy (parent/child) and associated set count.

## Prompt Examples

**Prompt:** 
```
Find all LEGO Star Wars sets from 2024.
```

**Response:** 
```
Found 15 Star Wars sets from 2024. Highlights include: '75375 Millennium Falcon' (921 pieces), '75367 Venator-Class Republic Attack Cruiser' (5374 pieces), and several UCS and polybag sets. Results include piece counts, themes and image URLs.
```

**Prompt:** 
```
Show me the parts inventory for set 10497 (Galaxy Explorer).
```

**Response:** 
```
The Galaxy Explorer (10497-1) contains 235 parts across 42 unique pieces. Key parts include: 4x 2x4 bricks (part 3001), 6x 1x2 tiles, 2x windshield pieces, and various slope and plate elements. 2 spare parts are included.
```

**Prompt:** 
```
What colors is LEGO part 3001 (2x4 brick) available in?
```

**Response:** 
```
Part 3001 (2x4 brick) is available in 55+ colors including: Black (0), White (1), Red (5), Blue (23), Green (10), Yellow (14), Dark Blue (140), Dark Green (137), Light Bluish Gray (86), Dark Red (59) and many specialty colors.
```

## Capabilities

### Inventory a set's parts
Provides a complete list of every part needed for a specific LEGO set, including quantities and identifying spare pieces.

### Check brick color availability
Lists all available colors for any given LEGO part number, which is essential when building custom models (MOCs).

### Lookup minifigure details
Retrieves a character's name, theme, year, and set association using their specific identifier.

### Map out theme structures
Lists all major LEGO themes and sub-themes, showing how they relate to each other and the total number of sets in each category.

### Search entire catalog data
Allows you to search for specific parts or full sets using patterns or keywords across the whole database.

## Use Cases

### Figuring out what's missing from an old set.
A collector wants to rebuild the original parts list for set 75192. They ask their agent: 'What are the exact parts needed for this?' The agent uses `get_set_parts`, which immediately returns a spreadsheet-ready breakdown of every part number, color ID, and how many pieces they need. No manual counting or guesswork required.

### Designing a custom display case.
A MOC builder wants to know if the standard 2x4 brick (3001) is available in dark metallic gray for their model. They run `get_part` on part 3001, and it returns not just its name, but a comprehensive list of every color ID it's manufactured in, letting them choose the perfect match.

### Researching LEGO theme evolution.
A developer is building an educational app. They ask the agent to map out all themes under 'Star Wars'. The tool calls `list_themes`, showing the hierarchy (parent: Star Wars -> sub-theme: UCS). This structure allows them to organize their database logically.

### Quickly identifying a character's origin.
A user finds an old minifigure and isn't sure what set it came from. They feed the agent the figure's ID and ask for details. The agent uses `get_minifig`, which immediately provides the name, the theme, the year it was released, and its associated set numbers.

## Benefits

- Check a set's inventory instantly. Instead of visiting the website and hunting through pages, use `get_set_parts` to get every single part number and quantity needed for a set like 10497-1. It includes spare parts too.
- Verify color availability across the whole catalog. If you need a specific brick (like 3001), run `get_part_colors` to see if it exists in Black, Red, or any specialty shade—it's far better than guessing.
- Map out your collection’s history. Use `list_themes` to see the parent/sub-theme relationships (e.g., 'City' under 'Play Life') and how many sets belong to each group, giving you a clear overview of LEGO development.
- Track minifigures efficiently. If you know a character's ID or theme, run `get_minifig` instead of searching the entire site. You immediately get their set numbers and year data.
- Search large catalogs fast. Need parts from 2015? Use `list_sets` to filter by year directly. Or use `list_parts` to search for a generic brick type across all themes, all in one query.

## How It Works

The bottom line is you get accurate, machine-readable LEGO catalog data without ever leaving your chat window or writing complex API calls.

1. Subscribe to this server and pass your Rebrickable API Key.
2. Prompt your AI client (Claude, Cursor, etc.) with a complex query, like 'What parts does set 10497 need?'
3. The agent calls the relevant tool (`get_set_parts`) and returns structured data about the inventory.

## Frequently Asked Questions

**How do I get a Rebrickable API key?**
Visit [**rebrickable.com/api**](https://rebrickable.com/api/), sign in with your Rebrickable account, and your API key will be displayed on the page. Copy it — it's a long alphanumeric string.

**Can I search for sets by theme?**
Yes! Use `list_sets` with `theme_id` to filter by theme. First use `list_themes` to find the theme ID (e.g. Star Wars = 170), then pass it to list_sets. You can also filter by year or part number.

**Can I see the parts inventory for a set?**
Yes! Use `get_set_parts` with the set number (e.g. "75192-1" for the Millennium Falcon). Returns every part with its part number, color ID, quantity and whether it's a spare. Set inc_minifig_parts to true to include minifig parts.

**How many results can I get at once?**
The API supports up to 1000 results per request. Use the `page_size` parameter (max 1000, default 100) and `page` for pagination. The total count and next/previous URLs are returned in each response.

**How do I filter minifigures by year or theme using the `list_minifigs` tool?**
You can filter results directly when calling `list_minifigs`. The API allows you to specify parameters like a particular theme ID or year. This narrows down your search and helps you quickly locate specific characters.

**What happens if I run `get_part_colors` for a part that doesn't have color data?**
If the tool returns no results, it means Rebrickable does not currently list available colors for that specific part number. You should try searching by category using `list_parts` or checking external databases.

**What is the difference between running `list_parts` and using `get_set_parts`?**
`list_parts` searches the entire catalog for a part number, providing general details. Conversely, `get_set_parts` gives you an exact count of that specific part *inside* one particular set.

**Can I find all sub-themes under a main theme using `list_themes`?**
Yes, the tool handles theme hierarchy. You pass the parent theme ID to the function, and it returns a list of associated sub-themes, including their name and set count.