A murder mystery is supposed to make you think. But when you put an AI agent into the game, there is an obvious problem: what stops the AI from simply reading the entire case and telling you who the killer is?

That question inspired Casefile.

Casefile is an AI-native detective game built around the idea that an AI agent should be a co-investigator, not an answer machine. The player investigates a murder case while an AI agent investigates alongside them through WebMCP.

Instead of giving the agent access to the entire game state, Casefile exposes structured investigation tools such as searching locations, discovering evidence, inspecting clues, interviewing suspects, and reconstructing timelines. The agent can perform real investigative actions and help the player connect information, but hidden evidence and the solution remain inaccessible until the investigation legitimately uncovers them.

The human still has to make the final deduction.

Why WebMCP?

Traditional web agents have to interact with websites by interpreting the interface and figuring out what actions are available. WebMCP changes that by allowing a website to expose its capabilities as structured tools.

That makes a detective game particularly interesting.

Instead of asking an AI to click around Casefile and guess what buttons mean, Casefile gives the agent an actual investigative toolkit. The agent can reason about the case while using tools specifically designed for investigation.

This creates a different interaction loop:

Human observes → AI investigates → AI finds connections → Human evaluates the theory → Human makes the accusation.

The goal was not to make the AI smarter than the player. The goal was to make the player better at investigating with the AI.

How We Built It

Casefile is a web application with multiple independent investigations. Each case has its own suspects, locations, evidence, timeline, deductions, and solution.

WebMCP tools are registered directly by the application and operate against the currently selected case. The investigation state determines what information is available to both the human and the agent.

Some of the core tools include:

  • get_case_state — retrieve the player's current investigation state
  • search_evidence — discover available evidence
  • inspect_evidence — investigate discovered clues
  • search_locations — investigate locations
  • get_suspects — view known suspects
  • interview_suspect — conduct interrogations
  • build_timeline — reconstruct events
  • submit_accusation — make the final accusation

A major part of the implementation was ensuring that the agent cannot simply request the answer key. Hidden case data and solution logic are kept server-side, while WebMCP only exposes information that the investigator has legitimately unlocked.

We also built the cases around deductions rather than simply collecting clues. Evidence can be incomplete, ambiguous, or misleading, meaning that finding a clue is not necessarily the same as understanding it.

What We Learned

The biggest lesson was that building an agent-native application is not just about adding an AI interface to an existing website.

You have to rethink what information the agent is allowed to know and what actions the agent is allowed to perform.

During development, we discovered that exposing too much case data—even indirectly—could completely undermine the game. We therefore treated the WebMCP tools as part of the game's rules, not just as an API.

We also learned that good agent experiences require clear tool boundaries. Each tool needs to expose enough information for the agent to reason effectively without accidentally exposing information that should remain part of the mystery.

Challenges

The hardest challenge was balancing AI capability with human agency.

If the agent knows too little, it becomes useless. If it knows too much, the game becomes a simple question-and-answer session.

We also had to solve state isolation between multiple cases, prevent agents from bypassing evidence discovery, prevent premature accusations from revealing the solution, and ensure that sensitive case information was not shipped to the browser where it could be reconstructed.

Testing the application with an actual WebMCP agent became an important part of development. Rather than only testing whether the UI worked for a human, we had to ask:

"What happens if an agent tries to break the investigation?"

That led us to build security and regression tests around evidence access, case isolation, premature accusations, timeline reconstruction, and client-side solution exposure.

What Casefile Represents

Casefile is our exploration of a simple idea:

The future of AI applications may not be about AI doing everything for us.

Sometimes the better experience is an AI that can act, investigate, and reason alongside us—while leaving the important decisions in our hands.

With WebMCP, Casefile turns that idea into a game.

Built With

Share this project:

Updates

Submission history