mcp-demo
MCP server for querying MCP Hub database
Installation
# Create virtual environment
python3 -m venv venv
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
Configuration
Copy .env.example to .env and configure:
MCP_HUB_URL=http://localhost:8000/api/v1
VERIFY_SSL=true
Run Server
# HTTP mode (default)
python -m src.main
# stdio mode
TRANSPORT_MODE=stdio python -m src.main
Server runs on http://localhost:8080
Tools
search_mcp_servers - Search for MCP servers by keyword
list_mcp_servers - List MCP servers with pagination and sorting
get_mcp_server_details - Get detailed information about a specific server
get_top_servers - Get top servers by popularity or recency
get_top_contributors - Get top contributors
RooCode Setup
HTTP Mode
Add to RooCode MCP settings (cline_mcp_settings.json):
{
"mcpServers": {
"mcp-hub-mcp": {
"transport": {
"type": "sse",
"url": "http://localhost:8080/sse"
}
}
}
}
stdio Mode
{
"mcpServers": {
"mcp-hub-mcp": {
"command": "python",
"args": ["-m", "src.main"],
"cwd": "/path/to/mcp-demo",
"env": {
"TRANSPORT_MODE": "stdio",
"MCP_HUB_URL": "http://localhost:8000/api/v1"
}
}
}
}
Testing
Unit Tests (Mock-based, no backend required)
Fast tests using mocks. Can run without backend server.
# Run all unit tests
pytest tests/unit/ -v
# Run specific unit test file
pytest tests/unit/test_client.py -v
pytest tests/unit/test_handlers.py -v
pytest tests/unit/test_schemas.py -v
Integration Tests (Requires running backend)
Tests that call real API endpoints. Requires backend at http://localhost:8000.
# Run all integration tests
pytest tests/integration/ -v
# Run specific integration test
pytest tests/integration/test_client.py -v
Run All Tests
# Run all tests (unit + integration)
pytest tests/ -v
# Run with coverage
pytest tests/ --cov=src --cov-report=html
Quick Manual Test
# Test all 5 tools manually
python test_all_tools.py