Local speech recognition & synthesis

Creating a local voice assistant: ASR·LLM·MCP·TTS connection guide

Design the connection flow and verification steps for ASR, an LLM, MCP, and TTS using a calendar lookup.

A local voice assistant uses ASR1 to turn microphone audio into text, an LLM2 to organize the request and tool results, and TTS3 to speak the answer. Using a calendar-reading request, this guide explains how to design tool inputs and outputs, permissions, and response timing. Begin with a read-only tool and require user confirmation for actions that change state.

When you say, “Read my schedule for this afternoon,” ASR transcribes the request, the LLM selects a calendar lookup tool and turns the returned events into a reply, and TTS speaks it. Let the user first connect calendar reading and inspect the result, then choose which capability to add next.

Requirements and key details
  • ASR converts speech to text, the LLM handles the request and tool result, and TTS turns the reply text into speech.
  • An MCP server lets the LLM call tools such as a calendar. Begin with read-only permissions.
  • Partial transcripts may change, so wait for a final transcript before changing or deleting files or sending something externally.
  • Recording the time until the final audio and the duration of each stage helps locate delays and errors.

A calendar request becomes text, a tool call, and a spoken reply

After ASR turns “Read my schedule for this afternoon” into text, the LLM identifies the request and the tool to use. The calendar MCP4 tool receives the lookup range; the server returns events, which the LLM turns into a reply for TTS. Keeping the microphone input, transcript, tool request, tool result, and audio output in order makes it easier to locate the first incorrect result.

The MCP TypeScript SDK passes a tool name and JSON arguments to client.callTool and returns the result in a content list. The example below uses that call pattern to illustrate a read-only calendar tool design. calendar.read_events, startTime, and endTime are illustrative names and fields, not an actual calendar API5. Check the connected server's tools/list for its real tool name and input schema, then substitute those values.

Inputs and results at each stage of a calendar lookup
StageInputOutput
ASRSpoken request captured by the microphoneRecognized text
LLM decisionRecognized textCalendar tool to call and its arguments
MCP calendar lookupTool name and JSON argumentsEvents returned by the tool
LLM and TTSEvent resultsReply text and audio playback
Design example: read-only calendar call
const result = await client.callTool({
  name: 'calendar.read_events', // illustrative name; use the server's advertised tool name
  arguments: {
    startTime: '2026-10-08T13:00:00+09:00',
    endTime: '2026-10-08T18:00:00+09:00'
  }
});
console.log(result.content);
Check that the tool name and range fields match the server's schema before sending the read request.
Design example: events returned for the same time range
{
  "content": [
    {
      "type": "text",
      "text": "2026-10-08 14:00–14:30 | event_A"
    }
  ]
}
This response shape returns only events within the requested 13:00–18:00 range. event_A is an illustrative placeholder.
Audio path from the microphone through ASR, a local LLM, an MCP tool, and TTS to the speaker
Checking each stage's input and returned result helps locate a failed connection.

Check the calendar tool's input schema and read result

A read-only calendar tool takes a date and time range as input and returns only events within that range. If the tool is implemented for lookup only, it does not need permission to change calendar entries.

First inspect the tool list and the calendar tool's input schema. Then check whether the ASR transcript matches the request, whether the LLM produced valid arguments, and whether the MCP response contains events. Finally confirm the reply summarizes those events and plays through TTS. Add the next connection only after each result is verified.

A normal result has a transcript with the intended date and time range, a tool response limited to events within that range, and a spoken reply that accurately conveys them. Compare the requested range with each returned event's start and end times, and check that the spoken reply neither changes nor omits event details.

Record total latency and each stage separately

End-to-end response time runs from when the user finishes speaking until the spoken answer ends. For conversational responsiveness, track a separate measure: from the end of the user's speech to the first sound of the reply. Also record ASR transcript completion, LLM response start and finish, MCP tool response, and TTS first sound and playback completion to distinguish a late first answer from a long overall reply.

Streaming ASR can send partial transcripts before the speaker finishes, and TTS can start when the LLM's first sentence is ready. This can reduce time to first audio, but playback can stall if speech generation cannot keep up. Check time to first sound and uninterrupted playback separately.

Partial transcripts can change as more speech arrives. You may speak a response early, but schedule edits or file writes that change state should wait until the final transcript is confirmed. Letting the user review and cancel the action prevents a recognition error from immediately becoming a change.

Give each tool only the permissions it needs, then inspect its results

A local MCP server runs with the permissions of its account. Implement the calendar lookup handler to read only approved calendars and date ranges, and do not register tools for editing or deletion. The SDK's readOnlyHint is a signal for the host; constrain actual access in the server implementation, the account, and the OS sandbox6. Check the provider and source code before installation, and configure authentication and allowed clients for network connections.

Connect search and read tools first. When adding writing or sending, show the action and destination to the user, obtain confirmation, and keep a readable record of the result. For access over an external network, enable authentication and limit connections to the clients that need it.

Start troubleshooting at the last stage that returned a normal result. If the transcript is empty or differs from the request, inspect microphone input and ASR output. If the text is right but no events appear, check the MCP connection and the tool's returned result. If events appear in the reply text but there is no sound, check TTS input and audio playback. Identifying the missing stage lets you retest only that connection.

Tool modules with different read and write permissions connected to local AI
Start with read access, and add tools that change state only after adding a confirmation step.

Add other tools one at a time after the first path is stable

Once calendar reading works repeatedly and you can record stage latency, add document search or home-automation tools one by one. Each tool has its own permissions and input format, so connecting several servers at once makes failures harder to trace. Test read requests whenever you add a tool, and require separate user confirmation for writing, deletion, or sending.

If a conversation feels slow, first find the longest stage in the timing record. For ASR delay, compare the recognition model and audio length; for tool delay, inspect the MCP server and connection; for late first audio, separate LLM response start from TTS generation. Improve the stage that accounts for the delay and keep confirmation before actions so the assistant responds sooner without carrying out an action the user did not choose.

A study with a microphone, local AI computer, and speaker
Confirm calendar reading before adding other tools one at a time.

Terminology notes

  1. Automatic Speech Recognition — Technology that recognizes spoken language in audio and converts it to text.

    Back to the text
  2. Large language model — A model trained on large text datasets to learn language patterns and process or generate text in context.

    Back to the text
  3. Text-to-Speech — Technology that converts text into spoken audio with pronunciation and prosody.

    Back to the text
  4. MCP — A protocol for connecting clients to tools and data sources a model may use. Connectivity and permission to execute a particular tool must still be configured separately.

    Back to the text
  5. API — A defined interface that lets other code call a program’s functions.

    Back to the text
  6. Sandbox — An isolated environment that restricts a program’s access to files, networks, and host capabilities. Its protection depends on mount, network, and execution-permission settings.

    Back to the text

Frequently asked questions

What should you check first in this article?
A local voice assistant uses ASR to turn microphone audio into text, an LLM to organize the request and tool results, and TTS to speak the answer. Using a calendar-reading request, this guide explains how to design tool inputs and outputs, permissions, and response timing. Begin with a read-only tool and require user confirmation for actions that change state.