Discover Awesome MCP Servers

Extend your agent with 17,451 capabilities via MCP servers.

All17,451
MCP Community Contributions

MCP Community Contributions

This is a directory repo for anything related to MCP - servers, clients and projects around MCP.

VoiceStudio MCP Server

VoiceStudio MCP Server

MCP server for kintone

MCP server for kintone

Cermin dari

Grasshopper MCP サーバー

Grasshopper MCP サーバー

Implementasi server Model Context Protocol (MCP) untuk integrasi Rhinoceros/Grasshopper, memungkinkan model AI berinteraksi dengan alat desain parametrik.

mcptime

mcptime

SImple MCP server to return the current time

RapidAPI MCP Server

RapidAPI MCP Server

Okay, here's a breakdown of how you might implement an MCP (presumably referring to a **Microservice Control Plane** or a similar architecture) server for integrating the RapidAPI Global Patent API with SQLite storage, along with considerations and code snippets (in Python, as it's a common choice for microservices and API interactions). **Conceptual Architecture** 1. **Client (Your Application):** Sends requests (e.g., patent search queries) to the MCP server. 2. **MCP Server (This is what we're building):** * **API Gateway/Router:** Receives requests from the client. Handles authentication, authorization, rate limiting, and routing. * **Patent Service:** The core logic for interacting with the RapidAPI Global Patent API. * **Data Storage Service:** Handles interactions with the SQLite database. 3. **RapidAPI Global Patent API:** The external API providing patent data. 4. **SQLite Database:** Stores patent data (e.g., search results, cached data). **Key Components and Implementation Steps** **1. Project Setup (Python with Flask/FastAPI)** * **Choose a Framework:** Flask and FastAPI are popular choices for building microservices in Python. FastAPI is generally preferred for its performance and built-in features like automatic API documentation (Swagger/OpenAPI). I'll use FastAPI in this example. * **Install Dependencies:** ```bash pip install fastapi uvicorn requests python-dotenv pysqlite3 ``` * `fastapi`: The FastAPI framework. * `uvicorn`: An ASGI server to run the FastAPI application. * `requests`: For making HTTP requests to the RapidAPI. * `python-dotenv`: For loading environment variables from a `.env` file. * `pysqlite3`: SQLite driver for Python. * **Project Structure:** ``` patent_mcp/ ├── main.py # Main application entry point ├── services/ │ ├── patent_service.py # Logic for interacting with RapidAPI │ └── data_service.py # Logic for interacting with SQLite ├── models/ │ └── patent_model.py # Data models (Pydantic) ├── .env # Environment variables (API keys, etc.) └── README.md ``` **2. Environment Variables (.env)** Create a `.env` file in the root directory: ``` RAPIDAPI_KEY="YOUR_RAPIDAPI_KEY" RAPIDAPI_HOST="global-patent.p.rapidapi.com" DATABASE_PATH="patents.db" ``` **3. Data Models (models/patent_model.py)** Use Pydantic to define data models for patent information. This helps with data validation and serialization. ```python from pydantic import BaseModel from typing import Optional, List class Patent(BaseModel): patent_id: str title: str abstract: Optional[str] = None inventors: Optional[List[str]] = None assignees: Optional[List[str]] = None publication_date: Optional[str] = None # Add other relevant fields from the RapidAPI response ``` **4. Data Storage Service (services/data_service.py)** This module handles interactions with the SQLite database. ```python import sqlite3 from typing import List from models.patent_model import Patent import os from dotenv import load_dotenv load_dotenv() DATABASE_PATH = os.getenv("DATABASE_PATH") def create_connection(): """Creates a database connection to the SQLite database.""" conn = None try: conn = sqlite3.connect(DATABASE_PATH) return conn except sqlite3.Error as e: print(f"Error connecting to database: {e}") return None def create_table(): """Creates the patents table if it doesn't exist.""" conn = create_connection() if conn: try: cursor = conn.cursor() cursor.execute(""" CREATE TABLE IF NOT EXISTS patents ( patent_id TEXT PRIMARY KEY, title TEXT, abstract TEXT, inventors TEXT, assignees TEXT, publication_date TEXT ) """) conn.commit() except sqlite3.Error as e: print(f"Error creating table: {e}") finally: conn.close() def insert_patent(patent: Patent): """Inserts a patent into the database.""" conn = create_connection() if conn: try: cursor = conn.cursor() cursor.execute(""" INSERT INTO patents (patent_id, title, abstract, inventors, assignees, publication_date) VALUES (?, ?, ?, ?, ?, ?) """, (patent.patent_id, patent.title, patent.abstract, ','.join(patent.inventors) if patent.inventors else None, ','.join(patent.assignees) if patent.assignees else None, patent.publication_date)) conn.commit() except sqlite3.Error as e: print(f"Error inserting patent: {e}") finally: conn.close() def get_patent(patent_id: str) -> Patent | None: """Retrieves a patent from the database by patent_id.""" conn = create_connection() if conn: try: cursor = conn.cursor() cursor.execute("SELECT patent_id, title, abstract, inventors, assignees, publication_date FROM patents WHERE patent_id=?", (patent_id,)) row = cursor.fetchone() if row: patent = Patent( patent_id=row[0], title=row[1], abstract=row[2], inventors=row[3].split(',') if row[3] else [], assignees=row[4].split(',') if row[4] else [], publication_date=row[5] ) return patent else: return None except sqlite3.Error as e: print(f"Error retrieving patent: {e}") return None finally: conn.close() def search_patents(query: str) -> List[Patent]: """Searches for patents in the database based on a query (e.g., in title or abstract).""" conn = create_connection() patents: List[Patent] = [] if conn: try: cursor = conn.cursor() # Simple example: Search title and abstract. Use FTS (Full-Text Search) for better performance in a real application. cursor.execute("SELECT patent_id, title, abstract, inventors, assignees, publication_date FROM patents WHERE title LIKE ? OR abstract LIKE ?", ('%' + query + '%', '%' + query + '%')) rows = cursor.fetchall() for row in rows: patent = Patent( patent_id=row[0], title=row[1], abstract=row[2], inventors=row[3].split(',') if row[3] else [], assignees=row[4].split(',') if row[4] else [], publication_date=row[5] ) patents.append(patent) except sqlite3.Error as e: print(f"Error searching patents: {e}") finally: conn.close() return patents # Initialize the database table when the module is loaded create_table() ``` **5. Patent Service (services/patent_service.py)** This module interacts with the RapidAPI Global Patent API. ```python import requests import os from dotenv import load_dotenv from typing import Optional, Dict, Any from models.patent_model import Patent import services.data_service as data_service load_dotenv() RAPIDAPI_KEY = os.getenv("RAPIDAPI_KEY") RAPIDAPI_HOST = os.getenv("RAPIDAPI_HOST") def search_patents_rapidapi(query: str) -> Optional[Dict[str, Any]]: """Searches the RapidAPI Global Patent API.""" url = "https://global-patent.p.rapidapi.com/search" # Replace with the correct endpoint headers = { "X-RapidAPI-Key": RAPIDAPI_KEY, "X-RapidAPI-Host": RAPIDAPI_HOST } querystring = {"q": query} try: response = requests.get(url, headers=headers, params=querystring) response.raise_for_status() # Raise HTTPError for bad responses (4xx or 5xx) return response.json() except requests.exceptions.RequestException as e: print(f"Error calling RapidAPI: {e}") return None def get_patent_details(patent_id: str) -> Optional[Patent]: """Retrieves patent details from RapidAPI or the database (with caching).""" # 1. Check the database first patent = data_service.get_patent(patent_id) if patent: print(f"Patent {patent_id} found in database.") return patent # 2. If not in the database, fetch from RapidAPI url = f"https://global-patent.p.rapidapi.com/patent/{patent_id}" # Replace with the correct endpoint headers = { "X-RapidAPI-Key": RAPIDAPI_KEY, "X-RapidAPI-Host": RAPIDAPI_HOST } try: response = requests.get(url, headers=headers) response.raise_for_status() data = response.json() # Assuming the RapidAPI response structure, adapt this part patent = Patent( patent_id=data.get("patent_id"), title=data.get("title"), abstract=data.get("abstract"), inventors=data.get("inventors"), assignees=data.get("assignees"), publication_date=data.get("publication_date") ) # 3. Store the fetched patent in the database for caching data_service.insert_patent(patent) print(f"Patent {patent_id} fetched from RapidAPI and stored in database.") return patent except requests.exceptions.RequestException as e: print(f"Error calling RapidAPI: {e}") return None except Exception as e: print(f"Error processing RapidAPI response: {e}") return None ``` **6. Main Application (main.py)** This is the entry point for your FastAPI application. ```python from fastapi import FastAPI, HTTPException, Query from typing import List, Optional from models.patent_model import Patent import services.patent_service as patent_service import services.data_service as data_service app = FastAPI() @app.get("/patents/search", response_model=List[Patent]) async def search_patents(query: str = Query(..., title="Search Query", description="The search term for patents.")): """Searches for patents, first in the local database, then in the RapidAPI if not found locally.""" # 1. Search in the local database local_results = data_service.search_patents(query) if local_results: print(f"Found {len(local_results)} patents in local database for query: {query}") return local_results # 2. If no results in the database, search the RapidAPI rapidapi_results = patent_service.search_patents_rapidapi(query) if rapidapi_results and isinstance(rapidapi_results, dict) and "results" in rapidapi_results: # Adjust based on actual API response patents: List[Patent] = [] for result in rapidapi_results["results"]: # Adjust based on actual API response try: patent = Patent( patent_id=result.get("patent_id"), title=result.get("title"), abstract=result.get("abstract"), inventors=result.get("inventors"), assignees=result.get("assignees"), publication_date=result.get("publication_date") ) data_service.insert_patent(patent) # Cache the result patents.append(patent) except Exception as e: print(f"Error processing RapidAPI result: {e}") print(f"Found {len(patents)} patents in RapidAPI for query: {query}") return patents else: print(f"No patents found in RapidAPI for query: {query}") return [] # Return an empty list if no results are found @app.get("/patents/{patent_id}", response_model=Patent) async def get_patent(patent_id: str): """Retrieves a specific patent by its ID, using caching.""" patent = patent_service.get_patent_details(patent_id) if patent: return patent else: raise HTTPException(status_code=404, detail="Patent not found") @app.get("/health") async def health_check(): """Health check endpoint.""" return {"status": "ok"} ``` **7. Running the Application** ```bash uvicorn main:app --reload ``` This will start the FastAPI server. You can then access the API endpoints (e.g., `http://127.0.0.1:8000/patents/search?query=example`, `http://127.0.0.1:8000/patents/US1234567B1`). FastAPI will automatically generate API documentation at `http://127.0.0.1:8000/docs`. **Important Considerations and Enhancements** * **Error Handling:** Implement more robust error handling, including logging and appropriate HTTP status codes. * **API Key Security:** Never hardcode API keys directly into your code. Use environment variables and secure configuration management. Consider using a secrets management service (e.g., HashiCorp Vault) for production environments. * **Rate Limiting:** Implement rate limiting to prevent abuse of your API and to stay within the RapidAPI usage limits. FastAPI has middleware options for rate limiting. * **Authentication/Authorization:** Implement authentication and authorization to control access to your API. OAuth 2.0 is a common choice. * **Asynchronous Operations:** Use `async` and `await` for I/O-bound operations (like API calls and database interactions) to improve performance. FastAPI is built for asynchronous programming. * **Data Validation:** Use Pydantic models for strict data validation. * **Testing:** Write unit tests and integration tests to ensure the reliability of your code. * **Logging:** Implement comprehensive logging to track API usage, errors, and performance. * **Caching:** Implement more sophisticated caching strategies (e.g., using Redis or Memcached) for frequently accessed data. Consider using a cache invalidation strategy. * **Full-Text Search (FTS):** For more efficient searching of patent data, use SQLite's FTS extension (Full-Text Search). This will significantly improve search performance, especially for large datasets. You'll need to create a virtual table using FTS and populate it with the text data you want to search. * **Database Migrations:** Use a database migration tool (e.g., Alembic) to manage database schema changes. * **Deployment:** Consider deploying your microservice to a container orchestration platform like Kubernetes or Docker Swarm. * **Monitoring:** Implement monitoring to track the health and performance of your microservice. Tools like Prometheus and Grafana can be used for monitoring. * **Circuit Breaker:** Implement a circuit breaker pattern to prevent cascading failures if the RapidAPI becomes unavailable. * **API Gateway:** For a true MCP, use a dedicated API Gateway (e.g., Kong, Tyk, Ambassador) to handle routing, authentication, rate limiting, and other cross-cutting concerns. This decouples these concerns from your individual microservices. * **Service Discovery:** In a microservices architecture, use a service discovery mechanism (e.g., Consul, etcd, Kubernetes DNS) to allow your services to find each other. * **Message Queue:** For asynchronous tasks (e.g., updating the database with new patent data), use a message queue (e.g., RabbitMQ, Kafka). **Example of using FTS (Full-Text Search) in SQLite** First, enable FTS5 in your SQLite database. You'll need to modify the `create_table` function in `data_service.py`: ```python def create_table(): """Creates the patents table with FTS5 if it doesn't exist.""" conn = create_connection() if conn: try: cursor = conn.cursor() cursor.execute("DROP TABLE IF EXISTS patents;") # Drop the old table cursor.execute(""" CREATE VIRTUAL TABLE IF NOT EXISTS patents USING fts5( patent_id, title, abstract, inventors, assignees, publication_date, content='tokenize=porter' -- Use Porter Stemmer for better search ); """) conn.commit() except sqlite3.Error as e: print(f"Error creating table: {e}") finally: conn.close() ``` Then, modify the `insert_patent` function to insert data into the FTS table: ```python def insert_patent(patent: Patent): """Inserts a patent into the FTS table.""" conn = create_connection() if conn: try: cursor = conn.cursor() cursor.execute(""" INSERT INTO patents (patent_id, title, abstract, inventors, assignees, publication_date) VALUES (?, ?, ?, ?, ?, ?) """, (patent.patent_id, patent.title, patent.abstract, ','.join(patent.inventors) if patent.inventors else None, ','.join(patent.assignees) if patent.assignees else None, patent.publication_date)) conn.commit() except sqlite3.Error as e: print(f"Error inserting patent: {e}") finally: conn.close() ``` Finally, update the `search_patents` function to use the FTS `MATCH` operator: ```python def search_patents(query: str) -> List[Patent]: """Searches for patents in the database using FTS.""" conn = create_connection() patents: List[Patent] = [] if conn: try: cursor = conn.cursor() cursor.execute(""" SELECT patent_id, title, abstract, inventors, assignees, publication_date FROM patents WHERE patents MATCH ? """, (query,)) # Use the MATCH operator for FTS rows = cursor.fetchall() for row in rows: patent = Patent( patent_id=row[0], title=row[1], abstract=row[2], inventors=row[3].split(',') if row[3] else [], assignees=row[4].split(',') if row[4] else [], publication_date=row[5] ) patents.append(patent) except sqlite3.Error as e: print(f"Error searching patents: {e}") finally: conn.close() return patents ``` **Explanation of the FTS Changes:** * **`CREATE VIRTUAL TABLE ... USING fts5(...)`:** Creates a virtual table using the `fts5` module. The `content='tokenize=porter'` option enables the Porter Stemmer for better search results (e.g., searching for "running" will also find "run"). * **`patents MATCH ?`:** Uses the `MATCH` operator to perform a full-text search. The `?` placeholder is replaced with the search query. Remember to drop the existing `patents` table before creating the FTS table. Also, you might need to install the `sqlite-fts5` extension separately, depending on your system. This comprehensive guide provides a solid foundation for building your MCP server. Remember to adapt the code and architecture to your specific needs and the specifics of the RapidAPI Global Patent API response format. Good luck!

MCP Servers Modified

MCP Servers Modified

mcp-tools-cli

mcp-tools-cli

command-line client for interacting with Model Context Protocol (MCP) servers.

Sequential Thinking MCP Server

Sequential Thinking MCP Server

MCP EV Assistant Server

MCP EV Assistant Server

Implementasi server yang kuat untuk mengelola stasiun pengisian Kendaraan Listrik (EV), perencanaan perjalanan, dan manajemen sumber daya. Server ini menyediakan serangkaian alat dan API yang komprehensif untuk layanan terkait EV.

AB Component Server

AB Component Server

React + TypeScript + Vite

React + TypeScript + Vite

MCPServerProject

MCPServerProject

created from MCP server demo

Unity MCP Integration

Unity MCP Integration

Sebuah server yang memungkinkan asisten AI untuk memahami dan berinteraksi dengan proyek Unity secara waktu nyata, menyediakan akses ke hierarki adegan, pengaturan proyek, dan kemampuan untuk menjalankan kode secara langsung di Unity Editor.

Serper

Serper

Worker17

Worker17

An MCP server to monitor workers productivity and fire them as needed.

My first MCP server

My first MCP server

Model Context Protocol(MCP) 编程极速入门

Model Context Protocol(MCP) 编程极速入门

Pengantar Kilat Pemrograman Model Context Protocol (MCP)

MailPace MCP (Model Context Protocol) Server

MailPace MCP (Model Context Protocol) Server

Implementasi server MCP yang memungkinkan pengiriman email melalui API email transaksional cepat MailPace.

Local Claude MCP Servers Collection

Local Claude MCP Servers Collection

Enterprise MCP servers

MCP Google Custom Search Server

MCP Google Custom Search Server

Cermin dari

MCP Server for Hacker News

MCP Server for Hacker News

Here are a few possible translations, depending on the specific context you want to convey: **Option 1 (Most General):** * **Server MCP untuk Hacker News** This is a direct translation and is generally understandable. **Option 2 (If you're referring to a specific server setup):** * **Server MCP untuk menjalankan Hacker News** (Server MCP to run Hacker News) This implies the MCP server is being used to host or operate Hacker News. **Option 3 (If you're referring to a server *like* MCP for Hacker News):** * **Server seperti MCP untuk Hacker News** (Server like MCP for Hacker News) This suggests you're looking for a server solution similar to MCP. **Option 4 (If you're talking about an MCP server *related to* Hacker News):** * **Server MCP terkait Hacker News** (MCP server related to Hacker News) This is a more general connection, implying the server is associated with Hacker News in some way. **Which one is best depends on the context. Could you provide more information about what you mean by "MCP Server for Hacker News"? For example:** * Are you looking for a server *like* MCP to host Hacker News? * Are you talking about a specific MCP server that *is* hosting Hacker News? * Are you talking about a server that *integrates* with Hacker News? With more context, I can provide a more accurate and natural-sounding translation.

mcp-sondehub

mcp-sondehub

Sebuah Server MCP untuk API SondeHub terutama untuk bereksperimen dengan MCP.

MCP Server for Replicate

MCP Server for Replicate

Mirror of

Notion MCP Server

Notion MCP Server

Gel Database MCP Server

Gel Database MCP Server

Cermin dari

PrivateGPT MCP Server

PrivateGPT MCP Server

Cermin dari

go-mcp-server-service

go-mcp-server-service

A JSON-RPC 2.0 compliant server implementing the Model Context Protocol (MCP) for note management (as an example)

Gmail Server for Model Context Protocol (MCP)

Gmail Server for Model Context Protocol (MCP)

Mirror of

Basic MCP Server Tool

Basic MCP Server Tool