A Model Context Protocol (MCP) server that provides AI assistants with the ability to search and retrieve documentation from popular Python libraries including LangChain, LlamaIndex, and OpenAI.
- Documentation Search: Search through official documentation for supported libraries
- Web Scraping: Fetches and parses documentation content from official sources
- MCP Integration: Works seamlessly with MCP-compatible AI assistants
- Error Handling: Robust error handling with comprehensive logging
- Environment Configuration: Easy setup with environment variables
- LangChain -
python.langchain.com/docs - LlamaIndex -
python.llama_index.com/docs - OpenAI -
platform.openai.com/docs
mcp/
├── src/
│ ├── claude_invoke/ # Claude AI integration utilities
│ │ └── invoke.py
│ ├── config/ # Configuration files
│ ├── mcp_server/ # Main MCP server implementation
│ │ ├── main.py # Main server entry point
│ │ ├── pyproject.toml # Project dependencies
│ │ ├── uv.lock # Lock file for dependencies
│ │ └── logs/ # Server logs
│ └── utils/
│ └── logger/ # Logging utilities
│ ├── logging_manager.py
│ └── logging.py
├── .env # Environment variables
├── .gitignore
└── README.md
- Python 3.12+
- uv (Python package manager)
- Serper API Key (for web search functionality)
-
Clone the repository:
git clone <repository-url> cd mcp
-
Install dependencies:
cd src/mcp_server uv sync -
Set up environment variables: Create a
.envfile in the project root:SERPER_API_KEY=your_serper_api_key_here
-
Configure the MCP server using the Command Palette:
- Open Command Palette (
Ctrl+Shift+P) - Run
MCP: Add Server - Enter the following configuration:
- Server Name:
documentation - Command:
uv - Arguments:
--directoryE:/CodeBase/GitHub/mcprunsrc/mcp_server/main.py
- Server Name:
- Open Command Palette (
-
Enable MCP and Agent mode in VS Code settings:
{ "chat.mcp.enabled": true, "chat.agent.enabled": true }
Add to your Claude configuration file:
{
"mcpServer": {
"documentation": {
"command": "uv",
"args": [
"--directory",
"E:/CodeBase/GitHub/mcp",
"run",
"src/mcp_server/main.py"
]
}
}
}Once configured, the MCP server provides the following tool:
Search documentation for a specific library.
Parameters:
query: Search query (e.g., "vector store", "embeddings")library: Library to search ("langchain","llama_index", or"openai")
Example Usage:
Can you search for information about Chroma vector database in LangChain?
The assistant will use the get_docs tool to search LangChain documentation and return relevant information.
For testing and development:
cd E:/CodeBase/GitHub/mcp
uv run src/mcp_server/main.pyThe server includes comprehensive logging:
- Console output: Formatted logs to stderr for debugging
- File logging: Detailed logs saved to
src/mcp_server/logs/general/ - Structured logging: JSON-formatted data logging for analysis
Key dependencies (see src/mcp_server/pyproject.toml):
- fastmcp: MCP server framework
- httpx: HTTP client for web requests
- beautifulsoup4: HTML parsing
- python-dotenv: Environment variable management
- loguru: Advanced logging
The server uses the Serper API for web search functionality. You'll need to:
- Sign up for a Serper API account
- Get your API key
- Add it to your
.envfile
-
Module not found errors:
- Ensure you're running from the project root directory
- Check that all dependencies are installed with
uv sync
-
MCP server not appearing:
- Verify MCP is enabled in your settings
- Check server status with
MCP: List Servers - Try
MCP: Reset Cached Tools
-
API errors:
- Edit .env and add your actual API key
- Get your API key from https://serper.dev/
- Verify your
SERPER_API_KEYis correctly set - Check network connectivity
- Review logs in the
logs/general/directory
The server includes extensive debug logging. Check the log files in src/mcp_server/logs/general/ for detailed error information.
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
For issues and questions:
- Check the logs in
src/mcp_server/logs/general/ - Review the troubleshooting section above
- Open an issue in the repository
Note: This MCP server is designed to work with AI assistants that support the Model Context Protocol. Make sure your AI assistant has MCP support enabled and properly configured.