DEV Community

talor
talor

Posted on

Zero to MCP Server in 30 Minutes

What Is MCP?
MCP (Model Context Protocol) is becoming the standard way for AI applications (Claude, Cursor, VS Code, etc.) to discover and call external tools. Think of it as “USB‑C for AI.”

One MCP server → works with every MCP‑compatible client.

Build a SERP Search MCP Server
Here’s a complete, minimal MCP server that exposes TalorData’s search capability:

File: server.py

import os
import asyncio
from mcp.server import Server, Tool
from talordata import TalorClient

client = TalorClient(api_key=os.environ["TALOR_API_KEY"])
server = Server("talordata-search")

@server.tool()
async def search(query: str, engine: str = "google") -> list:
    """Search the web and return structured results."""
    results = await client.async_search(q=query, engine=engine)
    return [
        {
            "title": r.title,
            "link": r.link,
            "snippet": r.snippet
        }
        for r in results.organic[:10]
    ]

if __name__ == "__main__":
    server.run()
Enter fullscreen mode Exit fullscreen mode

Run it:

export TALOR_API_KEY="your-api-key"
python server.py
Enter fullscreen mode Exit fullscreen mode

How to Use It

  1. Claude Desktop: Add the server URL to your MCP configuration.
  2. Cursor / VS Code: Point the MCP client to your running server.
  3. LangChain / LlamaIndex: Use the MCP adapter to register the tool. Once configured, your AI client can automatically call search() – no extra code needed.

Why Build an MCP Server?

  • One build, many clients – works with Claude, Cursor, VS Code, and more.
  • Discoverable – your tool shows up in MCP directories.
  • Decoupled – upgrade your tool without touching agent logic.

Get the full MCP server code + docs:
👉 github.com/Talordata/talordata-mcp

Top comments (0)