MCP-Zero Documentation
repository·master·Indexed 19 days ago
https://github.com/xfey/mcp-zeroA framework for active tool discovery in autonomous LLM agents. MCP-Zero enables agents to retrieve and chain tools from Model Context Protocol (MCP) servers using similarity matching and embeddings. It includes a similarity matching engine, tools for formatting tool descriptions, and utilities for building custom MCP server datasets using VLLM and specific extraction prompts.
What's inside MCP-Zero
- MCP-Zero is a method designed for autonomous LLM agents to proactively discover and construct toolchains. It implements retrieval capabilities to find relevant tools from a collection of Model Context Protocol (MCP) servers. The project includes experimental implementations for APIBank and MCP-tools (needle tests), a similarity matching engine, and tools for formatting tool descriptions and sampling target tools.
Build a custom MCP server dataset
masterIf you need to create a custom dataset for your own MCP servers, use the scripts located in the
MCP-tools/build_datadirectory. The process involves:- Using
get_server_summary.pyto extract structural data from an MCP server's README file. - Using the provided
server_summary.promptto guide the extraction. - Deploying a model (e.g., Qwen2.5-72B-Instruct) via VLLM using
run_vllm.shto process the summaries.
# Directory structure for building custom datasets: MCP-tools/ ├── build_data │ ├── get_server_summary.py │ ├── run_vllm.sh │ └── server_summary.prompt └── download_data.md- Using
Use the MCP-tools dataset
masterThe
MCP-toolsdataset contains filtered tools from the official MCP repository (308 servers and 2,797 tools). To use the dataset with MCP-Zero, download the file and place it at the following path:./MCP-tools/mcp_tools_with_embedding.json# Place the downloaded file here: ./MCP-tools/mcp_tools_with_embedding.jsonUnderstand the MCP-tools JSON data structure
masterThe
mcp_tools_with_embedding.jsonfile follows a specific schema where each entry represents an MCP server and its associated tools. Each server includes embeddings (generated viatext-embedding-3-large) for both the server summary and the server description to facilitate similarity matching.{ "server_name": "string", // The name of the MCP server "server_summary": "string", // A summary of the server's purpose "server_description": "string", // Description from metadata "description_embedding": [float], // embedding from text-embedding-3-large "summary_embedding": [float], // embedding from text-embedding-3-large "tools": [ { "name": "string", // The function/tool name "description": "string", // A concise description "description_embedding": [float], // embedding from text-embedding-3-large "parameter": { "param1": "(type) description1", "param2": "(Optional, type) description2" } } ] }