Getting Started with ToolSDK.ai
Learn how to get started with ToolSDK.ai and connect to thousands of MCP servers
Getting Started with ToolSDK.ai
1. What is ToolSDK.ai?
ToolSDK.ai is a comprehensive SDK for connecting Model Context Protocol (MCP) servers to your AI agents and applications.
If you're a developer of AI agents or automation apps, integrating multiple third-party tools can be complex. ToolSDK.ai makes it simple — connect to over 100+ vetted MCP servers and AI tools with a unified API.
Key Features:
- ⚡ One-line Integration: Access any running MCP server with minimal code.
- 🤖 AI Ready: Native support for Vercel AI SDK and OpenAI SDK.
- ⚛️ React UI: Pre-built components to let your users configure tools (OAuth, API Keys).
- 🔒 Secure: Handles authentication and credential management for you.
2. 🚀 Quick Start
2.1 Installation
npm install toolsdk
# or
pnpm add toolsdk2.2 Initialize Client
First, initialize the ToolSDKApiClient with your API key.
import { ToolSDKApiClient } from 'toolsdk/api';
const client = new ToolSDKApiClient({
apiKey: process.env.TOOLSDK_AI_API_KEY
});2.3 Execute a Tool
You can run a tool directly using the run method.
const result = await client.package('github').run({
toolKey: 'create-issue',
inputData: {
owner: 'toolsdk-ai',
repo: 'toolsdk',
title: 'Bug Report',
body: 'Description of the issue...'
}
});
console.log('Result:', result);3. 🤖 AI SDK Integration
ToolSDK shines when used with AI agents. It can automatically convert MCP tools into formats compatible with popular AI libraries.
3.1 Vercel AI SDK
Use getAISDKToolSet to inject tools directly into Vercel AI SDK's generateText or streamText.
import { generateText } from 'ai';
import { createOpenAI } from '@ai-sdk/openai';
import { ToolSDKApiClient } from 'toolsdk/api';
const client = new ToolSDKApiClient({ apiKey: process.env.TOOLSDK_AI_API_KEY });
const openai = createOpenAI({ apiKey: process.env.OPENAI_API_KEY });
// Get all tools from the 'github' package
const tools = await client.package('github').getAISDKToolSet();
const result = await generateText({
model: openai('gpt-4'),
tools: tools,
prompt: 'Check the latest issues in toolsdk-ai/toolsdk repo',
});
console.log(result.text);3.2 OpenAI SDK
Use getOpenAISDKTools to get tools in the format expected by OpenAI's chat.completions.create.
import OpenAI from 'openai';
import { ToolSDKApiClient } from 'toolsdk/api';
const client = new ToolSDKApiClient({ apiKey: process.env.TOOLSDK_AI_API_KEY });
const openai = new OpenAI({ apiKey: process.env.OPENAI_API_KEY });
// Get tools in OpenAI format
const tools = await client.package('tavily-mcp').getOpenAISDKTools();
const completion = await openai.chat.completions.create({
model: 'gpt-4',
messages: [{ role: 'user', content: 'Search for the latest AI news' }],
tools: tools,
stream: true,
});
console.log(completion.choices[0].message);4. 🧩 Building User Interfaces
If you are building an application where your users need to connect their own accounts (e.g., "Connect your GitHub"), use our React components.
Check out the Configuration Components guide to learn how to embed the PackageInstanceVORenderer in your app.