Agent-readable docs index: /llms.txt. Full docs in one file: /llms-full.txt. Download /docs.zip to grep all markdown files locally.
createCodeFileTOOL
Create a new code file in the Framer project. Code files can export either code components or overrides.
ALWAYS read the MCP resource file mcp://mcp.unframer.co/prompts/how-to-write-framer-code-files.md to see how to create code components and overrides.
You can use typescript and React. You can also import components in the project by using getComponentInsertUrlAndTypes to get their import url.
When creating a code component you should also define its property controls via Framer addPropertyControls.
Returns the ID, path, and insertUrl of the created code file. Use updateXmlForNode with the insertUrl in a ComponentInstance node to add the component to the canvas.
Parameters
name *string
The name of the code file (e.g., "MyComponent.tsx")
content *string
The TypeScript/React code content for the file
Request example
{ "method": "tools/call", "params": { "name": "createCodeFile", "arguments": { "name": "string", "content": "string" } } }