Navigation
MCP Server POC: Custom Tools & Web Crawling - MCP Implementation

MCP Server POC: Custom Tools & Web Crawling

MCP Server POC: Empower AI assistants (Claude+) with custom tools—math ops, dynamic greetings, and web crawling (via crawl4ai)—to harness MCP's potential. Your POC starts here!" )

Research And Data
4.1(194 reviews)
291 saves
135 comments

Users create an average of 23 projects per month with this tool

About MCP Server POC

What is MCP Server POC: Custom Tools & Web Crawling?

This Proof-of-Concept (PoC) implementation demonstrates how to build an MCP server that enhances AI assistants like Claude with custom tools and real-time resources. The server acts as a bridge between AI models and external capabilities, enabling features like documentation lookup, web crawling, and API-driven search integration.

How to Use MCP Server POC: Custom Tools & Web Crawling?

Getting Started

  1. Clone the repository and install dependencies using pip install -r requirements.txt
  2. Configure environment variables by creating a .env file in the root directory
  3. Run the server and connect it to your preferred AI framework

Integration with Cursor

Follow these steps to link the server with Cursor for seamless workflow automation:

  1. Set API endpoints in the configuration file
  2. Authorize the server through Cursor's developer dashboard

MCP Server POC Features

Key Features of MCP Server POC: Custom Tools & Web Crawling?

  • Documentation Search Tool: Instant access to Python, JavaScript, and other tech libraries via keyword queries
  • Web Crawling Module: Fetch live data from non-API web sources for real-time analysis
  • Google Search API Integration: Leverage Serper's API for contextual web searches within AI workflows
  • Windows Compatibility Fix: Resolves binary mode issues through automated configuration tweaks

Use Cases of MCP Server POC: Custom Tools & Web Crawling?

Common applications include:

  • Developer tools: Instant API reference lookups during coding sessions
  • Customer support: AI agents resolving issues with real-time data fetching
  • Enterprise integrations: Custom search engines for internal knowledge bases

MCP Server POC FAQ

FAQ from MCP Server POC: Custom Tools & Web Crawling?

Why am I getting a "Port in use" error?

Check your .env file for port conflicts or use lsof -i : to identify existing processes

How do I configure Windows paths correctly?

Use double backslashes \\ in file paths to avoid JSON parsing errors

Dependencies are missing!

Re-run pip install -r requirements.txt after updating Python environment permissions

API key isn't working

Verify the API_KEY value matches your Serper account credentials exactly

Where can I find usage logs?

Check /logs/server.log for debug output and error tracing

Content

MCP Server POC

A proof-of-concept implementation of a Model Context Protocol (MCP) server for enhancing AI assistant capabilities with custom tools and resources.

Overview

This project demonstrates how to create and use a Model Context Protocol (MCP) server that can provide custom tools and resources to AI assistants like Claude and others that support the MCP standard. The server includes:

  • Documentation search tool for LangChain, LlamaIndex, and OpenAI
  • Web crawling capability
  • Integration with Google Search API

Requirements

  • Python 3.11
  • Required packages listed in requirements.txt

Installation and Setup

  1. Clone this repository:
git clone https://github.com/yourusername/mcp-server-poc.git
cd mcp-server-poc
  1. Create and activate a virtual environment:
# Create a Python 3.11 virtual environment
python -m venv venv

# Activate on Windows
 .\venv\Scripts\Activate.ps1

# Activate on macOS/Linux
source venv/bin/activate
  1. Install the required packages:
pip install -r requirements.txt
  1. Set up environment variables:

Create a .env file in the root directory with the following:

SERPER_API_KEY=your_serper_api_key_here

Running the Application

To run the MCP server:

python main.py

The server will start and wait for connections using the stdio transport method.

Integrating with Cursor

To use this MCP server with Cursor IDE:

  1. Create or edit the file ~/.cursor/mcp.json (on Windows: C:\Users\<username>\.cursor\mcp.json) with the following content:
{
    "mcpServers": {
        "mcp-server": {
            "command": "python", 
            "args": [
                "ABSOLUTE/PATH/TO/main.py"
            ]
        }
    }
}
  1. Replace the path with the absolute path to your main.py file.
* On Windows, use double backslashes: `C:\\Users\\username\\path\\to\\main.py`
* On macOS/Linux, use regular slashes: `/Users/username/path/to/main.py`
  1. Restart Cursor completely (including ending any background processes) to load the MCP server.

Features

Tools

  • get_docs(query, library) : Searches the documentation for the specified library (langchain, llama-index, or openai) and returns relevant information

Technical Details

Windows Binary Mode Fix

This server includes a specific fix for Windows to ensure proper operation with stdio transport:

# Set binary mode for stdin/stdout on Windows
if os.name == 'nt':
    import msvcrt
    msvcrt.setmode(sys.stdin.fileno(), os.O_BINARY)
    msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)

This fix is necessary because Windows distinguishes between text and binary modes for file handling, which can cause issues with the stdio transport mechanism used by MCP.

Troubleshooting

If you encounter issues with the MCP server:

Windows-Specific Issues

  • "Failed to create client" or "Client closed" errors :
    • Make sure to use the binary mode fix included in the server
    • Use the absolute path with double backslashes in the mcp.json configuration
    • Try running the MCP server directly to see if it produces any error output
    • Completely exit Cursor (including terminating any background processes via Task Manager) before restarting

General Issues

  • Verify that all required packages are installed (pip list to check)
  • Check that the absolute path in the configuration file is correct
  • Make sure the MCP server is running with the proper version of Python (3.11)
  • Verify that your .env file contains the required API key
  • Try reinstalling the MCP package: pip uninstall mcp && pip install mcp

License

MIT License

Acknowledgements

Related MCP Servers & Clients