Skip to main content
Version: v1.6.47-dev1 🚧

Create Local MCP Tools

This guide walks you through creating a Local MCP tool using Enterprise h2oGPTe's Tool Builder agent, then uploading and using it in your agent conversations.

Overview​

Local MCP tools are custom tools that run directly within Enterprise h2oGPTe. You can create them using the Tool Builder agent, which helps generate the necessary code files. Once created, you upload them as a ZIP file and enable them in your agent conversations.

Prerequisites​

  • Access to Enterprise h2oGPTe with Tool Builder agent enabled
  • Basic understanding of MCP (Model Context Protocol). See the Local MCP Servers overview for more details.

Step 1: Create Your Local MCP Tool Using Tool Builder​

  1. Go to h2oGPTe > Chat
  2. Select Tool Builder agent from the agent selector
  3. Click the Tool Types dropdown and select Local MCP
  4. Enter a prompt to create your custom MCP tool (if you don't already have the files)

Example Prompt:

Create a local MCP tool for generating random values. Generate server.py with these functions:
- random_number(min, max) - generates random integer between min and max
- random_string(length) - generates random alphanumeric string
- random_choice(items) - picks random item from comma-separated list
- generate_uuid() - generates a UUID

No environment variables needed. Use Python random and uuid libraries. Include proper error handling and create description.md explaining the tool.

Tool Builder with Local MCP prompt

The Tool Builder agent will generate the necessary code files for your local MCP tool.

Note:

  • Review the generated code to ensure it follows the MCP protocol correctly
  • The Tool Builder agent usually provides complete, working code, but you may need to make minor adjustments based on your specific requirements
  • You can also ask the agent to give you all the files in a zip folder with your desired name

Step 2: Save and Upload Your Tool Files​

  1. Download the generated code using one of these methods:
    • From the chat response: Click the download link or button in the chat response Tool Builder generated files-a
    • From the Artifacts section: Navigate to the Details > Files tab and download individual files or the entire folder Tool Builder generated files-b
  2. Review the code to ensure it's complete and follows MCP protocol standards
  3. Create a directory for your tool (e.g., random-generator) Create a directory
  4. Save the files in the directory:
    • server.py - Main MCP server implementation (required)
    • description.md - Tool documentation (optional)
  5. Create a ZIP file containing your tool directory:
zip -r random-generator-tool.zip random-generator-tool/
  1. Go to Agents > Tools in the main navigation
  2. Click + New Tool
  3. Select Local MCP Tools from the dropdown menu Local MCP Tools
  4. Upload your ZIP file using the file upload dialog
  5. Configure tool settings (if available):
    • MCP Usage Mode: Select "Runner" (default) or both "Runner" and "Creator" if applicable
    • Enable by Default: Choose whether to enable the tool automatically in conversations
  6. Click Add Tool Add Tool

Step 3: Enable and Test Your Tool​

  1. Go to a new chat session
  2. Select your preferred agent (e.g., General Agent or another agent)
  3. Open Agent Configuration (gear icon or settings button)
  4. Navigate to the Custom Tools section
  5. Enable your local MCP tool by toggling it on in the list
  6. Send a test message and verify the response

Example Test Messages:

  • "Can you generate a random number between 1 and 100"
  • "Can you generate a random string of length 10"
  • "Can you pick a random item from: apple, banana, orange, grape"
  • "Can you generate a UUID"

Tool execution results

Step 4: Verify Tool Execution​

After sending your message, check the response to confirm:

  • ✅ The tool executed successfully
  • ✅ The response contains the expected data
  • ✅ Error handling works correctly (if applicable)

Next Steps​


Feedback