Skip to content
Limited timeStarter is now $9 a month instead of $20.See plans
charmotion

Vibe Coding an Interactive Hero Mascot for a SaaS Landing Page with MCP

By the Charmotion team · Updated · How we write guides

Cover illustration for the guide: Vibe Coding an Interactive Hero Mascot for a SaaS Landing Page with MCP, with Charmotion demo characters

To vibe code an interactive AI landing page mascot with Cursor and MCP, connect an MCP character server to Cursor's mcp.json, have the assistant generate one animated .riv file, and wire a single mood number from your page state into the hero component. The mascot changes state with the page without shipping a separate video for each state.

Key takeaways

  • Add the MCP server to Cursor's mcp.json, then keep the URL there and no API key.
  • Generate one .riv file with a number property named mood, and treat that number as the only contract with your page.
  • Map page events to fixed mood numbers in one file, so Cursor edits stay small and predictable.
  • Test every mood in the browser and ship a static poster for slow or unsupported devices.

Already have a character or logo? See examples in real app screens: splash, onboarding, loading and empty-state screens, with the animation that plays in each.

What does an interactive hero mascot need from your codebase?

This guide covers how to vibe code an interactive AI landing page mascot with Cursor and MCP, from the first config line to a tested hero section. A hero mascot is a small app inside your landing page. It needs one file the browser can load, a way for page code to set its state, and a fallback for when the file cannot play.

Most of the work is in the state wiring. AI coding assistants make mistakes there when the contract between the file and the page is not written down. Decide the contract first, then let Cursor build around it.

The file used here is a Rive .riv export. A .riv file bundles artboards, animations, state machines and data binding in one file, and it is loaded directly into a website or app. Rive's Data Binding runtime API lets app code read and write live values in the file while it runs (Rive Data Binding runtime API).

For a React or Next.js landing page, Rive recommends its @rive-app/react-canvas package for most apps (Rive React runtime). Check the current runtime docs before you pin a version, because the state input hooks in older examples have been replaced by data binding hooks.

If you are new to the format, the basics are in how to animate a logo or character from Claude, Cursor or VS Code with MCP. That guide covers the same connection steps for other clients.

How do you connect Cursor to a character MCP server?

Cursor reads MCP servers from mcp.json. A global file at ~/.cursor/mcp.json applies to every project you open. A file at .cursor/mcp.json inside a project applies only to that project, which is the right place for a server the whole team should share. Server entries sit under a top-level mcpServers object, with the server name as the key.

The Charmotion character server runs at https://charmotion.app/mcp over Streamable HTTP and signs you in with OAuth, so the config needs a URL and no API key:

{
  "mcpServers": {
    "charmotion": {
      "url": "https://charmotion.app/mcp"
    }
  }
}

Cursor resolves variables such as ${env:NAME} in the url and headers fields, so you can add a header later if your setup needs one. Remote servers that use OAuth complete sign-in the first time Cursor connects.

Two details trip up teams. Cursor's hosted Cloud Agents do not read ~/.cursor/mcp.json, and they use servers configured at cursor.com/agents instead, so add the server there too if an agent will build the hero. The Cursor Terminal UI does read .cursor/mcp.json, so a server set up in the project works there as well (Cursor MCP documentation, project MCP configuration).

Disclosure: Charmotion is our product. The server above is the one this guide uses. The same URL works in other MCP clients listed on the MCP server page.

How do you have Cursor generate the mascot file?

Ask Cursor to call the design tools rather than writing animation code yourself. The server has two starting points: design_character makes a character with AI (1 credit), or you upload an existing character image. The image is checked first. It needs one finished, coloured character facing the viewer with visible eyes and mouth. Sketches, photos, groups and busy scenes are refused, and nothing is charged for a refusal.

Next, create the animation set. Idle, a 4.0 second breathing and blinking loop, is always included for free. Launch, happy, wave and loading are preselected. Ask for the set with create_character_set, and add more later with add_animations. Only new animations use credits, at 1 credit each. The ten animations are launch, happy, wave, loading, thinking, sad, listening, talking, sleeping and attention.

Then ask for the download links. get_character_set returns them along with an AI_README for coding assistants. Use export_videos when you also need a poster or a video fallback. Exports do not use credits and take about a minute.

A prompt for Cursor can be short, as long as it names the files and the contract:

Generate a character set for our hero mascot with idle, happy, wave, loading and sad. Download the .riv file and the AI_README into public/mascot/. Then read the AI_README before you write any code.

Keep the change history in the repo. When the mascot needs a new expression, run the MCP tools again rather than editing the .riv file by hand.

How do you wire the mascot's mood to the hero component?

The output file contains CharacterViewModelMachine, with a number property named mood, and CharacterStateMachine, with a number input named mood. LaunchStateMachine is included only when launch was picked, and it plays launch once and then settles on idle. Your page sets only the mood number. The file blends between moods on its own.

The mood numbers are fixed, so the same mapping works for every character you generate:

MoodNumber
idle0
happy1
wave2
thinking3
sad4
loading5
listening6
talking7
sleeping8
attention9

