mirror of
https://github.com/mims-harvard/ToolUniverse.git
synced 2026-09-19 07:31:47 +08:00
3.9 KiB
3.9 KiB
TxAgent Documentation
This directory contains documentation for TxAgent and guides on integrating with MCP (Model Context Protocol) servers and ToolUniverse.
Available Documentation
<EFBFBD>️ Adding Tools Tutorial
NEW! Complete Tutorial for adding custom tools to ToolUniverse:
- Decorator-based auto-registration system
- Step-by-step examples with real code
- Configuration best practices
- Troubleshooting and testing guides
- Multiple registration methods
<EFBFBD> MCP Server Tutorial
A comprehensive Tutorial that covers:
- Converting your Python program into an MCP server
- Creating ToolUniverse configuration files
- Integration best practices
- Troubleshooting common issues
- Complete working examples
Overview
TxAgent is an AI agent for precision therapeutics and personalized treatment recommendations. This documentation helps you:
- Add Custom Tools: Create your own tools using the decorator-based system
- Expose TxAgent as an MCP Server: Make TxAgent accessible via the Model Context Protocol
- Integrate with ToolUniverse: Use TxAgent tools within the ToolUniverse framework
- Create Your Own MCP Tools: Convert any Python program into an MCP server
Key Components
MCP Server
- Purpose: Standardized way to expose AI tools and functions
- Protocol: HTTP-based communication
- Benefits: Remote access, scalability, standardization
ToolUniverse Integration
- Auto-discovery: Automatically finds and registers MCP tools
- Unified Interface: Single API for multiple tool types
- Configuration: JSON-based tool definitions
FastMCP Framework
- Library: Python framework for creating MCP servers
- Features: Easy decorator-based tool definition
- Transport: HTTP and other protocols supported
Getting Started
- Want to add your own tools? Start with the Adding Tools Tutorial
- New to MCP? Check out the MCP Server Tutorial
- Need quick optimization? Use the Tool Description Optimizer Quick Start
Example Files
In the parent directory, you'll find:
run_mcp.py- TxAgent MCP server implementationtooluni_client.py- Example of using TxAgent through ToolUniversetxagent_client_tools.json- ToolUniverse configuration for TxAgent
Architecture Overview
┌─────────────────┐ HTTP/MCP ┌──────────────────┐
│ Your Client │ ◄─────────────► │ MCP Server │
│ (ToolUniverse) │ │ (Your Program) │
└─────────────────┘ └──────────────────┘
│ │
│ │
▼ ▼
┌─────────────────┐ ┌──────────────────┐
│ Configuration │ │ Tool Functions │
│ JSON File │ │ (@server.tool) │
└─────────────────┘ └──────────────────┘
Support
If you encounter issues:
- Check the troubleshooting sections in the tutorials
- Verify your configuration matches the examples
- Ensure all dependencies are properly installed
- Test MCP server functionality independently
Contributing
When adding new documentation:
- Follow the existing markdown structure
- Include practical examples
- Test all code snippets
- Update this README if adding new files
For questions about TxAgent specifically, refer to the main project README in the parent directory.