Google Patents (SerpAPI) MCP server

Search Google Patents using the SerpAPI.
Back to servers
Provider
Kunihiro Setogawa
Release date
Apr 01, 2025
Language
TypeScript
Package
Stats
363 downloads
5 stars

This MCP server enables searching through Google Patents information using the SerpApi Google Patents API, making patent data accessible through a standardized Model Context Protocol interface.

Installation

Prerequisites

  • Node.js (version 18 or higher recommended)
  • npm (for running npx commands)
  • SerpApi API key from SerpApi

Quick Installation

The easiest way to install and run the server is using npx:

npx @kunihiros/google-patents-mcp

Installation via Smithery for Claude Desktop

To automatically install for Claude Desktop using Smithery:

npx -y @smithery/cli install @KunihiroS/google-patents-mcp --client claude

Configuration

The server requires your SerpApi API key, which can be provided in two ways:

Using Environment Variables (Recommended)

Set the SERPAPI_API_KEY environment variable when running the server:

SERPAPI_API_KEY=your_api_key npx @kunihiros/google-patents-mcp

For MCP Host configurations, include environment variables in your config file:

{
  "mcpServers": {
    "google-patents-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@kunihiros/google-patents-mcp"
      ],
      "env": {
        "SERPAPI_API_KEY": "YOUR_ACTUAL_SERPAPI_KEY",
        "LOG_LEVEL": "info"
      }
    }
  }
}

Using .env Files

Create a .env file in one of these locations:

  • Current directory (./.env)
  • Home directory (~/.google-patents-mcp.env)

Add the following content:

SERPAPI_API_KEY=YOUR_ACTUAL_SERPAPI_KEY
# Optional: LOG_LEVEL=debug

Using the MCP Tool

The server provides a single tool called search_patents that allows searching Google Patents.

Search Patents Tool

Input Parameters

  • q (string, required): Search query. Use semicolon (;) to separate multiple terms.
  • page (integer, default: 1): Page number for pagination.
  • num (integer, default: 10): Number of results per page (10-100).
  • sort (string, options: "relevance", "new", "old"): Sorting method.
  • before (string): Maximum date filter (e.g., 'publication:20231231').
  • after (string): Minimum date filter (e.g., 'publication:20230101').
  • inventor (string): Filter by inventor names (comma-separated).
  • assignee (string): Filter by assignee names (comma-separated).
  • country (string): Filter by country codes (comma-separated).
  • language (string): Filter by language (comma-separated).
  • status (string, options: "GRANT", "APPLICATION"): Filter by patent status.
  • type (string, options: "PATENT", "DESIGN"): Filter by patent type.
  • scholar (boolean, default: false): Include Google Scholar results.

Example MCP Request

{
  "mcp_version": "1.0",
  "type": "CallToolRequest",
  "id": "req-123",
  "server_name": "google-patents-mcp",
  "params": {
    "name": "search_patents",
    "arguments": {
      "q": "organic light emitting diode",
      "num": 10,
      "language": "ENGLISH",
      "status": "GRANT",
      "after": "publication:20230101"
    }
  }
}

Output

The tool returns a JSON object containing the search results from SerpApi, following the SerpApi response format, which typically includes:

  • Organic patent results
  • Pagination information
  • Search metadata

Logging

The server logs are output to standard error. You can control the log level with the LOG_LEVEL environment variable:

LOG_LEVEL=debug npx @kunihiros/google-patents-mcp

Valid log levels: error, warn, info, http, verbose, debug, silly. The default is info.

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later