ramy-atawia/novitai-patent-mcp-server
If you are the rightful owner of novitai-patent-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
The Novitai Patent MCP Server is a specialized server designed to provide patent-related tools and services using the Model Context Protocol (MCP).
Novitai Patent MCP Server
A Model Context Protocol (MCP) server providing patent-related tools including web search, prior art search, patent claim drafting, and patent claim analysis.
Features
- Web Search Tool: Search the web for patent research using Google Custom Search API
- Prior Art Search Tool: Search for prior art patents using PatentsView API with comprehensive markdown reports
- Claim Drafting Tool: Draft patent claims based on invention descriptions using LLM
- Claim Analysis Tool: Analyze patent claims for validity, quality, and improvement opportunities using LLM
Architecture
The server is built using:
- FastAPI: Web framework for the MCP server
- Azure OpenAI: LLM integration for claim drafting and analysis
- Google Custom Search API: Web search functionality
- PatentsView API: Patent database access
- Docker: Containerized deployment
- Azure Container Apps: Cloud deployment platform
Quick Start
Prerequisites
- Python 3.12+
- Azure OpenAI API key
- Google Custom Search API key and CSE ID
- PatentsView API key (optional)
Local Development
-
Clone the repository
git clone <repository-url> cd novitai-patent-mcp-server -
Install dependencies
pip install -r requirements.txt -
Configure environment variables
cp env.example .env # Edit .env with your API keys -
Run the server
python mcp_server.py -
Test the server
# Health check curl http://localhost:8003/health # MCP endpoint curl http://localhost:8003/mcp
Docker Deployment
-
Build the Docker image
docker build -t novitai-mcp-server:local . -
Run the container
docker run -d --name novitai-mcp-docker -p 8003:8003 --env-file .env novitai-mcp-server:local -
Test the server
# For local clients curl http://localhost:8003/health # For clients inside Docker containers curl http://host.docker.internal:8003/mcp -
Check logs
docker logs novitai-mcp-docker -
Stop the container
docker stop novitai-mcp-docker && docker rm novitai-mcp-docker
Azure Container Apps Deployment
-
Prerequisites
- Azure CLI installed and logged in
- Azure Container Registry
- Resource group created
-
Deploy to Azure
cd azure-deployment ./deploy.sh dev your-resource-group eastus2 your-acr-name -
Update parameters
- Edit
parameters.dev.jsonwith your API keys - Update container registry name if needed
- Edit
Environment Variables
Required
AZURE_OPENAI_API_KEY: Your Azure OpenAI API keyAZURE_OPENAI_ENDPOINT: Your Azure OpenAI endpoint URLAZURE_OPENAI_DEPLOYMENT_NAME: Your Azure OpenAI deployment name
Optional
GOOGLE_API_KEY: Google Custom Search API keyGOOGLE_CSE_ID: Google Custom Search Engine IDPATENTSVIEW_API_KEY: PatentsView API keyPORT: Server port (default: 8003)LOG_LEVEL: Logging level (default: INFO)
MCP Protocol
The server implements the Model Context Protocol (MCP) specification and provides the following endpoints:
POST /mcp: Main MCP protocol endpoint (Streamable HTTP)GET /health: Health check endpoint
Connection URLs
- Local access:
http://localhost:8003/mcp - Docker-internal access:
http://host.docker.internal:8003/mcp - Azure deployment:
https://your-app.azurecontainerapps.io/mcp
Available Tools
-
web_search_tool
- Search the web for information
- Parameters:
query,max_results
-
prior_art_search_tool
- Search for prior art patents
- Parameters:
query,max_results,context,conversation_history
-
claim_drafting_tool
- Draft patent claims
- Parameters:
user_query,conversation_context,document_reference
-
claim_analysis_tool
- Analyze patent claims
- Parameters:
claims,analysis_type,focus_areas
API Usage
Initialize Connection
{
"jsonrpc": "2.0",
"id": 1,
"method": "initialize",
"params": {
"protocolVersion": "2024-11-05",
"capabilities": {},
"clientInfo": {
"name": "test-client",
"version": "1.0.0"
}
}
}
List Tools
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/list"
}
Execute Tool
{
"jsonrpc": "2.0",
"id": 3,
"method": "tools/call",
"params": {
"name": "web_search_tool",
"arguments": {
"query": "patent search",
"max_results": 5
}
}
}
Development
Project Structure
app/
├── core/ # Configuration and core utilities
├── mcp_tools/ # MCP tool implementations
├── services/ # External service integrations
├── utils/ # Utility functions
├── prompts/ # LLM prompt templates
└── main.py # Main FastAPI application
Adding New Tools
- Create a new tool class in
app/mcp_tools/ - Inherit from
BaseMCPTool - Implement the
executemethod - Add the tool to the tools dictionary in
main.py
Testing
# Run tests
pytest
# Run with coverage
pytest --cov=app
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Submit a pull request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
For support and questions, please open an issue in the repository.