Provides semantic search capabilities over a Pinecone vector database containing economic books and academic papers, enabling natural language queries and metadata filtering
Pinecone Economic Books MCP Server
A Model Context Protocol (MCP) server that provides read-only access to a Pinecone vector database containing economic books and academic papers.
Primary Feature: Natural language semantic search powered by Pinecone's inference API - just ask in plain English and get relevant results automatically.
The server also provides specialized metadata search tools for precise filtering by author, subject, book, page range, and more.
Features
10 Comprehensive Search Tools
All search tools use semantic search powered by Pinecone inference API
Primary Search Tools
semantic_search - Natural language search (DEFAULT/SIMPLEST)
Automatically embeds your query using Pinecone inference
Best for: "theories about market equilibrium", "impact of automation"
semantic_search_with_filters - Semantic search + metadata filters
Combine natural language with precise filtering
Best for: "labor productivity" in books by "Wassily Leontief"
Filtered Semantic Search
All tools below combine semantic search with metadata filtering:
search_by_author - Semantic search within a specific author's works
search_by_subject - Semantic search within content tagged with specific topics
search_by_book - Semantic search within a specific book
search_by_page_range - Semantic search within specific page ranges
advanced_search - Semantic search with multiple filters (author + book + subjects + pages)
Utility Tools
get_by_id - Retrieve a specific document by its ID
get_index_stats - Get statistics about the Pinecone index
vector_search - Search using pre-computed embedding vectors (advanced)
Data Schema
Each document in the database contains:
Installation
Prerequisites
Python 3.10 or higher
Pinecone account with an existing index
MCP-compatible client (e.g., Claude Desktop, Claude Code)
Setup
Clone or create the project directory:
Install dependencies:
Configure environment variables:
Copy .env.example
to .env
and fill in your credentials:
Edit .env
:
Configure MCP client:
Add to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json
on macOS):
Or for Claude Code (~/.claude.json
):
Note: This server requires Python 3.10+. If your python3.10 is in a different location, use which python3.10
to find it.
Usage Examples
Semantic Search (Recommended - Default)
Basic Semantic Search
Semantic Search with Author Filter
Semantic Search with Multiple Filters
Filtered Semantic Search
All specialized search tools use semantic search combined with metadata filtering.
Search by Author
Search by Subject
Search by Book
Advanced Search
Search by Page Range
Get Document by ID
Vector Search
Get Index Statistics
Tool Details
Semantic Search by Default
All search tools use semantic search powered by Pinecone's integrated inference. Simply pass your text query and Pinecone automatically converts it to embeddings - no manual embedding calls needed. This provides seamless semantic search without the complexity of managing embedding models.
Read-Only Operations
All tools are read-only - they only query and retrieve data from Pinecone. No write, update, or delete operations are exposed.
Metadata Filtering
The server combines semantic search with Pinecone's metadata filtering capabilities using MongoDB-style query operators:
$eq
- Equals$in
- In array$and
- Logical AND
Result Limits
Default
top_k
: Varies by tool (5-10)Maximum
top_k
: 100 results per query
Namespaces
All tools support optional namespace
parameter for multi-tenant Pinecone indexes.
Architecture
Technology Stack
FastMCP: Official Python SDK for MCP servers
Pinecone: Vector database for semantic search
python-dotenv: Environment variable management
Components
server.py
- Main MCP server implementationrequirements.txt
- Python dependencies.env
- Configuration (not committed).env.example
- Configuration template
Development
Project Structure
Adding New Tools
To add a new search tool:
Define a new function with the
@mcp.tool()
decoratorAdd comprehensive docstring (used for tool schema)
Use type hints for all parameters
Return string-formatted results
Handle errors gracefully
Example:
Troubleshooting
Common Issues
"API key not found"
Ensure
.env
file exists and contains validPINECONE_API_KEY
Check that
load_dotenv()
is being called
"Index not found"
Verify
PINECONE_INDEX_NAME
matches your Pinecone index nameCheck Pinecone dashboard to confirm index exists
"No results returned"
Verify data exists in your Pinecone index
Check metadata field names match your data schema
Try using
get_index_stats()
to verify index has vectors
"Module not found"
Run
pip install -r requirements.txt
Ensure you're using Python 3.10+
Debug Mode
Run the server directly to see debug output:
Security Notes
API Keys: Never commit
.env
file to version controlRead-Only: Server only performs read operations
No Authentication: Add authentication if exposing externally
Rate Limiting: Consider implementing rate limits for production use
Resources
License
MIT License - feel free to modify and use as needed.
Contributing
Contributions are welcome! Please:
Fork the repository
Create a feature branch
Add tests if applicable
Submit a pull request
Changelog
v1.0.0 (2025-01-12)
Initial release
10 comprehensive search tools, all using semantic search
Semantic search via Pinecone integrated inference (pass text directly, no manual embedding)
Simplified API -
index.search(query="text")
for all searchesRead-only access to Pinecone economic books database
Advanced metadata filtering combined with semantic search
MCP server implementation with FastMCP
This server cannot be installed
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Enables semantic search through a Pinecone vector database containing economic books and academic papers using natural language queries. Provides 10 specialized search tools with metadata filtering for precise discovery of economic theories, concepts, and research by author, subject, or book.