PDF Search for Zed is a document search extension that enables semantic searching through PDF documents and integrates results with Zed's AI Assistant. This extension helps you find and reference specific information from your PDFs directly within your editing environment.
To use this extension, you'll need:
OpenAI
API key (for generating embeddings)uv
installed on your systemgit clone https://github.com/freespirit/pdfsearch-zed.git
cd pdfsearch-zed/pdf_rag
uv venv
uv sync
Install the extension as a Dev Extension in Zed
Build the search database:
cd /path/to/pdfsearch-zed/pdf_rag
# Create a .env file with your OpenAI API key
echo "OPENAI_API_KEY=sk-..." > src/pdf_rag/.env
# Build the search index (may take a few minutes depending on document size)
uv run src/pdf_rag/rag.py build "file1.pdf" "dir1" "file2.md" ...
Note: You can provide multiple files and directories as arguments:
"context_servers": {
"pdfsearch-context-server": {
"settings": {
"extension_path": "/path/to/pdfsearch-zed"
}
}
}
/pdfsearch
followed by your search queryFor example:
/pdfsearch how to implement vector search
This will find the most relevant sections about vector search implementation in your indexed PDFs and make them available to the AI Assistant for reference in its responses.
While primarily designed for PDFs, this extension also supports:
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "pdfsearch-context-server" '{"command":"uv","args":["run","src/pdf_rag/rag.py","serve"],"cwd":"${extensionPath}"}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"pdfsearch-context-server": {
"command": "uv",
"args": [
"run",
"src/pdf_rag/rag.py",
"serve"
],
"cwd": "${extensionPath}"
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"pdfsearch-context-server": {
"command": "uv",
"args": [
"run",
"src/pdf_rag/rag.py",
"serve"
],
"cwd": "${extensionPath}"
}
}
}
3. Restart Claude Desktop for the changes to take effect