A Model Context Protocol (MCP) server that provides semantic search over Pinecone vector databases using hybrid search (dense + sparse) with reranking.
Project description
Pinecone Read-Only MCP
A Model Context Protocol (MCP) server that provides semantic search over Pinecone vector databases using hybrid search (dense + sparse) with reranking.
Features
- Hybrid Search: Combines dense and sparse embeddings for superior recall
- Semantic Reranking: Uses BGE reranker model for improved precision
- Dynamic Namespace Discovery: Automatically discovers available namespaces in your Pinecone index
- Metadata Filtering: Supports optional metadata filters for refined searches
- Fast & Optimized: Lazy initialization, connection pooling, and efficient result merging
- Production Ready: Input validation, error handling, and configurable logging
Installation
In a uv managed python project, add to dependencies by:
uv add pinecone-read-only-mcp
Alternatively, for projects using pip for dependencies:
pip install pinecone-read-only-mcp
To run the server inside your project:
uv run pinecone-read-only-mcp --api-key YOUR_PINECONE_API_KEY
Or to run it globally in isolated environment:
uvx pinecone-read-only-mcp --api-key YOUR_PINECONE_API_KEY
To install directly from the source:
git clone https://github.com/iTinkerBell/pinecone-read-only-mcp.git
cd pinecone-read-only-mcp
pip install -e .
Configuration
The server requires a Pinecone API key and supports the following configuration options:
Environment Variables
| Variable | Required | Default | Description |
|---|---|---|---|
PINECONE_API_KEY |
Yes | - | Your Pinecone API key |
PINECONE_INDEX_NAME |
No | rag-hybrid |
Pinecone index name |
PINECONE_RERANK_MODEL |
No | bge-reranker-v2-m3 |
Reranking model |
PINECONE_READ_ONLY_MCP_LOG_LEVEL |
No | INFO |
Logging level |
Claude Desktop Configuration
Add to your claude_desktop_config.json:
{
"mcpServers": {
"pinecone-search": {
"command": "uvx",
"args": ["pinecone-read-only-mcp"],
"env": {
"PINECONE_API_KEY": "your-api-key-here"
}
}
}
}
Or with explicit options:
{
"mcpServers": {
"pinecone-search": {
"command": "uvx",
"args": [
"pinecone-read-only-mcp",
"--api-key", "your-api-key-here",
"--index-name", "your-index-name",
"--rerank-model", "bge-reranker-v2-m3"
]
}
}
}
Usage
Command Line
The server can be run in two modes:
Standard I/O mode (default):
pinecone-read-only-mcp --api-key YOUR_API_KEY
SSE transport mode (for web applications):
pinecone-read-only-mcp --api-key YOUR_API_KEY --transport sse --port 8000
Available Options
--api-key TEXT Pinecone API key (or set PINECONE_API_KEY env var)
--index-name TEXT Pinecone index name [default: rag-hybrid]
--rerank-model TEXT Reranking model [default: bge-reranker-v2-m3]
--transport [stdio|sse] Transport type [default: stdio]
--port INTEGER Port for SSE transport [default: 8000]
--log-level [DEBUG|INFO|WARNING|ERROR|CRITICAL] Logging level [default: INFO]
API Documentation
The server exposes the following tools via MCP:
list_namespaces
Discovers and lists all available namespaces in the configured Pinecone index.
Parameters: None
Returns: JSON object with available namespaces and count
Example response:
{
"status": "success",
"namespaces": ["namespace1", "namespace2", "namespace3"],
"count": 3
}
query
Performs hybrid semantic search over the specified namespace in the Pinecone index.
Parameters:
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
query_text |
string | Yes | - | Search query text |
namespace |
string | Yes | - | Namespace to search (use list_namespaces to discover) |
top_k |
integer | No | 10 |
Number of results (1-100) |
use_reranking |
boolean | No | true |
Enable semantic reranking |
Returns: JSON object with search results including content, relevance scores, and metadata
Example response:
{
"status": "success",
"query": "your search query",
"namespace": "namespace1",
"result_count": 10,
"results": [
{
"paper_number": "DOC-001",
"title": "Document Title",
"author": "Author Name",
"url": "https://example.com/doc",
"content": "Document content preview...",
"score": 0.9234,
"reranked": true
}
]
}
How It Works
- Namespace Discovery: The
list_namespacestool queries your Pinecone index stats to discover available namespaces - Hybrid Search: When querying, the tool searches both dense and sparse indexes in parallel
- Result Merging: Results from both indexes are merged and deduplicated
- Reranking (optional): The merged results are reranked using a semantic reranker for improved relevance
Dependencies
- anyio (>=4.5.0)
- click (>=8.1.8)
- mcp (>=1.6.0)
- pinecone (>=5.0.0)
- python-dotenv (>=1.0.0)
- pydantic (>=2.0.0)
Development
Setup Development Environment
git clone https://github.com/iTinkerBell/pinecone-read-only-mcp.git
cd pinecone-read-only-mcp
uv venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
uv pip install -e ".[dev]"
Code Quality
# Run linting
uv run ruff check .
# Run formatting check
uv run ruff format --check .
# Run security checks
uv run bandit -r src/
Contribution Guidelines
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Commit your changes:
git commit -am 'Add some feature' - Push to the branch:
git push origin feature-name - Submit a pull request
License
This project is licensed under the Boost Software License 1.0 - see the LICENSE file for details.
Authors
- Will Pak - cppalliance.org
Acknowledgements
This project uses Pinecone for vector storage and retrieval. The hybrid search approach combines dense embeddings with sparse BM25-style retrieval for optimal results.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pinecone_read_only_mcp-0.1.0.tar.gz.
File metadata
- Download URL: pinecone_read_only_mcp-0.1.0.tar.gz
- Upload date:
- Size: 100.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6297fe1ee0e342c365e9635dd6a004a2a1307bdc4fbe5099d2f966d14ba98615
|
|
| MD5 |
66696ed0a1a983c360dc13ab258c2dab
|
|
| BLAKE2b-256 |
17a5827bf9b18305e09889843cd0e81f42a2cecbd299b206b3fb4278b5de027f
|
Provenance
The following attestation bundles were made for pinecone_read_only_mcp-0.1.0.tar.gz:
Publisher:
publish-pypi.yml on iTinkerBell/pinecone-read-only-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pinecone_read_only_mcp-0.1.0.tar.gz -
Subject digest:
6297fe1ee0e342c365e9635dd6a004a2a1307bdc4fbe5099d2f966d14ba98615 - Sigstore transparency entry: 855393961
- Sigstore integration time:
-
Permalink:
iTinkerBell/pinecone-read-only-mcp@46ab37fa90254bd3dc220ea566ec2119a963ff2a -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/iTinkerBell
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@46ab37fa90254bd3dc220ea566ec2119a963ff2a -
Trigger Event:
release
-
Statement type:
File details
Details for the file pinecone_read_only_mcp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: pinecone_read_only_mcp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 11.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
72aa4bde89e25e68361c5bde0a55449b58b9b1a0ebe7f8ee5109b143ca810d57
|
|
| MD5 |
3c132e1c31336b323c50ab77644cde71
|
|
| BLAKE2b-256 |
d3109bbf353aecccbca4c6dbb7c06fc1c5545351c4d18e129c8139ee3e765504
|
Provenance
The following attestation bundles were made for pinecone_read_only_mcp-0.1.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on iTinkerBell/pinecone-read-only-mcp
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pinecone_read_only_mcp-0.1.0-py3-none-any.whl -
Subject digest:
72aa4bde89e25e68361c5bde0a55449b58b9b1a0ebe7f8ee5109b143ca810d57 - Sigstore transparency entry: 855393982
- Sigstore integration time:
-
Permalink:
iTinkerBell/pinecone-read-only-mcp@46ab37fa90254bd3dc220ea566ec2119a963ff2a -
Branch / Tag:
refs/tags/0.1.0 - Owner: https://github.com/iTinkerBell
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@46ab37fa90254bd3dc220ea566ec2119a963ff2a -
Trigger Event:
release
-
Statement type: