Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Layer.ai MCP Servergenerate a pixel art hero sprite with a transparent background"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Layer.ai MCP Server
A Model Context Protocol (MCP) server for generating game assets using Layer.ai's AI platform. Generate sprites, characters, backgrounds, and other 2D assets directly from your development environment.
Made with AI - Use with caution
Features
Asset Generation: Generate 2D game assets using Layer.ai Forge
Prompt Optimization: Optimize prompts with Layer.ai Prompt Genie
Usage Tracking: Monitor usage against free tier limits (600 assets)
Workspace Management: Export and manage workspace data
Asset Refinement: Refine and modify existing assets
Auto-Save: Automatically save generated assets to your project
Error Handling: Robust error handling with automatic retries
Quota Protection: Prevents exceeding your free tier limit
Installation
Prerequisites
Python 3.10+ (required for MCP compatibility)
Git for cloning the repository
Layer.ai account and API token
Quick Install (Recommended)
Manual Installation
Installation Options
Production:
pip install -r requirements.min.txt(core dependencies only)Development:
pip install -r requirements.dev.txt(includes testing and linting tools)Full:
pip install -r requirements.txt(recommended for most users)
Verify Installation
Test your installation to make sure everything is working:
This will check:
Python version compatibility (3.10+)
All required dependencies are installed
Project files are in place
Main server can be imported successfully
Configuration
Environment Variables
Create a .env file or set environment variables:
Getting Your API Token
Sign up at Layer.ai
Go to your account settings
Generate a new API token (starts with
pat_)Copy the token to your
.envfile
MCP Client Configuration
For Kiro IDE
Add to your MCP client configuration:
For Claude Desktop
Add to your Claude Desktop MCP configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
Usage
Available Tools
1. create_asset - Generate Assets
Generate sprites, characters, backgrounds, and other assets.
Parameters:
prompt(required): Description of the asset to generategeneration_type(optional): CREATE, UPSCALE, etc.width/height(optional): Output dimensions (default: 512x512)quality(optional): LOW, MEDIUM, HIGH (default: HIGH)transparency(optional): Enable transparent backgroundssave_path(optional): Local path to save the asset
Example:
2. get_workspace_info - Check Status
Get information about your Layer.ai workspace and available features.
3. remove_background - Background Removal (In Development)
Remove backgrounds from existing images using AI.
4. describe_image - Image Analysis (In Development)
Get AI-generated descriptions of images.
5. generate_prompt - Prompt Optimization (In Development)
Optimize your prompts using Layer.ai's Prompt Genie.
Usage Examples
Generate a Game Sprite
Create a Tileable Texture
Project Structure
Issues & Bug Tracking
Open Issues
High Priority
[BUG-001] Timeout issues with complex asset generation (>60s)
Status: RESOLVED (Fixed with 180s timeout in MCP config)
Solution: Added
"timeout": 180to MCP server configurationDate: 2025-08-15
Medium Priority
[FEATURE-001] Background removal feature not implemented
Status: IN PROGRESS
Description:
remove_backgroundtool returns "implementation in progress"Date: 2025-08-15
[FEATURE-002] Image description feature not implemented
Status: IN PROGRESS
Description:
describe_imagetool returns "implementation in progress"Date: 2025-08-15
[FEATURE-003] Prompt generation feature not implemented
Status: IN PROGRESS
Description:
generate_prompttool returns "implementation in progress"Date: 2025-08-15
Known Limitations
Free Tier Limits: 600 assets per month on free tier
File Size Limits: Large assets (>10MB) may have slower processing
Network Dependency: Requires stable internet connection for Layer.ai API
Python Version: Requires Python 3.10+ for full compatibility
Feature Requests
3D Asset Generation: Support for generating 3D models and textures
Animation Support: Generate sprite animations and sequences
Style Transfer: Apply artistic styles to existing assets
Bulk Operations: Process multiple assets simultaneously
Asset Versioning: Track and manage different versions of assets
Troubleshooting
Common Issues
"Invalid API token"
Check your
.envfile has the correctLAYER_API_TOKENEnsure the token starts with
pat_Verify the token is valid in your Layer.ai account
"Quota exceeded"
Check usage with
get_workspace_infotoolYou've reached the 600 asset limit for free tier
Consider upgrading your Layer.ai plan
"Network errors"
Check your internet connection
Verify Layer.ai API is accessible
The server automatically retries failed requests
"MCP connection issues"
Ensure you're running the server correctly
Check MCP client configuration
Review server logs for detailed error messages
"Timeout errors"
Increase timeout in MCP configuration:
"timeout": 180Complex assets may take 30-60 seconds to generate
Check network stability for long-running operations
"Installation errors"
Python version: Ensure you have Python 3.10+ (
python3 --version)Virtual environment: Use a virtual environment to avoid conflicts
Permissions: On Linux/macOS, you may need
chmod +x install.shDependencies: Try
pip install --upgrade pipbefore installing requirementsMCP compatibility: Some older Python versions may have MCP compatibility issues
"Import errors"
Missing dependencies: Run
pip install -r requirements.txtagainVirtual environment: Make sure your virtual environment is activated
Path issues: Ensure you're running from the correct directory
Token manager: If token_manager import fails, run the setup script
Issue Reporting Template
When reporting new issues, please use this format:
Issue Types:
BUG- Something is brokenFEATURE- New functionality neededENHANCEMENT- Improvement to existing featureDOCS- Documentation issuePERFORMANCE- Performance problem
Security
This project uses secure credential management:
AES-256 Encryption: API tokens encrypted at rest
PBKDF2 Key Derivation: Secure key generation
File Permissions: Restricted access (600)
No Version Control Exposure: Credentials never committed
License
MIT License - see LICENSE file for details.
Contributing
Fork the repository
Create a feature branch
Add tests for new functionality
Submit a pull request
Links
Made with AI - Use with caution
Start generating amazing assets for your projects with Layer.ai!