# PhotoCraft MCP (eCortesCL) > Estudio de diseño gráfico por capas para agentes de IA: crea y edita PSD editables con el motor PhotoCraft, guarda marcas, biblioteca de archivos y skills por cuenta, y busca o genera imágenes con las claves del usuario. ## Endpoint - MCP (Streamable HTTP, POST): https://mcp-photocraft.ecortes.cl/mcp - Panel web: https://mcp-photocraft.ecortes.cl/panel - Salud: https://mcp-photocraft.ecortes.cl/healthz ## Autenticación - OAuth 2.1 propio con registro dinámico de clientes (https://mcp-photocraft.ecortes.cl/register), PKCE S256 y scope `mcp`. - Metadatos: https://mcp-photocraft.ecortes.cl/.well-known/oauth-authorization-server y https://mcp-photocraft.ecortes.cl/.well-known/oauth-protected-resource/mcp - /mcp sin Bearer válido responde 401 con WWW-Authenticate (resource_metadata). - Alternativa para CLI/scripts: token personal creado en Panel → Conectar, enviado como `Authorization: Bearer pcm_sk_…`. Nunca en la URL. - Las claves de Unsplash, Pexels, Pixabay y OpenAI las carga cada usuario en Panel → Integraciones (cifradas). Nunca se piden por chat. ## Herramientas (36) - `studio_overview`: START HERE. Lists brands, recent projects, library counts, canvas presets and the recommended design workflow. - `font_list`: Font families the engine can render (system fonts + brand fonts uploaded to the library). Check here before choosing a font; a missing font falls back silently. - `brand_list`: All saved brand kits (summary). - `brand_get`: Full brand kit: colors, fonts, voice, guidelines, the design.md (binding design rules) and every asset (logos, fonts, references) attached to it. Load this before designing. - `brand_save`: Create a brand kit or update an existing one (matched by name or id). Replaces the colors/fonts lists when provided. Persist what the user tells you about their brand here so designs stay consistent across sessions. - `brand_delete`: Deletes the kit. Its assets and projects are kept (unassigned). - `asset_list`: Search the persistent library of logos, reference images, photos, textures and fonts. Filter by brand, kind, tag or free text. - `asset_get`: Asset metadata plus an inline preview image so you can actually look at a logo or reference. - `asset_add`: Persist a logo, reference image, photo, texture or font (.ttf/.otf) in the library, optionally attached to a brand. Provide `url` (public http/https) or `data_base64`. For big files use asset_request_upload. For fonts pass font_role (e.g. heading/body) to register the family in the brand kit automatically. - `asset_request_upload`: For large files (photos, PSDs, fonts): returns a single-use PUT URL (valid 1h). The user or you can `curl -T file `. The file lands in the library with the metadata given here. - `asset_update`: Rename, retag, add notes, change kind or reassign an asset to another brand (brand: "" detaches it). - `asset_delete`: Permanently removes an asset. Designs that already embed it keep their copy. - `project_create`: Create a project (one creative with versioned PSDs). Attach a brand so brand tokens resolve. Canvas: preset (instagram_square, instagram_portrait, instagram_story, facebook_post, facebook_ad, linkedin_post, … see studio_overview) or width+height. - `project_list`: Projects, newest first, optionally for one brand. - `project_get`: Brief, brand, last DesignSpec and versions with fresh download links. - `project_update`: Rename, change brief or switch brand (brand: "" detaches). - `project_delete`: Permanently deletes the project and all its versions/exports. - `design_render`: Builds a NEW layered document from a DesignSpec and saves it as the next version (PSD + native + PNG). Returns a preview image, the layer list, warnings and download links. Layers are bottom→top; text stays live type, shapes stay vector, images are smart objects, effects are layer styles, so designers can edit everything. Example: {"canvas":{"preset":"instagram_portrait","background":"brand:background"},"layers":[{"type":"image","name":"Hero photo","asset":"ast_…","x":0,"y":0,"w":1080,"h":800,"fit":"cover"},{"type":"shape","name":"Panel","shape":"rect","x":0,"y":800,"w":1080,"h":550,"fill":"brand:primary"},{"type":"text","name":"Headline","text":"Hasta 40% OFF","x":60,"y":840,"w":960,"size":96,"weight":800,"font":"brand:heading","color":"#ffffff","effects":[{"kind":"dropShadow","params":{"opacity":35,"distance":6,"size":12}}]},{"type":"image","name":"Logo","asset":"brand:logo","x":60,"y":1230,"h":60,"fit":"contain"}]}. Keep ≥5% margins, one clear focal point, strong contrast, max 2 typefaces. - `design_open`: Opens a version and returns its layer tree (names, kinds, bounds) plus a preview. Use before design_edit to learn exact layer names. - `design_edit`: Applies targeted edits to the latest (or given) version and saves a new version: change text/styles, move/resize, recolor, set opacity/blend, add or delete layers, swap images, restyle effects, or run raw engine commands. Layers are addressed by name. This preserves everything else, including edits a designer made in the PSD. Returns per-op results, preview and downloads. - `design_preview`: Flattened preview image of a version. - `design_export`: Export a version to PSD (layered, editable), PNG, JPG, WebP, TIFF, PDF or .pcraft. `scale` resizes (percent, e.g. 200 for @2x). Returns time-limited download URLs (24h). - `design_versions`: Version history of a project. - `design_restore`: Makes an older version the latest by saving it as a new version. - `import_design`: Turn an uploaded file (editable PSD, or a final PNG/JPG) from the library into a project version so you can keep editing it. PSD layers, live text and styles are preserved; a flat image becomes a single layer you can build on. - `integrations_status`: Shows which stock-photo banks (Unsplash, Pexels, Pixabay) and AI image generation (OpenAI) are configured in the admin panel, plus the daily AI limit left. - `stock_search`: Search royalty-free photo banks (Unsplash, Pexels, Pixabay) with the keys configured in the panel. Searches every configured bank unless `provider` is given. Returns results with a few inline thumbnails; pass a result's `ref` to stock_import to save it to the library. Use English queries for best results. - `stock_import`: Downloads the photo behind a stock_search `ref` into the asset library (with the photographer credit in its notes) so design_render can use it as `asset`. - `image_generate`: Create an image with OpenAI and save it to the library. Best for hero visuals, textures, illustrations and cut-out objects. Do NOT ask it to render the headline/body text or logos: place those as live text/logo layers. Use background=transparent for cut-outs. Pass reference_assets (library ids, e.g. a product photo or logo) to edit/compose from them. Costs money; the daily limit is set in the panel. - `skill_list`: Design know-how documents loaded by the user (composition, typography, color, logo usage, formats…). Check this before designing and read the relevant ones with skill_get. - `skill_get`: Full markdown of a skill. Follow it as the user's own design standard. - `skill_save`: Save a design skill (markdown). Use when the user dictates a reusable design rule or workflow worth keeping. - `skill_delete`: Remove a skill. - `engine_commands`: Search the ~940 Photoshop-style engine commands (filters, masks, selections, smart objects, blend/adjustment layers, warps, gradients, layer comps, paths…). Returns id + parameter docs. Use with engine_run, design_edit{op:raw} or a layer's ops[]. - `engine_run`: Power tool: open a project's version, run engine commands in order (see engine_commands), save as a new version. Commands act on the active layer/selection like in Photoshop; use layer.select first. File-path commands are disabled by the sandbox; use asset-based tools for images. If the project has no version yet, pass new_document. - `engine_status`: Checks that the PhotoCraft engine boots and reports its command count.