Skip to content

Feature Proposal: Add MCP (Model Context Protocol) Server Support to DeSmuME #950

@suhli

Description

@suhli

Summary

I would like to propose adding support for an MCP (Model Context Protocol) server to DeSmuME.

I have already implemented a working prototype based on the current codebase here:

https://github.com/suhli/desmume/tree/mcp

This branch demonstrates that integrating an MCP server into DeSmuME is feasible with minimal intrusion into the existing architecture.


Motivation

Adding MCP server support would allow:

  • External AI agents (e.g., Cursor, LLM-based tools) to interact with the emulator programmatically
  • Automated testing and scripted control of emulator state
  • Memory inspection and manipulation through a standardized protocol
  • Remote debugging and tooling integration
  • Advanced automation workflows

This would make DeSmuME significantly more extensible for modern AI-assisted workflows.


What the Prototype Implements

The mcp branch currently includes:

  • Embedded MCP server inside DeSmuME
  • Emulator state control (start, stop, reset, etc.)
  • Memory read/write APIs
  • Frame stepping support
  • Basic structured command interface

The implementation is isolated and does not interfere with the normal UI execution path.


Design Considerations

  • The MCP server runs in a separate thread.
  • Communication is JSON-based.
  • The feature can be compiled optionally (e.g., via a build flag).
  • No changes to core emulation logic were required.

If maintainers prefer, this can be:

  • A compile-time optional feature
  • A separate build target
  • Or maintained as a plugin-style integration

Questions for Maintainers

  1. Would you be open to integrating MCP server support?

  2. Should this be implemented as:

    • A core optional module?
    • A plugin?
    • Or kept as a separate fork?
  3. Are there architectural constraints I should follow before preparing a PR?


Next Steps

If there is interest, I can:

  • Clean up the branch
  • Split into smaller reviewable commits
  • Add documentation
  • Submit a formal PR

Looking forward to your feedback.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions