MCP Tools
MCP (Model Context Protocol) tools are functions decorated with@mcp.tool() that extend the capabilities of your AI agents.
Basic Example
File:mcp/tools/math.py
Key Requirements
1. Use the @mcp.tool() Decorator
All tools must be decorated with @mcp.tool() to be discovered by Osmosis.
2. Place in mcp/tools/ Directory
Organize your tool modules within the mcp/tools/ directory.
3. Include Type Hints
Type hints are required for all parameters and return values:4. Add Docstrings
Comprehensive docstrings help the AI understand when and how to use your tool:5. Export in __init__.py
Export your tools in mcp/tools/__init__.py:
Server Setup
FastMCP Server Configuration
File:mcp/server/mcp_server.py
Entry Point
File:mcp/main.py