UN
OfficialSearch

UnifAI MCP Server: Dynamic Tool Search and Invocation

Discover and invoke tools instantly via the UnifAI Network MCP server for dynamic search and seamless tool execution.

Quick Install
npx -y @unifai-network/unifai-mcp-server

Overview

The UnifAI MCP Server implements a Model Context Protocol (MCP) registry and runtime for discovering and invoking external tools. It lets language models and other agents search a catalog of tool metadata at runtime, pick the most relevant tool(s) by semantic or keyword match, and invoke them with structured inputs. This approach decouples tool discovery from hard-coded integrations and enables dynamic, context-aware tool use inside model-driven workflows.

For developers, the server is useful because it centralizes tool metadata, exposes a simple HTTP API for search and invocation, and makes it easy to add or update tools without changing client-side code. Whether you want to integrate third-party APIs, internal services, or scripted utilities, an MCP server helps models find the right capability just-in-time and call it reliably.

Features

  • Centralized tool registry with searchable metadata (name, description, tags, inputs/outputs)
  • API for dynamic tool search by keywords, tags, or semantic vector matches
  • HTTP-based invocation endpoint to run a selected tool using structured JSON inputs
  • Lightweight server suitable for local development or deployment in cloud environments
  • Extensible: add new tools by registering metadata and an endpoint handler
  • Simple dev workflow: run locally with Node/Docker and register tools via config or API

Installation / Configuration

Clone the repository and run locally (example workflow):

# Clone the repo
git clone https://github.com/unifai-network/unifai-mcp-server.git
cd unifai-mcp-server

# Install dependencies (Node.js example)
npm install

# Run in development
npm run dev

Environment configuration (example using a .env file):

# .env
PORT=8080
MCP_BASE_URL=http://localhost:8080
# Add provider keys or DB URLs if you use persistence/semantics
# VECTOR_DB_URL=...

Run with Docker:

# Build
docker build -t unifai-mcp-server .

# Run
docker run -p 8080:8080 \
  -e PORT=8080 \
  unifai-mcp-server

Note: The actual start script, env vars, and persistence options depend on the repository version. Check the GitHub project README for exact commands and additional configuration.

Available Resources

The MCP server exposes two primary capabilities: tool discovery (search) and tool execution (invoke). Tools are represented by structured metadata. A typical tool record contains:

FieldDescription
idUnique tool identifier
nameHuman-readable name
descriptionShort description of what the tool does
tagsArray of keywords for quick filtering
inputsJSON schema or description of expected input fields
outputsDescription or schema of the response
endpointURL or service handler reference used to invoke the tool

Example tool metadata (JSON):

{
  "id": "weather-forecast",
  "name": "Weather Forecast",
  "description": "Returns a multi-day weather forecast for a given location.",
  "tags": ["weather", "forecast", "geo"],
  "inputs": {
    "location": "string",
    "days": "integer"
  },
  "outputs": {
    "forecast": "array"
  },
  "endpoint": "https://api.example.com/tools/weather"
}

Example (typical) API shapes

  • Search: POST /api/search with body { “query”: “weather forecast”, “limit”: 5 }
  • Invoke: POST /api/invoke with body { “tool_id”: “weather-forecast”, “input”: { “location”: “NYC”, “days”: 3 } }

Always confirm exact endpoints in the repository; names may vary.

Quick Examples

Search for tools with curl:

curl -X POST http://localhost:8080/api/search \
  -H "Content-Type: application/json" \
  -d '{"query":"translate english to spanish", "limit":3}'

Invoke a tool by id:

curl -X POST http://localhost:8080/api/invoke \
  -H "Content-Type: application/json" \
  -d '{
    "tool_id":"translate",
    "input":{"text":"Hello world", "target":"es"}
  }'

Python example (search + invoke):

import requests

base = "http://localhost:8080"
search = requests.post(f"{base}/api/search", json={"query":"summarize document", "limit":1}).json()
tool = search["results"][0]
resp = requests.post(f"{base}/api/invoke", json={"tool_id": tool["id"], "input": {"text": "Long document..."}})
print(resp.json())

Use Cases

  • LLM tool augmentation: Let a model search the MCP server for capabilities (e.g., calculators, web search, translation) and call the best-fit tool during its reasoning process.
  • Dynamic orchestration: Agents can discover services at runtime (e.g., multiple microservices offering similar functionality) and select the one that best matches client constraints (latency, cost, region).
  • Plugin marketplace: Expose and manage third-party tools as discoverable entries, enabling a marketplace-like pattern where new tools appear without client code changes.
  • Rapid prototyping: Developers can add new internal tools to the registry during development, enabling models to leverage freshly implemented endpoints immediately.

Next Steps

  • Browse the repository for the exact API surface and configuration files: https://github.com/unifai-network/unifai-mcp-server
  • Register your first tool by adding a metadata record or calling the registry API
  • Integrate MCP queries into an LLM-based agent loop: search
Tags:search