A Python toolsets library
Project description
toolsets
A Python library for aggregating multiple MCP (Model Context Protocol) servers into a single unified MCP server. Toolsets acts as a pass-through server that combines tools from multiple sources and provides semantic search capabilities for deferred tool loading.
Features
- MCP Server Aggregation: Combine tools from multiple Gradio Spaces and MCP servers and expose all aggregated tools through a single MCP endpoint.
- Free hosting on Hugging Face Spaces: A Toolset itself is also a Gradio application (including a built-in UI for testing and exploring available tools), so you can host it for free on Hugging Face Spaces
- Deferred Tool Loading: Use semantic search to discover and load tools on-demand. Like Claude's Advanced Tool Usage but for any LLM. This is useful when you have 100s of tools or more as it can save the context length of your model.
Example Toolset
Create Your Own Toolset
Installation
pip install toolsets
For deferred tool loading with semantic search:
pip install toolsets[deferred]
Examples
A
from toolsets import Server, Toolset
# Create a toolset
t = Toolset("My Tools")
# Add tools from MCP servers on Spaces or arbitrary URLs
t.add(Server("gradio/mcp_tools"))
t.add(Server("username/space-name"))
# Launch UI at http://localhost:7860
# MCP server available at http://localhost:7860/gradio_api/mcp
t.launch()
Deferred Tool Loading
from toolsets import Server, Toolset
t = Toolset("My Tools")
# Add tools with deferred loading (enables semantic search)
t.add(Server("gradio/mcp_tools"), defer_loading=True)
# Regular tools are immediately available
t.add(Server("gradio/mcp_letter_counter_app"))
t.launch()
When tools are added with defer_loading=True:
- Tools are not exposed in the base tools list
- Two special MCP tools are added: "Search Deferred Tools" and "Call Deferred Tool"
- A search interface is available in the Gradio UI for finding deferred tools
- Tools can be discovered using semantic search based on natural language queries
Custom Embedding Model
from toolsets import Toolset
# Use a different sentence-transformers model
t = Toolset("My Tools", embedding_model="all-mpnet-base-v2")
t.add(Server("gradio/mcp_tools"), defer_loading=True)
t.launch()
Roadmap
Upcoming features and improvements:
- Hugging Face Token Support: Automatic token passing in headers for private and ZeroGPU spaces
- Hugging Face Data Types Integration:
- Datasets: Add Hugging Face datasets for easy RAG on documentation and structured data
- Models: Support for models with inference provider usage (e.g., Inference API, Inference Endpoints)
- Papers: Search and query capabilities for Hugging Face Papers
- Enhanced Error Handling: Better retry logic, connection pooling, and graceful degradation
- Tool Caching: Cache tool definitions and embeddings to reduce API calls and improve startup time
Contributing
We welcome contributions! Please see CONTRIBUTING.md for guidelines.
License
MIT License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file toolsets-0.1.2-py3-none-any.whl.
File metadata
- Download URL: toolsets-0.1.2-py3-none-any.whl
- Upload date:
- Size: 12.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.2.0 CPython/3.10.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
40120ac6461b7f328bf750cf4dc33490b00997a31b64bb1815fbd2a8adad9ae8
|
|
| MD5 |
873dfa9db2c8d8ca4e8abd7700016cad
|
|
| BLAKE2b-256 |
3e23673eb9b691846f3e683a634198ad866ebc62524ef9eb873fa62f0535c594
|
Provenance
The following attestation bundles were made for toolsets-0.1.2-py3-none-any.whl:
Publisher:
publish.yml on abidlabs/toolsets
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
toolsets-0.1.2-py3-none-any.whl -
Subject digest:
40120ac6461b7f328bf750cf4dc33490b00997a31b64bb1815fbd2a8adad9ae8 - Sigstore transparency entry: 822753484
- Sigstore integration time:
-
Permalink:
abidlabs/toolsets@01acf40d4cb51aac6fa06232274fe515b848a972 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/abidlabs
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@01acf40d4cb51aac6fa06232274fe515b848a972 -
Trigger Event:
push
-
Statement type: