πUsing Dynamic Tools in MCP Clients
UnifAI SDK provides an MCP (Model Context Protocol) server that can be used with MCP-compatible clients like Claude Desktop.
Setting Up the MCP Server
{
"mcpServers": {
"unifai": {
"command": "npx",
"args": [
"-y",
"-p",
"unifai-sdk",
"unifai-tools-mcp"
],
"env": {
"UNIFAI_AGENT_API_KEY": "YOUR_AGENT_API_KEY"
}
}
}
}{
"mcpServers": {
"unifai": {
"command": "uvx",
"args": [
"--from",
"unifai-sdk",
"unifai-tools-mcp"
],
"env": {
"UNIFAI_AGENT_API_KEY": "YOUR_AGENT_API_KEY"
}
}
}
}Configuration Steps
Install
npm(for JavaScript/TypeScript) oruvx(for Python) following the official installation instructions.Update your MCP client configuration (for example, in Claude Desktop) with the JSON configuration above.
Make sure you put your agent API key in the configuration file.
Configuring Tool Types
You can use environment variables to control which tools are exposed by the MCP server:
{
"mcpServers": {
"unifai": {
"command": "npx",
"args": [
"-y",
"-p",
"unifai-sdk",
"unifai-tools-mcp"
],
"env": {
"UNIFAI_AGENT_API_KEY": "YOUR_AGENT_API_KEY",
"UNIFAI_DYNAMIC_TOOLS": "true",
"UNIFAI_STATIC_TOOLKITS": "1,2,3",
"UNIFAI_STATIC_ACTIONS": "ACTION_A,ACTION_B"
}
}
}
}{
"mcpServers": {
"unifai": {
"command": "uvx",
"args": [
"--from",
"unifai-sdk",
"unifai-tools-mcp"
],
"env": {
"UNIFAI_AGENT_API_KEY": "YOUR_AGENT_API_KEY",
"UNIFAI_DYNAMIC_TOOLS": "true",
"UNIFAI_STATIC_TOOLKITS": "1,2,3",
"UNIFAI_STATIC_ACTIONS": "ACTION_A,ACTION_B"
}
}
}
}The environment variables control the tool discovery behavior:
UNIFAI_DYNAMIC_TOOLS: Set to "true" to enable dynamic tool discovery (default)UNIFAI_STATIC_TOOLKITS: Comma-separated list of toolkit IDs to includeUNIFAI_STATIC_ACTIONS: Comma-separated list of action IDs to include
Once configured, your MCP client will detect and utilize the tools exposed by your toolkit.
Last updated