Google Patents (SerpAPI)

by kunihiros

3 stars
525 downloads
Not rated
GitHub Website

About

Google Patents Mcp is a Model Context Protocol (MCP) server that allows searching Google Patents information via the SerpApi Google Patents API. It is designed for developers and AI assistants who need to query patent data programmatically.

Details

Author
kunihiros
Repository
KunihiroS/google-patents-mcp
GitHub stars
3
Downloads
525
License
MIT License
Categories
AI, Search, API, Infrastructure, Knowledge Base, Other

Provides an MCP tool search_patents to search Google Patents.
Uses SerpApi as the backend.

  • Can be run directly using npx without local installation.

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Google Patents (SerpAPI)
    Command (node, npx, python, etc.) npx
    Arguments
    • Argument 1 -y
    • Argument 2 @kunihiros/google-patents-mcp
    Environment
    • SERPAPI_API_KEY YOUR_ACTUAL_SERPAPI_KEY

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

The server requires your SerpApi API key. You can provide it in one of the following ways:

1. Environment Variable (Recommended for MCP Hosts):
Set the SERPAPI_API_KEY environment variable when running the server. MCP Host configurations often allow setting environment variables for servers.

Example MCP Host configuration snippet (config.json or similar):

    {
"mcpServers": {
"google-patents-mcp": {
"command": "npx",
"args": [
"-y", // Skips confirmation if the package isn't installed locally
"@kunihiros/google-patents-mcp" // Use the correct package name
],
"env": {
"SERPAPI_API_KEY": "YOUR_ACTUAL_SERPAPI_KEY"
// Optional: Set log level
// "LOG_LEVEL": "debug"
}
}
}
}

2. .env File:
Create a .env file in the directory where you run the npx command (for local testing or if not using an MCP Host), or in your home directory (~/.google-patents-mcp.env), with the following content:

    SERPAPI_API_KEY=YOUR_ACTUAL_SERPAPI_KEY

To install Google Patents MCP Server for Claude Desktop automatically via Smithery:

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

The easiest way to run this server is using npx. This command downloads (if necessary) and runs the server directly.

bash
npx @kunihiros/google-patents-mcp
``

