How to Build with ElevenLabs and Cursor at a Hackathon
Build voice AI hackathon projects with ElevenLabs and Cursor. The exact PRD-first, MCP-driven, test-driven workflow Bill uses to ship in hours.
Why Voice AI Wins Hackathon Demos
Walk into any hackathon expo and you will see two hundred dashboards and chatbots. The one project that makes judges actually stop and lean in is the one that talks back. Voice is the demo element nobody else thought to add, and the moment your app answers out loud in a real human voice, you stop being another browser tab in the lineup.
What Judges Actually Remember
Three things make a hackathon demo stick: it responds in real time, it does more than one modality, and it sounds like a person. ElevenLabs is the shortest path to all three, no matter what your stack looks like.
~75ms
Flash Latency
70+
Languages
10K
Free Chars/mo
3 mo
Free for MLH
Step 0: Write the PRD First
AI agents will happily write all the code you need. They will not guess what you actually want. Before Cursor opens a single file, write down what you are building, who it is for, and what success looks like. Save it as PRD.md and AGENTS.md at the repo root, so every future prompt has the same source of truth to read.
Run the domain-to-spec skill
It interviews you about your profession and goal, then writes AGENTS.md and PRD.md to the repo root.
List the routes and components
Under PRD.md > Frontend Pages and Backend Routes, name every screen and endpoint the agent should scaffold.
Define done
Add an Acceptance Criteria section. List the exact behaviors a working demo must have. This becomes your test plan in the TDD section below.
Do Not Skip This
Skip the PRD and the agent will reinvent your data model on every other prompt, hallucinate features you never asked for, and burn through your API credits chasing its own tail. Twenty minutes writing PRD.md saves four hours of debugging.
The Modern Hackathon Workflow: Agents Write the Code
In 2026, nobody on a winning hackathon team is typing out CRUD endpoints by hand. Cursor types them. Claude Code types them. The human job is the part the agent cannot do for you: pick the problem, define the interface, decide if the output is good, and pitch the result on stage.
This matters most at hackathons because time is the only thing you do not have. A team that hands implementation to an agent and spends those saved hours on UX, demo polish, and the pitch will beat a team that types every line by hand. Every single time.
Step 1: Check if the Tool Has an MCP
An MCP (Model Context Protocol) server is a small program that hands your AI agent a real menu of typed, callable tools for a specific service. Instead of pasting docs and hoping, the agent sees actual actions like 'generate speech', 'clone a voice', or 'transcribe this file', and gets back structured data it can reason about.
ElevenLabs ships an official one at github.com/elevenlabs/elevenlabs-mcp. Drop the config below into Cursor and your agent gets direct access to text-to-speech, voice cloning, sound effects, transcription, and the ElevenAgents platform. No copy-pasting docs into prompts required.
{
"mcpServers": {
"ElevenLabs": {
"command": "uvx",
"args": ["elevenlabs-mcp"],
"env": {
"ELEVENLABS_API_KEY": "<your-api-key-here>"
}
}
}
}Step 2: No MCP? Paste the Docs
Some tools do not have an MCP server yet. The fallback is to give Cursor a direct link to the official docs in the prompt itself. Cursor fetches the page, reads it, and uses the live API surface instead of whatever stale version the model remembers from training.
Here is the exact shape of a Cursor prompt I would use to build a streaming text-to-speech endpoint when no MCP is available. Notice it has a file anchor, a behavior spec, a constraint list, and a 'Done when' section. Cursor stops when the conditions are met instead of wandering off.
Read https://elevenlabs.io/docs/overview/intro and PRD.md > Backend Routes.
Create app/api/speak/route.ts in Next.js 15 (App Router, TypeScript).
Behavior:
- POST handler, accepts { text: string } JSON body
- Calls ElevenLabs text-to-speech with model_id "eleven_flash_v2_5"
- Voice ID and API key come from process.env (already in .env.local)
- Returns audio as a streaming audio/mpeg response
Constraints:
- Use the official @elevenlabs/elevenlabs-js SDK (install if needed)
- No retries, no caching, no logging
- Do not touch any other route or component
Done when:
- curl -X POST localhost:3000/api/speak -d '{"text":"hello"}' returns audio bytes
- The response Content-Type is audio/mpeg
- npm run build passes with no new TS errorsPro Tip
Always paste the docs URL inside the prompt. Cursor reads the linked page in real time, which is way more accurate than asking the model to recall an API from memory.
Step 3: Paste the API Key, Then Let the Agent Build and Test
Drop your API key into .env.local at the project root. Both the MCP server and your application code read from this same file, so you never have to think about it again.
ELEVENLABS_API_KEY=sk_your_key_here
ELEVENLABS_VOICE_ID=JBFqnCBsd6RMkjVDRZzb
ELEVENLABS_MODEL_ID=eleven_flash_v2_5Now hand the agent a clean task: read the PRD, build the next unfinished feature, run the test, stop only when the test passes. A good agent will read the docs on its own, scaffold the files, install the dependencies, hit the live API, and verify the response. Your job is to watch the loop and step in when it goes sideways.
Do This
- Reference PRD.md and AGENTS.md in every prompt
- Tell the agent which test must pass to finish
- Specify the model (eleven_flash_v2_5 for real-time)
- Ask for one feature per prompt
Avoid This
- ✕'Just build the voice feature' (too vague)
- ✕Letting the agent pick the model on its own
- ✕Multiple unrelated features in one prompt
- ✕Skipping the test step to save time
Test-Driven Development with AI Agents
The single highest-leverage trick I have found when building with an agent is to flip the order. Make the agent write the test first, then make it build the feature that satisfies the test. It is classic test-driven development (en.wikipedia.org/wiki/Test-driven_development) applied to a coding partner that happens to be an LLM.
Red
Ask the agent to read PRD.md > Acceptance Criteria and generate a failing test for the next feature. Run it. Confirm it fails for the right reason.
Green
Ask the agent to write the minimum code that makes that test pass. Run the test. Iterate until it passes.
Refactor
Ask the agent to clean up the code it just wrote without breaking the test. Run the test one more time to be sure.
“Never write a new piece of functionality without a failing test.”
Why This Wins
Tests turn 'looks fine' into 'provably works.' Once the agent has a hard pass/fail signal, it stops hallucinating and starts converging. You also get a regression suite for free, which is priceless when you swap voices or models five minutes before demo.
Watch Your Spend and Ship It
AI agents in a tight loop can rack up real money fast. Both your Cursor subscription and your ElevenLabs credits are on the line if you walk away from a misbehaving agent at hour 18 of a hackathon. Do not.
Babysit the Loop
Keep the agent chat visible at all times. Watch for runaway retries, infinite tool calls, and the agent re-generating the same audio file twenty times in a row. One bad prompt can burn a week's worth of free tier in twenty minutes.
Pre-Flight Before You Start the Agent Loop
Get the Voice AI Stack the Pros Use
Free tier covers a hackathon. Paid plans unlock voice cloning, agents, and longer audio.
Non-Coders Winning Hackathons
How professionals with zero coding experience are beating dev teams using AI agents like Cursor.
Best Tech Stack for Hackathons in 2026
The full stack winning teams use, from frontend to deployment to AI APIs.
Ready to put these strategies into action?
Explore the full 7-phase hackathon playbook with interactive tools and templates.
Open the Playbook →