Characters have no one-shot triggers such as success, error, yes or no. Show a success with happy and an error with sad. Put the mapping in one file so Cursor has one place to change:

export const MOOD = {
  idle: 0,
  happy: 1,
  wave: 2,
  thinking: 3,
  sad: 4,
  loading: 5,
  listening: 6,
  talking: 7,
  sleeping: 8,
  attention: 9
};

Some moods show small accents, such as Z z z while sleeping and sparkles when happy. They are on by default, and the boolean accents hides them. Decide whether the hero needs them before you ship, because they change how the mascot reads at small sizes.

The hero prompt should name the mapping and forbid new numbers:

Add the mascot to the hero of app/page. Load public/mascot/character.riv with the Rive React runtime. Set mood from lib/mascot-moods.ts: loading while the signup form submits, happy on success, sad on a failed request, wave on first visit. Give the canvas a fixed width and height so the layout does not shift. Do not add mood numbers that are not in the table.

For a deeper pattern covering state changes from app data, read how to drive Rive character mood states from app state. For rules Cursor should follow in every session, see writing CLAUDE.md and .cursorrules for Rive data binding.

How do you test the hero before it goes live?

Test each mood on the real page, not in an isolated preview. Trigger the signup success path, the failed request, the first visit and the idle state, and confirm the mascot moves to the expected number each time. A mood that never changes usually means the mapping ran before the Rive instance loaded, or the property name in the code does not match the file.

Check the file itself before you trust the page. The guide on inspecting MCP-generated data binding ViewModels covers the names to look for. Preview the file alone when a mood looks wrong, using the steps in previewing MCP-generated Rive animations.

Plan the fallback. Export a poster with export_videos, and serve a static image for visitors on very slow connections or devices that cannot run the file. For a video fallback, Safari does not reliably show WebM alpha, so pair a transparent WebM with a transparent MOV. The steps are in serving transparent WebM with an HEVC alpha MOV fallback.

Read the license before launch. Exported .riv files depend on the plan you use to make them, and the terms that apply to a commercial site are summarized in is Rive free and what the pricing means for commercial use.

What does this setup cost and where does it fall short?

Each character costs credits from one balance: an AI design costs 1 credit, each animation costs 1 credit, and idle is free. Adding animations later uses credits only for the new ones. Exports and logo concepts do not use credits. Plan details and monthly allowances are on the pricing page.

The limits are specific. The character must be one front-facing figure. Moods are fixed at ten numbers, and characters have no one-shot triggers. The engine rigs the drawing it is given, so a 3D or highly detailed image may be converted to the Charmotion style first (1 credit), and you choose which version to animate.

Custom interactions, such as a mascot that follows the cursor or lip-syncs a recording, belong in the Rive editor or with an animator. The onboarding and empty state patterns show where a simple mood mapping is enough and where a bespoke state machine is worth the time.

For a team choosing between a generated set and a hand-built file, the tradeoff is control versus speed. A generated set gets a working hero in one session. A custom file gives you more states and tighter brand control, at the cost of design time.

Vibe code an interactive hero mascot with Cursor and MCP

  1. Add the MCP server to mcp.json. Open ~/.cursor/mcp.json for all projects or .cursor/mcp.json for one project, and add the Charmotion server under mcpServers with the URL https://charmotion.app/mcp. No API key is needed; sign in with OAuth when Cursor prompts you.
  2. Design or upload the character. Ask Cursor to call design_character, or upload one finished, front-facing character image. Refused images are not charged.
  3. Create the animation set. Call create_character_set with idle included for free plus the moods you need, such as happy, wave, loading and sad. Use add_animations later for new moods, then get_character_set for the download links and AI_README.
  4. Build the hero component. Ask Cursor to load the .riv file with the Rive React runtime and to read a mood mapping file that uses the fixed numbers: idle 0, happy 1, wave 2, sad 4, loading 5 and the others in the table.
  5. Test each mood and ship with a fallback. Trigger every page state, confirm each mood changes, check the layout does not shift, then add a poster image and a transparent video fallback for Safari before publishing.

Frequently asked questions

Do I need to know Rive to build this hero?

Not for the default path. You need to read the mood mapping, check that the page sends the right number at each step, and keep the canvas size fixed. Rive knowledge helps when a mood looks wrong, because you can then preview the file on its own and inspect its properties.

Can Cursor edit the .riv file directly?

Treat the .riv file as an export, not a source file. To change the character or add a mood, run the MCP tools again and download a new file. Keep the mood numbers in the page code, so a new export only needs to be swapped in.

Does the same server work outside Cursor?

Yes. The Charmotion MCP server uses the same URL and OAuth sign-in in other MCP clients that support remote servers. The setup differs by client, so check each client's own configuration file before you copy the Cursor steps.

Should I check plan terms before the hero goes live?

Yes. Read the Rive plan terms that apply to your exports before you publish on a commercial site. The plan you use to create the file matters, and the current terms are explained in the linked pricing guide.

Sources

Related guides