MCP Server
Use Serpex as AI agent tools via the Model Context Protocol
serpex-mcp is an MCP (Model Context Protocol) server that exposes Serpex search and extract as tools for AI agents. Once configured, agents like Claude can call serpex_search and serpex_extract directly to perform live web research without leaving their context window.
Package: serpex-mcp on npm — v1.0.2
What the MCP Server Provides
The server exposes two tools:
serpex_search— search the web and get structured JSON results with titles, URLs, and snippets, optionally with each page's content as markdownserpex_extract— get the content of up to 10 known URLs as clean markdown or HTML
AI agents call these tools the same way they call any function. The results come back as structured JSON that the agent can reason over directly.
Setup with Claude Desktop
Add the following to your Claude Desktop configuration file.
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"serpex": {
"command": "npx",
"args": ["-y", "serpex-mcp"],
"env": {
"SERPEX_API_KEY": "sk_your_api_key"
}
}
}
}Restart Claude Desktop after saving. The serpex_search tool will appear in the tool list automatically.
Setup with Other MCP Clients
Any MCP-compatible client (Cursor, Windsurf, Continue, etc.) can use the same configuration pattern:
- Command:
npx - Arguments:
-y serpex-mcp - Environment variable:
SERPEX_API_KEY=sk_your_api_key
Available Tool: serpex_search
Input Schema
Prop
Type
Example Tool Call
{
"q": "artificial intelligence trends 2025",
"include_content": true,
"content_results": 5
}Example Response
The tool returns a JSON string with the search results:
{
"query": "artificial intelligence trends 2025",
"status": "success",
"total_results": 10,
"credits_used": 3,
"content_requested": 5,
"content_delivered": 4,
"results": [
{
"title": "AI Trends to Watch in 2025",
"url": "https://example.com/ai-trends",
"snippet": "The most significant AI developments of 2025 include...",
"position": 1,
"content": "# AI Trends to Watch in 2025\n\nThe most significant AI developments of 2025 include..."
}
]
}content (page markdown) or content_error (why the fetch failed) is only present per-result when the call included include_content: true; a plain call omits both keys, and content_requested / content_delivered, entirely. When nothing is found, status is "no_results" and a message explains whether the search was charged.
Available Tool: serpex_extract
Extract the content of known pages as clean Markdown (or HTML). Up to 10 URLs per call. Pages that can't be extracted come back with success: false, an error and an error_type, and aren't charged.
Prop
Type
The tool returns successful, failed, credits_used and one entry per URL: url, success, then markdown (or html) and status_code on success, or error, error_type and status_code (when the site answered) on failure.
Standalone Usage
You can also run the MCP server directly from the command line for testing or custom integrations:
export SERPEX_API_KEY="sk_your_api_key"
npx serpex-mcpThe server communicates over stdio using the MCP protocol.
Getting an API Key
- Sign up at serpex.dev
- Go to your dashboard
- Create an API key from the API Keys section
- Set it as
SERPEX_API_KEYin the MCP server config