A newer version of the Gradio SDK is available:
6.9.0
title: VOYAGER AI mcp server
emoji: π
colorFrom: pink
colorTo: gray
sdk: gradio
sdk_version: 5.33.0
app_file: app.py
pinned: false
short_description: 'AI MCP server: sentiment, places, dining, hiking, web search'
tags:
- mcp-server-track
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
π₯οΈ MCP Server - Model Context Protocol Server
A powerful MCP (Model Context Protocol) server that exposes 5 specialized tools for AI agents and applications.
π― What is this?
This is a pure MCP protocol server that provides AI agents with access to:
- π Sentiment Analysis - Analyze text sentiment and emotion
- π¨ Place Search - Find hotels and accommodations
- π½οΈ Restaurant Search - Discover restaurants and dining options
- π₯Ύ Hiking Trails - Find outdoor activities and hiking trails
- π Web Search - Search the internet for information
π¬ Demo Video
π₯ Watch the MCP Server Demo on YouTube
See the MCP Server in action! This demo showcases all 5 tools and how they work with AI agents through the Model Context Protocol.
π Quick Start
1. Install Dependencies
pip install -r requirements.txt
2. Set Up Environment Variables
# Required for web search and place services
export ANTHROPIC_API_KEY="your_anthropic_api_key"
export FOURSQUARE_API_KEY="your_foursquare_api_key" # Optional
3. Start the Server
python start_server.py
The server will start and listen for MCP protocol connections via stdio.
π οΈ Available Tools
1. Sentiment Analysis (sentiment_analysis)
Purpose: Analyze the emotional tone and sentiment of text
{
"name": "sentiment_analysis",
"description": "Analyze sentiment and emotion in text",
"inputSchema": {
"type": "object",
"properties": {
"text": {
"type": "string",
"description": "Text to analyze"
}
},
"required": ["text"]
}
}
2. Place Search (place_search)
Purpose: Find hotels, accommodations, and lodging
{
"name": "place_search",
"description": "Search for hotels and accommodations",
"inputSchema": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "Location to search for places"
},
"max_distance": {
"type": "integer",
"description": "Maximum distance in miles",
"default": 10
}
},
"required": ["location"]
}
}
3. Restaurant Search (restaurant_search)
Purpose: Find restaurants and dining options
{
"name": "restaurant_search",
"description": "Search for restaurants and dining options",
"inputSchema": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "Location to search for restaurants"
},
"cuisine": {
"type": "string",
"description": "Type of cuisine (optional)"
}
},
"required": ["location"]
}
}
4. Hiking Search (hiking_search)
Purpose: Find hiking trails and outdoor activities
{
"name": "hiking_search",
"description": "Search for hiking trails and outdoor activities",
"inputSchema": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "Location to search for hiking trails"
},
"difficulty": {
"type": "string",
"description": "Difficulty level: Easy, Moderate, Hard, Very Hard",
"default": "All"
},
"max_distance": {
"type": "integer",
"description": "Maximum distance in miles",
"default": 50
}
},
"required": ["location"]
}
}
5. Web Search (web_search)
Purpose: Search the internet for information
{
"name": "web_search",
"description": "Search the web for information",
"inputSchema": {
"type": "object",
"properties": {
"query": {
"type": "string",
"description": "Search query"
},
"max_results": {
"type": "integer",
"description": "Maximum number of results",
"default": 5
}
},
"required": ["query"]
}
}
π§ Configuration
Environment Variables
ANTHROPIC_API_KEY- Required for AI-powered featuresFOURSQUARE_API_KEY- Optional, for enhanced place search
Command Line Options
python start_server.py --info # Show server information
ποΈ Architecture
mcp_server/
βββ server.py # Main MCP server implementation
βββ start_server.py # Startup script
βββ tools/ # Tool implementations
β βββ sentiment_tool.py # Sentiment analysis
β βββ place_tool.py # Place search
β βββ restaurant_tool.py # Restaurant search
β βββ hiking_tool.py # Hiking search
β βββ web_search_tool.py # Web search
βββ utils/
βββ api_config.py # API configuration
π‘ MCP Protocol Details
This server implements the Model Context Protocol (MCP) using:
- Transport: stdio (standard input/output)
- Protocol: JSON-RPC based MCP messages
- Capabilities: Tool calling, resource listing
Connection Example
from smolagents.mcp_client import MCPClient
# Connect to this server
client = MCPClient()
await client.connect("python server.py")
# List available tools
tools = await client.list_tools()
# Call a tool
result = await client.call_tool("sentiment_analysis", {"text": "I love this!"})
π Usage Examples
Sentiment Analysis
# Via MCP client
{
"method": "tools/call",
"params": {
"name": "sentiment_analysis",
"arguments": {
"text": "This product is absolutely amazing!"
}
}
}
Place Search
# Find hotels in Paris
{
"method": "tools/call",
"params": {
"name": "place_search",
"arguments": {
"location": "Paris",
"max_distance": 5
}
}
}
Restaurant Search
# Find Italian restaurants in New York
{
"method": "tools/call",
"params": {
"name": "restaurant_search",
"arguments": {
"location": "New York",
"cuisine": "Italian"
}
}
}
π¦ Server Status
The server provides health checks and status information:
- β Running: Server is active and accepting connections
- π οΈ Tools: 5 tools available and functional
- π APIs: Configuration status for external APIs
π Troubleshooting
Common Issues
Server won't start
- Check Python version (3.8+ required)
- Verify dependencies:
pip install -r requirements.txt
Tool execution fails
- Check API keys are set correctly
- Verify internet connection for external APIs
MCP client can't connect
- Ensure server is running
- Check the server command path
Debug Mode
# Start with verbose output
python server.py --debug
π¦ Dependencies
mcp- Model Context Protocol libraryasyncio- Async programming supportrequests- HTTP client for external APIsjson- JSON handlingos- Environment variable access
π€ Integration
This MCP server can be used with:
- MCP Clients - Any application supporting MCP protocol
- AI Agents - Claude, GPT, or custom agents
- Gradio Apps - With built-in MCP support
- Custom Applications - Via MCP client libraries
π License
MIT License - Feel free to use and modify!
π Related
Ready to expose powerful tools to AI agents via the Model Context Protocol! π