ToolSDK.ai is a free TypeScript SDK for connecting MCP servers to your agentic AI apps.
If you're a developer of AI agents or automation apps, you've probably felt the pain of integrating and managing multiple MCP servers. It's messy, hard to deploy, and doesn't scale easily.
ToolSDK.ai makes it simple — connect to over 5,000 MCP servers and AI tools with just one line of code.
Here's what you can do with ToolSDK.ai:
You can also add your own MCP servers through the GitHub registry: https://github.com/toolsdk-ai/awesome-mcp-registry
This example shows how to use Vercel AI SDK and ToolSDK.ai to create a MCP-Tools-enabled GPT-4.1 assistant:
import { generateText } from 'ai';
import { createOpenAI } from '@ai-sdk/openai';
import { ToolSDKApiClient } from 'toolsdk/api';
// Initialize Client
const toolSDK = new ToolSDKApiClient({ apiKey: process.env.TOOLSDK_AI_API_KEY });
const openai = createOpenAI({ apiKey: process.env.OPENAI_API_KEY });
// Get Tools
const searchMCP = await toolSDK.package('@toolsdk.ai/tavily-mcp', {
TAVILY_API_KEY: process.env.TAVILY_API_KEY,
});
const emailMCP = await toolSDK.package('@toolsdk.ai/mcp-send-email', {
RESEND_API_KEY: process.env.RESEND_API_KEY,
});
const searchTool = await searchMCP.getAISDKTool('tavily-search');
const emailTool = await emailMCP.getAISDKTool('send-email');
// Generate Result with Tools
const completion = await generateText({
model: openai('gpt-4.1'),
messages: [{
role: 'user',
content: 'Help me search for the latest AI news and send it to john@example.com',
}],
tools: { searchTool, emailTool },
});
console.log(completion);
If you're using the official OpenAI SDK, follow the steps below with ToolSDK.ai to create a MCP-Tools-enabled GPT-4.1 assistant:
import OpenAI from 'openai';
import { ToolSDKApiClient } from 'toolsdk/api';
// Initialize Client
const toolSDK = new ToolSDKApiClient({ apiKey: process.env.TOOLSDK_AI_API_KEY });
const openai = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });
// Get Tools
const searchMCP = await toolSDK.package('@toolsdk.ai/tavily-mcp', {
TAVILY_API_KEY: process.env.TAVILY_API_KEY,
});
const emailMCP = await toolSDK.package('@toolsdk.ai/mcp-send-email', {
RESEND_API_KEY: process.env.RESEND_API_KEY,
});
const searchTool = await searchMCP.getOpenAISDKTool('tavily-search');
const emailTool = await emailMCP.getOpenAISDKTool('send-email');
const messages = [{
role: 'user',
content: 'Help me search for the latest AI news and send it to john@example.com',
}];
const completion = await openai.chat.completions.create({
model: 'gpt-4.1',
messages,
tools: [searchTool, emailTool],
});
const toolMap = { 'tavily-search': searchMCP, 'send-email': emailMCP };
// Execute Tool Calls
for (const toolCall of completion.choices[0].message.tool_calls) {
const { name: toolKey, arguments: argsStr } = toolCall.function;
const inputData = JSON.parse(argsStr);
const toolContent = await toolMap[toolKey].run({ toolKey, inputData });
messages.push(
{ role: 'assistant', tool_calls: [toolCall] },
{ role: 'tool', content: JSON.stringify(toolContent), tool_call_id: toolCall.id },
);
}
const finalResponse = await openai.chat.completions.create({
model: 'gpt-4.1',
messages,
});
console.log(finalResponse);
const result = streamText({
model: openai('gpt-4.1'),
messages,
tools: await toolSDK.package('weather-mcp').getAISDKTools(),
});
const result = streamText({
model: openai('gpt-4.1'),
messages,
tools: await toolSDK.package('finance-analyse').getAISDKTools(),
});
For more advanced examples, visit ToolSDK.ai Documentation or browse the Tool Registry.
ToolSDK.ai makes it easy to connect MCP Servers and AI tools — get and call with just one line of code.
Just plug in the tools you need and run them inside your AI agents or automation workflows apps.
Perfect for AI agents, automation apps, and rapid prototyping.