Skip to main content
Glama

DollhouseMCP

by DollhouseMCP
README.mdโ€ข4.48 kB
# Bundled Starter Elements ## Purpose This directory contains **default example elements** that ship with the DollhouseMCP NPM package. These are NOT user-generated files - they are part of the product. ## What Are Bundled Elements? On first run, DollhouseMCP copies these example elements to the user's local portfolio (`~/.dollhouse/portfolio/`) to provide: 1. **Working examples** - Users can immediately try personas, skills, and templates 2. **Learning material** - See proper element structure and metadata 3. **Quick start** - No empty portfolio on first install ### First-Run Process When a user installs DollhouseMCP via NPM: 1. **User installs**: `npm install @dollhousemcp/mcp-server` 2. **First launch**: User starts DollhouseMCP for the first time 3. **Empty portfolio detected**: System checks `~/.dollhouse/portfolio/` and finds it empty 4. **Bundled elements copied**: DefaultElementProvider copies files from `data/` โ†’ user portfolio 5. **User customizes**: User can now modify their local copies without affecting the originals **Important**: The bundled elements in `data/` remain unchanged. Users work with *copies* in their portfolio. ## Directory Structure ``` data/ โ”œโ”€โ”€ personas/ Example AI behavioral profiles โ”œโ”€โ”€ skills/ Example discrete capabilities โ”œโ”€โ”€ templates/ Example reusable content structures โ”œโ”€โ”€ agents/ Example goal-oriented decision makers โ”œโ”€โ”€ memories/ Example persistent context storage โ””โ”€โ”€ ensembles/ Example combined element orchestration ``` ## Important Distinctions | This Directory (data/) | User Portfolio (~/.dollhouse/portfolio/) | |------------------------|------------------------------------------| | โœ… In git repository | โŒ NOT in repository | | โœ… Ships with NPM | โŒ Local user storage only | | โœ… Read-only examples | โœ… User's active elements | | โœ… Version controlled | โŒ .gitignored | ## For Developers ### NPM Package Inclusion These files are explicitly included in package.json: ```json "files": [ "data/personas/**/*.md", "data/skills/**/*.md", "data/templates/**/*.md", "data/agents/**/*.md", "data/memories/**/*.md", "data/ensembles/**/*.md" ] ``` ### Loading Mechanism See `src/portfolio/DefaultElementProvider.ts` for the implementation: - **Population logic** (`populateDefaultElements()` around line 947): Main function that orchestrates copying bundled elements to user portfolio - **File copying** (`copyElementFiles()` around line 679): Copies individual files while preserving existing user modifications - **Directory detection** (`findDataDirectory()` around line 190): Locates bundled data in NPM installation or git repository - **Development vs production mode** (lines 35-122): See below for detailed explanation #### Development vs Production Modes The loading mechanism behaves differently based on the environment: **Production Mode** (NPM installation, no `.git` directory): - โœ… Bundled elements ARE loaded by default - Users get starter examples on first run - Provides immediate value for new installations **Development Mode** (Git clone, `.git` directory present): - โŒ Bundled elements are NOT loaded by default - Prevents test/example data from polluting developer's portfolio - Developers can override with `DOLLHOUSE_LOAD_TEST_DATA=true` environment variable This distinction ensures: - End users get a great first-run experience with examples - Developers working on the codebase don't get unwanted test data in their personal portfolio - Test elements (marked with metadata) are blocked in production for security ### Testing `test/__tests__/basic.test.ts` (lines 33-57) verifies: - Required directories exist (including `data/personas`) - Expected example files are present (e.g., `creative-writer.md`) - Proper structure is maintained ## Common Misconceptions โŒ "data/ should be in .gitignore" - **NO**, these are bundled examples, not user data โŒ "This is test data" - **NO**, this is production starter content โŒ "This is my local portfolio" - **NO**, your portfolio is in `~/.dollhouse/` ## Contributing New Examples When adding new bundled elements: 1. Follow existing element structure (YAML frontmatter + Markdown) 2. Keep examples simple and educational 3. Test that DefaultElementProvider can load them 4. Update this README if adding new element types

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/DollhouseMCP/DollhouseMCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server