A minimal MCP server built with mcp-use that exposes Tavily web search as a tool. Shows how to deploy an MCP server to TrueFoundry and register it with the AI Gateway.
cp .env.example .env # add your TAVILY_API_KEY
npm install
npm run devThree ways:
1. Claude Code + TrueFoundry Agent Skills
Install TrueFoundry Agent Skills and just ask:
deploy to truefoundry
attach this to ai gateway
2. CLI
Create truefoundry.yaml for the service and mcp-server-registration.yaml to register with the gateway (examples included in this repo), then:
tfy deploy -f truefoundry.yaml --no-wait
tfy apply -f mcp-server-registration.yaml3. UI
- Deploy the service via TrueFoundry dashboard → New Deployment
- Register the MCP endpoint under AI Gateway → MCP Servers → Add Server
| Variable | Description |
|---|---|
TAVILY_API_KEY |
Tavily API key |
PORT |
Server port (default 3333) |
MCP_BASE_URL |
Public URL of the deployed service |
Set MCP_BASE_URL to the TrueFoundry service URL after deployment.
POST /mcp # MCP protocol (streamable-http)
GET /health # Health check
| Input | Type | Description |
|---|---|---|
query |
string | Search query |
topic |
general | news |
Search topic |
maxResults |
number | 1–10 results |
searchDepth |
basic | advanced |
Search depth |
includeAnswer |
boolean | Include synthesized answer |