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.
The easiest way to install and run the server is using npx:
npx @kunihiros/google-patents-mcp
To automatically install for Claude Desktop using Smithery:
npx -y @smithery/cli install @KunihiroS/google-patents-mcp --client claude
The server requires your SerpApi API key, which can be provided in two ways:
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"
}
}
}
}
Create a .env
file in one of these locations:
./.env
)~/.google-patents-mcp.env
)Add the following content:
SERPAPI_API_KEY=YOUR_ACTUAL_SERPAPI_KEY
# Optional: LOG_LEVEL=debug
The server provides a single tool called search_patents
that allows searching Google Patents.
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.{
"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"
}
}
}
The tool returns a JSON object containing the search results from SerpApi, following the SerpApi response format, which typically includes:
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
.
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.
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"
]
}
}
}
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.
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.