Inspiration

I already built a custom Alexa Skill which could query the landline voicemail service of Deutsche Telekom called SprachBox (see my Amazon Skill Challenge Entry from 9 years ago.

In the last view month I attended some AI courses like Introduction to Model Context Protocol and Model Context Protocol: Advanced Topics from Anthropic on coursera.

I already thought of using my experience about SprachBox to build an MCP facade to access it. But without a real use case why it should be done by MCP it stayed on my bucket list. This hackathon finally brought up the use case, because Alexa+ user experience will be empowered by MCP and I want to bring my current Skill to the next level of conversational AI.

What it does

The MCP-Server component provides access to a voicemail account by:

ressource

  • sprachbox://voicemails lists all voicemails with their details as JSON (excluding audio - just a link)
  • sprachbox://voicemails/{uid} lists details as JSON (excluding audio - just a link) of a specific voicemail

Tools

  • sprachbox_status gets the summary of the voicemail box (number of voicemails, id of last one)
  • sprachbox_list_messages similar to resource lists, but with parameter directaudio, instead of link the audio itself is included. Additional parameters to filter the list are possible.
  • sprachbox_get_message similar to resource item, but with parameter directaudio, instead of link the audio itself is included.
  • sprachbox_mark_heard changes the heard flag to true of a specific voicemail
  • sprachbox_mark_unheard changes the heard flag to false of a specific voicemail
  • sprachbox_delete_messages deletes a specific voicemail but parameter confirm must be true

Prompt

One basic prompt is returned which instructs the LLM to change heard of a voicemail after it has been played.

Audio route

All above tools are secured, but since Alexa Audio Player can only invoke a url without header enrichment, the server has an additional endpoint /audio/{token} byepathing MCP. The token is created by any MCP resource or tool giving a link to the audio. The token is valid 15min and stored in DB linket to the specific voicemail.

Chat route

/v1/agent/chat is an endpoint providing access to AWS Bedrock Converse API, so the demo client has access to LLM

Besides the audio route everything is protected by Cognito. The Server has two modes, accessing the IMAP account configured in environment. If the email domain is demo.sprachbox.pro Cognito makes an auto approval and the server is not querying the IMAP backend but using a simulated voicemail, where the items are placed in db.

How I built it

I used codex to convert the PHP backend access to the IMAP based voicemail system into python. Then I set up a project goal with target architecture (see strategy.md) and asked for open questions to identify problems (see problems.md) to identify where assumptions would be made and replaced those with my decisions.

Then I started implementing component by component (see change-log.md), but also revised my planing. WAF and SecretManager are postponed post DEMO, when going live.

Challenges I ran into

codex generated code was not on point sometimes e.g. Bedrock Converse API is invoked differently in EU or Cognito token verification depending on user's email domain was somehow tricky. (see change-log.md for detailed technical issues I need to fix)

I took vacation on last Hackathon week to get it done - but the PHP Crises then forced me to spent some time on existing projects. Furthermore Codex Budget run out quite quickly.

Accomplishments that I'm proud of

Within a concentrated week I managed to get a working MCP accessing a real SprachBox AND providing a simulation for DEMO purpose - so I can't wait to get it live for Alexa+

What I learned

Codex (as representative for AI) needed strict guidelines - it always tries to do more and overarching. So main task is to limit the scope of each development step, so that issues can clearly identified and not buried under to many changes. It was always good to ask for a plan and discuss way forward and challenge assumptions and only after aligning allow code generation - when missing it to fast code generation consumed too much tokens and likely needed rework / undo, because of wrong assumptions.

What's next for SprachBox via MCP for Alexa+

Moving the credentials from server environment settings to secret manger and providing a federation function, so that a non demo Cognito account could connect to an individual real voicemail account and not sharing one.

Built With

Share this project:

Updates

Submission history