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 a static tool-name manifest for embedding Speak AI’s MCP capabilities directly in your own code.
import {
registerAllTools,
registerResources,
registerPrompts,
createSpeakClient,
formatAxiosError,
SPEAK_MCP_TOOL_NAMES,
} from "@speakai/mcp-server";registerAllTools(server, client?)registers all 112 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.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 nameregisterAllToolsregisters, useful for validating or routing a tool call without instantiating a server.
How do you register the tools on your own server?
Call registerAllTools, registerResources, and registerPrompts on your own McpServer instance to expose the same capabilities the hosted Speak AI MCP server does.
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);
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.
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);