MCPBridgeServer

An MCP server that exposes Talk Box tools over the MCP protocol.

Usage

Source

MCPBridgeServer()

Wraps a collection of TalkBoxTool instances and serves them via MCP’s FastMCP server. Supports stdio, SSE, and streamable-HTTP transports.

Parameters

name: str

Server name shown to MCP clients.

tools: list[Any] = list()

List of TalkBoxTool instances to expose.

instructions: str = ""
Optional instructions string for the MCP server.

Examples

Create a server from a tool registry:

import talk_box as tb
from talk_box.tools import get_global_registry

registry = get_global_registry()
server = tb.MCPBridgeServer(
    name="talk-box-tools",
    tools=registry.get_all_tools(),
)
server.tool_names()  # ["text_stats", "convert_case", ...]

Methods

Name Description
build() Build and return a FastMCP server instance.
run() Build the server (if needed) and run it.
tool_names() Return the names of all tools registered with this server.

build()

Build and return a FastMCP server instance.

Usage

Source

build()

Each Talk Box tool is registered as an MCP tool. The tool’s parameters (excluding the context parameter) are preserved so MCP clients see the correct input schema.

Returns
FastMCP
A configured FastMCP server ready to be started with run().
Examples
server = tb.MCPBridgeServer(name="my-tools", tools=[my_tool])
mcp_server = server.build()
# mcp_server.run()  # starts the server

run()

Build the server (if needed) and run it.

Usage

Source

run(transport="stdio")
Parameters
transport: str = "stdio"
Transport mode: "stdio", "sse", or "streamable-http".

tool_names()

Return the names of all tools registered with this server.

Usage

Source

tool_names()
Returns
list[str]
Sorted list of tool names.