build_plugin
Compile a Framer plugin project from a specified directory to enable web3 features such as wallet connections, contract interactions, and NFT displays.
Instructions
Build a Framer plugin project
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| pluginPath | Yes | Path to plugin directory |
Implementation Reference
- src/index.ts:345-372 (handler)The handler function that implements the build_plugin tool. It resolves the plugin directory, verifies it exists, executes 'npm run build' in that directory, and returns a success message.private async handleBuildPlugin(args: BuildPluginArgs) { try { const pluginDir = path.resolve(args.pluginPath); // Verify plugin directory exists if (!await fs.pathExists(pluginDir)) { throw new Error(`Plugin directory not found: ${pluginDir}`); } // Run build command const { execSync } = require('child_process'); execSync('npm run build', { cwd: pluginDir, stdio: 'inherit' }); return { content: [ { type: 'text', text: `Successfully built plugin at ${pluginDir}` } ] }; } catch (error) { throw new McpError( ErrorCode.InternalError, `Failed to build plugin: ${error instanceof Error ? error.message : String(error)}` ); } }
- src/index.ts:20-22 (schema)TypeScript interface defining the input parameters for the build_plugin tool: pluginPath (string).interface BuildPluginArgs { pluginPath: string; }
- src/index.ts:93-106 (registration)Tool registration in the ListTools response, including name, description, and JSON input schema.{ name: 'build_plugin', description: 'Build a Framer plugin project', inputSchema: { type: 'object', properties: { pluginPath: { type: 'string', description: 'Path to plugin directory' } }, required: ['pluginPath'] } }
- src/index.ts:114-115 (registration)Dispatch case in the CallToolRequest handler that routes to the build_plugin handler function.case 'build_plugin': return this.handleBuildPlugin(request.params.arguments as unknown as BuildPluginArgs);