PyTorch Documentation Search Tool

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.

Category
Visit Server

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 implementation
  • ptsearch/protocol/: MCP protocol handling
  • ptsearch/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

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.

Official
Featured
TypeScript
Magic Component Platform (MCP)

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.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

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.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

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.

Official
Featured
TypeScript
Kagi MCP Server

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.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

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.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured