Skip to content

How to rotate MCP tokens and connect StackChan to a custom AI backend? #126

Open

Description

@yuqingfeng002-creator

Hello M5Stack team,

I recently purchased an M5Stack StackChan and successfully connected it to Wi-Fi. The official firmware is working, including voice input and audio playback.

I have two questions:

1. MCP Token Security

The StackChan mobile app displays a WebSocket MCP endpoint containing an authentication token.

I accidentally exposed this token in a screenshot.

Is there an official way to revoke and regenerate the MCP token without unbinding or factory-resetting the device?

I would like to preserve my existing Wi-Fi configuration, device binding, and AI settings.

2. Custom AI Backend Integration

I am developing a personal AI assistant called Anchor, which runs on a separate Ubuntu server.

I would like to use StackChan as a physical interface for Anchor while keeping all AI processing and memory on my existing server.

Ideally, StackChan would:

  • Connect securely to my custom backend.
  • Send microphone audio to the backend.
  • Receive generated speech audio for playback.
  • Display facial expressions controlled by the backend.
  • Retain its existing hardware functionality.

Does the official StackChan firmware support connecting to a custom AI backend?

If not, is there a recommended extension mechanism or documented firmware modification approach?

I would prefer to avoid replacing the official firmware unless necessary.

Thank you for your help!

Activity

  1. Forairaaaaa commented on Nov 3, 2026

    @Forairaaaaa
    Contributor

    Hi, the MCP token is issued by the Xiaozhi service. The public app code requests an endpoint token, but we cannot confirm that requesting another one revokes the exposed token. Please remove the exposed screenshot and contact M5Stack support privately for assistance with revocation. Unbinding or factory-resetting the device should not be assumed to invalidate it.

    For Anchor, MCP provides a way to expose your assistant’s functions as tools while keeping the official firmware. However, this still uses Xiaozhi’s voice and AI pipeline; MCP alone does not redirect microphone audio or replace the backend. See the upstream MCP documentation.

    To keep all AI processing on your Ubuntu server, you would need a Xiaozhi-compatible backend or bridge handling audio, session control, and expression messages, plus changes to the device’s connection configuration. The official firmware does not currently provide a user-facing setting for an arbitrary backend. The upstream WebSocket protocol is a starting point, but this would require integration work and potentially a custom firmware build.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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