The @speakai/mcp-server package is both a runnable MCP server and a Node library. Install it as a dependency when you want to call Speak AI from your own Node.js code, embed its tools inside another MCP server, or build the same capabilities into a different application. The package requires Node 22 or newer.
When should you use the SDK instead of connecting through an AI client?
Use the SDK when you’re writing Node and want Speak AI’s tool definitions, resource readers, and prompt templates as functions you call directly, instead of exposing them through a connected AI assistant. Speak AI’s own backend, speak-server, uses the package this way, registering its tools on its own McpServer instance rather than connecting to the hosted endpoint.
If you just want an agent to use Speak AI in conversation, connect through the MCP server instead. Reach for the SDK when you’re building the server side of that connection yourself.
How do you install it?
Add @speakai/mcp-server as a dependency with your package manager.
npm i @speakai/mcp-serveryarn add @speakai/mcp-serverpnpm add @speakai/mcp-serverbun add @speakai/mcp-serverWhat does the package export?
The package exports five functions and two static manifests, one of tool names and one of tool categories, for embedding Speak AI’s MCP capabilities directly in your own code.
import {
registerAllTools,
registerResources,
registerPrompts,
createSpeakClient,
formatAxiosError,
SPEAK_MCP_TOOL_NAMES,
SPEAK_MCP_TOOL_CATEGORIES,
} from "@speakai/mcp-server";registerAllTools(server, client?, options?)registers the tools on anMcpServerinstance. Pass aclientfor server-side use with per-request auth. If you omit it, the tools fall back to a default Axios client that readsSPEAK_API_KEY(and optionallySPEAK_BASE_URL) from the environment, the same as stdio mode.optionsholds two switches, both off by default. Pass{ localFileAccess: true }only when the server runs on the user’s own machine: it addsupload_local_file, which reads files from local disk. Leave it off on any hosted or shared server. Pass{ voiceTestRuns: true }to add the ten voice agent test-run tools, which queue, pause, cancel and read a run; the engine that executes a run is not live yet, so a queued run stays queued and scores stay at zero.registerResources(server, client?)registers the 5 resources, media library, folders, languages, transcript, and insights, the same way.registerPrompts(server)registers the 3 prompt templates:analyze-meeting,research-across-media, andmeeting-brief.createSpeakClient({ baseUrl, apiKey, accessToken })returns an authenticated Axios instance for services that already manage their own access tokens, instead of letting the package fetch and refresh one for you.formatAxiosError(error)formats an Axios error into a readable string, redacting anything that looks like a token, secret, password, cookie, or API key before the message reaches a model’s context window.SPEAK_MCP_TOOL_NAMESis a static array of every tool nameregisterAllToolscan register, both switches included, useful for validating or routing a tool call without instantiating a server. A server that leaves a switch off exposes fewer tools than this array lists.SPEAK_MCP_TOOL_CATEGORIESis a static array of the 17 tool categories, each with anid, a displaynameand thetoolsit holds. It uses the same grouping as the MCP tool reference, so you can group or filter tools the way the docs do. It also lists the tools behind both switches.
How do you register the tools on your own server?
Call registerAllTools, registerResources, and registerPrompts on your own McpServer instance to expose Speak AI’s tools, resources, and prompts.
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
import { registerAllTools, registerResources, registerPrompts } from "@speakai/mcp-server";
const server = new McpServer({ name: "speak-ai", version: "1.0.0" });
registerAllTools(server, undefined, { localFileAccess: true, voiceTestRuns: true });
registerResources(server);
registerPrompts(server);
const transport = new StdioServerTransport();
await server.connect(transport);With SPEAK_API_KEY set in the environment, this is the same registration sequence the package’s own stdio entry point runs, including both switches: localFileAccess because a stdio server runs on the user’s machine, and voiceTestRuns because the person running it is the one building the test suite. Drop the options argument if your server runs anywhere else.
How do you pass a client with its own access token?
Use createSpeakClient when your own service already manages Speak AI access tokens, instead of letting the package authenticate with an API key on first use.
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { createSpeakClient, registerAllTools } from "@speakai/mcp-server";
const server = new McpServer({ name: "your-app", version: "1.0.0" });
const client = createSpeakClient({
baseUrl: "https://api.speakai.co",
apiKey: "sk_test_speak_0000000000000000",
accessToken: "your-access-token",
});
registerAllTools(server, client);