mcp -demo
Mini mcp server implementation
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:
- Create and activate a virtual environment (optional but recommended):
python -m venv .venv
# macOS/Linux
source .venv/bin/activate
# Windows
.venv\Scripts\activate
- Install dependencies from requirements.txt:
pip install -r requirements.txt
- 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"
- Start the MCP server locally (via Python):
python main.py
- 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
mcp-vegalite
MCP server from isaacwasserman/mcp-vegalite-server
github-chat
A Model Context Protocol (MCP) for analyzing and querying GitHub repositories using the GitHub Chat API.
nautex
MCP server for guiding Coding Agents via end-to-end requirements to implementation plan pipeline
pagerduty
PagerDuty's official local MCP (Model Context Protocol) server which provides tools to interact with your PagerDuty account directly from your MCP-enabled client.
futu-stock
mcp server for futuniuniu stock
mcp -boilerplate
Boilerplate using one of the 'better' ways to build MCP Servers. Written using FastMCP