Note: Replace @kunihiros/google-patents-mcp` with the actual published package name if it differs.

The server will start and listen for MCP requests on standard input/output.

search_patents

Searches Google Patents via SerpApi. Input parameters include: q (required search query), page (for pagination), num (results per page, must be 10 or greater), sort (sorting method), before (maximum date filter), after (minimum date filter), inventor (filter by inventor names), assignee (filter by assignee names), country (filter by country codes), language (filter by language), status (filter by patent status), type (filter by patent type), and scholar (include Google Scholar results).

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

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

Linux

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

Macos

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

Windows

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

Google Patents MCP Server (google-patents-mcp)

smithery badge
npm version

This project provides a Model Context Protocol (MCP) server that allows searching Google Patents information via the SerpApi Google Patents API.

Installing via Smithery

To install Google Patents MCP Server for Claude Desktop automatically via Smithery:

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

Changelog

v0.2.0 (2025-04-17)

Fix: Implemented empty handlers for resources/list and prompts/list MCP methods.
Fix: Declared prompts capability in server initialization.
Chore: Updated dependencies.

These changes aim to improve compatibility with MCP clients like Claude Desktop which may require these standard endpoints, though direct testing with Claude Desktop has not yet been performed.

Features

Provides an MCP tool search_patents to search Google Patents.
Uses SerpApi as the backend.
Can be run directly using npx without local installation.

Prerequisites

Node.js: Version 18 or higher is recommended.
npm: Required to run the npx command.
SerpApi API Key: You need a valid API key from SerpApi to use the Google Patents API.

Quick Start (Using npx)

The easiest way to run this server is using npx. This command downloads (if necessary) and runs the server directly.

npx @kunihiros/google-patents-mcp

Note: Replace @kunihiros/google-patents-mcp with the actual published package name if it differs.

The server will start and listen for MCP requests on standard input/output.

Configuration

The server requires your SerpApi API key. You can provide it in one of the following ways:

1. Environment Variable (Recommended for MCP Hosts):
Set the SERPAPI_API_KEY environment variable when running the server. MCP Host configurations often allow setting environment variables for servers.

Example MCP Host configuration snippet (config.json or similar):

    {
"mcpServers": {
"google-patents-mcp": {
"command": "npx",
"args": [
"-y", // Skips confirmation if the package isn't installed locally
"@kunihiros/google-patents-mcp" // Use the correct package name
],
"env": {
"SERPAPI_API_KEY": "YOUR_ACTUAL_SERPAPI_KEY"
// Optional: Set log level
// "LOG_LEVEL": "debug"
}
}
}
}

2. .env File:
Create a .env file in the directory where you run the npx command (for local testing or if not using an MCP Host), or in your home directory (~/.google-patents-mcp.env), with the following content:

    SERPAPI_API_KEY=YOUR_ACTUAL_SERPAPI_KEY
    # Optional: Set log level (e.g., debug, info, warn, error)
    # LOG_LEVEL=debug
    
Note: While using a .env file is convenient for local testing, for production or integration with MCP Hosts, setting the environment variable directly via the host configuration is the recommended and more secure approach. The primary intended use case is execution via npx, where environment variables are typically managed by the calling process or MCP Host.

The server searches for .env files in the following order:
./.env (relative to where npx is run)
~/.google-patents-mcp.env (in your home directory)

Provided MCP Tool

search_patents

Searches Google Patents via SerpApi.

Input Schema:

{
  "type": "object",
  "properties": {
    "q": {
      "type": "string",
      "description": "Search query (required). Although optional in SerpApi docs, a non-empty query is practically needed. Use semicolon (;) to separate multiple terms. Advanced syntax like '(Coffee) OR (Tea);(A47J)' is supported. See 'About Google Patents' for details."
    },
    "page": {
      "type": "integer",
      "description": "Page number for pagination (default: 1).",
      "default": 1
    },
    "num": {
      "type": "integer",
      "description": "Number of results per page (default: 10). IMPORTANT: Must be 10 or greater (up to 100).",
      "default": 10,
      "minimum": 10,
      "maximum": 100
    },
    "sort": {
      "type": "string",
      "enum": ["relevance", "new", "old"],
      "description": "Sorting method. 'relevance' (default), 'new' (newest by filing/publication date), 'old' (oldest by filing/publication date).",
      "default": "relevance"
    },
    "before": {
      "type": "string",
      "description": "Maximum date filter (e.g., 'publication:20231231', 'filing:20220101'). Format: type:YYYYMMDD where type is 'priority', 'filing', or 'publication'."
    },
    "after": {
      "type": "string",
      "description": "Minimum date filter (e.g., 'publication:20230101', 'filing:20220601'). Format: type:YYYYMMDD where type is 'priority', 'filing', or 'publication'."
    },
    "inventor": {
      "type": "string",
      "description": "Filter by inventor names. Separate multiple names with a comma (,)."
    },
    "assignee": {
      "type": "string",
      "description": "Filter by assignee names. Separate multiple names with a comma (,)."
    },
    "country": {
      "type": "string",
      "description": "Filter by country codes (e.g., 'US', 'WO,JP'). Separate multiple codes with a comma (,)."
    },
    "language": {
      "type": "string",
      "description": "Filter by language (e.g., 'ENGLISH', 'JAPANESE,GERMAN'). Separate multiple languages with a comma (,). Supported: ENGLISH, GERMAN, CHINESE, FRENCH, SPANISH, ARABIC, JAPANESE, KOREAN, PORTUGUESE, RUSSIAN, ITALIAN, DUTCH, SWEDISH, FINNISH, NORWEGIAN, DANISH."
    },
    "status": {
      "type": "string",
      "enum": ["GRANT", "APPLICATION"],
      "description": "Filter by patent status: 'GRANT' or 'APPLICATION'."
    },
    "type": {
      "type": "string",
      "enum": ["PATENT", "DESIGN"],
      "description": "Filter by patent type: 'PATENT' or 'DESIGN'."
    },
    "scholar": {
      "type": "boolean",
      "description": "Include Google Scholar results (default: false).",
      "default": false
    }
  },
  "required": ["q"]
}

Output:

Returns a JSON object containing the search results from SerpApi. The structure follows the SerpApi response format.

Example Usage (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"
    }
  }
}

Development

1. Clone the repository (if needed for development):

    # git clone <repository-url>
# cd google-patents-mcp

2. Install dependencies:
    npm install

3. Create .env file:
Copy .env.example to .env and add your SERPAPI_API_KEY.
4. Build:
    npm run build

5. Run locally:
    npm start

Or for development with auto-rebuild:
    npm run dev

Logging

Logs are output to standard error.
Log level can be controlled via the LOG_LEVEL environment variable (error, warn, info, http, verbose, debug, silly). Defaults to info.
A log file is attempted to be created in the project root (google-patents-server.log), user's home directory (~/.google-patents-server.log), or /tmp/google-patents-server.log.

License

MIT License (See LICENSE file)

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.