MCP Server POC

MCP Server POC

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: - Simple math operations (addition) - Dynamic greeting resource - Web crawling capability using the crawl4ai library

TarcisioPhilips

Research & Data
Visit Server

README

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
  2. 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

Recommended Servers

Crypto Price & Market Analysis MCP Server

Crypto Price & Market Analysis MCP Server

A Model Context Protocol (MCP) server that provides comprehensive cryptocurrency analysis using the CoinCap API. This server offers real-time price data, market analysis, and historical trends through an easy-to-use interface.

Featured
TypeScript
MCP PubMed Search

MCP PubMed Search

Server to search PubMed (PubMed is a free, online database that allows users to search for biomedical and life sciences literature). I have created on a day MCP came out but was on vacation, I saw someone post similar server in your DB, but figured to post mine.

Featured
Python
dbt Semantic Layer MCP Server

dbt Semantic Layer MCP Server

A server that enables querying the dbt Semantic Layer through natural language conversations with Claude Desktop and other AI assistants, allowing users to discover metrics, create queries, analyze data, and visualize results.

Featured
TypeScript
mixpanel

mixpanel

Connect to your Mixpanel data. Query events, retention, and funnel data from Mixpanel analytics.

Featured
TypeScript
Sequential Thinking MCP Server

Sequential Thinking MCP Server

This server facilitates structured problem-solving by breaking down complex issues into sequential steps, supporting revisions, and enabling multiple solution paths through full MCP integration.

Featured
Python
Nefino MCP Server

Nefino MCP Server

Provides large language models with access to news and information about renewable energy projects in Germany, allowing filtering by location, topic (solar, wind, hydrogen), and date range.

Official
Python
Vectorize

Vectorize

Vectorize MCP server for advanced retrieval, Private Deep Research, Anything-to-Markdown file extraction and text chunking.

Official
JavaScript
Mathematica Documentation MCP server

Mathematica Documentation MCP server

A server that provides access to Mathematica documentation through FastMCP, enabling users to retrieve function documentation and list package symbols from Wolfram Mathematica.

Local
Python
kb-mcp-server

kb-mcp-server

An MCP server aimed to be portable, local, easy and convenient to support semantic/graph based retrieval of txtai "all in one" embeddings database. Any txtai embeddings db in tar.gz form can be loaded

Local
Python
Research MCP Server

Research MCP Server

The server functions as an MCP server to interact with Notion for retrieving and creating survey data, integrating with the Claude Desktop Client for conducting and reviewing surveys.

Local
Python