
PyTorch Documentation Search Tool
Provides semantic search capabilities over PyTorch documentation, enabling users to find relevant documentation, APIs, code examples, and error messages through Claude Code integration.
README
PyTorch Documentation Search Tool
A semantic search tool for PyTorch documentation with MCP integration for Claude Code.
Overview
This tool provides semantic search capabilities over PyTorch documentation, allowing users to find relevant documentation, APIs, code examples, and error messages. It utilizes vector embeddings and semantic similarity to provide high-quality search results.
Features
- Semantic search for PyTorch documentation
- Code-aware search results (differentiates between code and text)
- Easy integration with Claude Code via MCP
- Multiple transport options (STDIO, SSE, UVX)
- Configurable search parameters and result formatting
Installation
Environment Setup
Create a conda environment with all dependencies:
conda env create -f environment.yml
conda activate pytorch_docs_search
For a minimal environment:
conda env create -f minimal_env.yml
conda activate pytorch_docs_search_min
API Key Setup
The tool requires an OpenAI API key for generating embeddings:
export OPENAI_API_KEY=your_key_here
MCP Integration
The tool can be integrated with Claude Code in three ways:
1. Direct STDIO Integration (Local Development)
# Register with Claude CLI
./register_mcp.sh
# This runs:
# claude mcp add search_pytorch_docs stdio ./run_mcp.sh
2. SSE Integration (Server Deployment)
# Start the server
python -m ptsearch.server --transport sse --host 0.0.0.0 --port 5000
# Register with Claude CLI
claude mcp add search_pytorch_docs http://localhost:5000/events --transport sse
3. UVX Integration (Packaged Distribution)
# Run with UVX
./run_mcp_uvx.sh
# This executes:
# uvx mcp-server-pytorch --transport sse --host 127.0.0.1 --port 5000 --data-dir ./data
Usage
Once registered with Claude Code, you can use the tool by asking questions about PyTorch:
How do I implement a custom dataset in PyTorch?
Claude Code will automatically use the PyTorch Documentation Search Tool to find relevant documentation.
Direct CLI Usage
You can also use the tool directly:
# Search from command line
python -m ptsearch.server --transport stdio --data-dir ./data
Architecture
ptsearch/server.py
: Unified server implementationptsearch/protocol/
: MCP protocol handlingptsearch/transport/
: Transport implementations (STDIO, SSE)ptsearch/core/
: Core search functionality
Development
Running Tests
pytest -v tests/
Format Code
black .
License
MIT License
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.