Get the FREE Ultimate OpenClaw Setup Guide →

mcp -demo

Mini mcp server implementation

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio pangan21-mcp-server-demo python main.py \
  --env SERPER_API_KEY="your-serper-api-key"

How to use

This MCP server implements a library documentation retriever. It leverages the Serper API to search for the latest documentation or information about a queried library and returns relevant results. Before running, you must provide a Serper API key as described in the project’s .env.example. Once the server is running, you can interact with it through the MCP inspector tools to query documentation and fetch up-to-date details about libraries, APIs, or packages. To use the server locally, start the Python runtime for the MCP server and then connect with the MCP inspector to issue queries and retrieve docs.

In practice, you run the server with Python and then use the inspector to explore available tools. The inspector will list tools like get_docs, which you can invoke with your query strings (for example, a library name or API). The system returns synthesized documentation based on Serper searches, making it easier to retrieve the latest usage notes, method signatures, and general references for the library you’re querying.

How to install

Prerequisites:

  • Python 3.8+ installed on your system
  • A virtual environment tool (optional but recommended)
  • Internet access to install dependencies and use Serper API

Step-by-step installation:

  1. Create and activate a virtual environment (optional but recommended):
python -m venv .venv
# macOS/Linux
source .venv/bin/activate
# Windows
.venv\Scripts\activate
  1. Install dependencies from requirements.txt:
pip install -r requirements.txt
  1. Obtain a Serper API key and set it in your environment. See the .env.example in the repository for guidance. For example:
export SERPER_API_KEY=your-serper-api-key
# on Windows PowerShell
$Env:SERPER_API_KEY="your-serper-api-key"
  1. Start the MCP server locally (via Python):
python main.py
  1. If using the MCP inspector, you can connect and list tools (see the README for inspector usage).

Additional notes

Notes and tips:

  • The server relies on the Serper API for search results; ensure your API key is valid and has sufficient quota.
  • Set the SERPER_API_KEY environment variable before launching the server to avoid authentication errors.
  • If you encounter import or dependency issues, verify your virtual environment is activated and that requirements.txt is up to date.
  • The inspector command in the README shows how to connect to the server for debugging; use it to enumerate available tools and test get_docs queries.
  • If you need to customize the server (e.g., change the query behavior or add more capabilities), adjust main.py or related modules accordingly.

Related MCP Servers

Sponsor this space

Reach thousands of developers