Skip to main content

Search

MCP Rank provides semantic search over 490+ MCP servers. Find the right tools for any task your agent needs to perform.
from mcp_rank import MCPRankClient

async with MCPRankClient(api_key="sk_mcp_rank_...") as client:
    results = await client.search("send email to my team")
    
    for server in results["servers"]:
        print(f"{server['name']}")
        print(f"  {server['description']}")
        print(f"  Tools: {[t['name'] for t in server.get('tools', [])]}")

Search Response

The search endpoint returns:
{
  "servers": [
    {
      "id": "gmail-mcp-server",
      "name": "Gmail MCP Server",
      "description": "Send and manage emails via Gmail API",
      "remote_url": "https://mcp.example.com/gmail",
      "tools": [
        {
          "name": "send_email",
          "description": "Send an email",
          "input_schema": {...}
        }
      ]
    }
  ],
  "metadata": {
    "query_log_id": "abc123",
    "latency_ms": 45,
    "total_results": 10
  }
}

Search Options

results = await client.search(
    query="calendar management",
    limit=5  # Number of results (default: 10)
)

Using with the Agent Class

The Agent class handles search automatically:
from openai import OpenAI
from mcp_rank import Agent

agent = Agent(OpenAI(), api_key="sk_mcp_rank_...")

# Tools are discovered automatically based on the query
response = agent.run("Schedule a meeting for tomorrow at 2pm")

How It Works

  1. Semantic Embeddings: Your query is converted to a vector embedding
  2. Vector Search: We find MCP servers with similar embeddings
  3. Tool Discovery: We connect to top servers and discover their tools
  4. Ranking: Results are ranked by relevance and quality signals

Recording Invocations

Help improve search quality by reporting tool usage:
await client.record_invocation(
    server_id="gmail-mcp-server",
    tool_name="send_email",
    status="success",  # or "error", "timeout"
    query_log_id=results["metadata"]["query_log_id"],
    latency_ms=150,
)
This feedback helps us rank servers that work reliably higher in results.