Skip to content

Commit d268bac

Browse files
author
zho
committed
addressed review-library.md
1 parent 4f3b1db commit d268bac

26 files changed

Lines changed: 1089 additions & 252 deletions

.env.example

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,22 @@ PINECONE_RERANK_MODEL=bge-reranker-v2-m3
1313
PINECONE_TOP_K=10
1414

1515
# Optional: Logging level (default: INFO)
16-
# Options: DEBUG, INFO, WARNING, ERROR, CRITICAL
16+
# Options: DEBUG, INFO, WARN, ERROR
1717
PINECONE_READ_ONLY_MCP_LOG_LEVEL=INFO
18+
19+
# Optional: Logging format (default: text)
20+
# Options: text, json
21+
PINECONE_READ_ONLY_MCP_LOG_FORMAT=text
22+
23+
# Optional: Sparse index name (default: ${PINECONE_INDEX_NAME}-sparse)
24+
# PINECONE_SPARSE_INDEX_NAME=rag-hybrid-sparse
25+
26+
# Optional: Namespace + suggestion-flow cache TTL in seconds (default: 1800 = 30min)
27+
# PINECONE_CACHE_TTL_SECONDS=1800
28+
29+
# Optional: Disable the suggest_query_params flow gate (default: false).
30+
# WARNING: turning this on bypasses the safety guard. A WARN log fires at startup.
31+
# PINECONE_DISABLE_SUGGEST_FLOW=false
32+
33+
# Optional: Request timeout for Pinecone calls, in milliseconds (default: 15000)
34+
# PINECONE_REQUEST_TIMEOUT_MS=15000

.github/dependabot.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,21 @@ updates:
1010
labels:
1111
- "dependencies"
1212
- "automated"
13+
groups:
14+
vitest:
15+
patterns:
16+
- "vitest"
17+
- "@vitest/*"
18+
typescript-eslint:
19+
patterns:
20+
- "typescript-eslint"
21+
- "@typescript-eslint/*"
22+
eslint-prettier:
23+
patterns:
24+
- "eslint"
25+
- "@eslint/*"
26+
- "prettier"
27+
- "eslint-config-prettier"
1328

1429
- package-ecosystem: "github-actions"
1530
directory: "/"

.github/workflows/ci.yml

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@ on:
55
branches: [main]
66
push:
77
branches: [main]
8-
workflow_call: # Allow this workflow to be called by other workflows
8+
workflow_call:
99

1010
jobs:
1111
build-and-test:
12-
runs-on: ubuntu-latest
12+
runs-on: ${{ matrix.os }}
1313
strategy:
14+
fail-fast: false
1415
matrix:
16+
os: [ubuntu-latest, windows-latest, macos-latest]
1517
node-version: [18.x, 20.x, 22.x]
1618

1719
steps:
@@ -41,9 +43,32 @@ jobs:
4143
- name: Smoke test CLI
4244
run: node dist/index.js --help
4345

44-
- name: Run tests
46+
- name: Run tests with coverage
47+
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '20.x'
48+
run: npm run test:coverage
49+
50+
- name: Run tests (no coverage)
51+
if: "!(matrix.os == 'ubuntu-latest' && matrix.node-version == '20.x')"
4552
run: npm test
4653

54+
- name: Generate CycloneDX SBOM (lockfile-based)
55+
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '20.x'
56+
run: npx --yes @cyclonedx/cyclonedx-npm --package-lock-only --output-file sbom.cdx.json
57+
58+
- name: Upload SBOM artifact
59+
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '20.x'
60+
uses: actions/upload-artifact@v4
61+
with:
62+
name: sbom-cyclonedx
63+
path: sbom.cdx.json
64+
65+
- name: Upload coverage to Codecov
66+
if: matrix.os == 'ubuntu-latest' && matrix.node-version == '20.x'
67+
uses: codecov/codecov-action@v5
68+
with:
69+
files: ./coverage/lcov.info
70+
fail_ci_if_error: false
71+
4772
quality:
4873
runs-on: ubuntu-latest
4974
steps:

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ node_modules/
3232
.vscode/
3333
.idea/
3434
dist/
35+
docs/
3536

3637
# Testing
3738
coverage/

CHANGELOG.md

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,38 +4,43 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
Future releases are managed automatically by [release-please](https://github.com/googleapis/release-please).
78

89
## [Unreleased]
910

1011
### Added
1112

12-
- `list_namespaces` tool: discovers all namespaces with record counts and sampled metadata fields
13-
- `namespace_router` tool: ranks namespaces by relevance to a natural-language query
14-
- `suggest_query_params` tool: mandatory flow gate that recommends fields and tool variant before queries
15-
- `count` tool: counts unique documents matching a query, with `truncated` flag when results exceed `COUNT_TOP_K`
16-
- `query_fast` tool: lightweight chunk-level search with minimal field set
17-
- `query_detailed` tool: chunk-level search with optional semantic reranking
18-
- `query` tool: unified query entry-point supporting `query_fast` and `query_detailed` modes
19-
- `guided_query` tool: single-call orchestrator that runs routing → suggestion → execution, returning a `decision_trace`
20-
- `generate_urls` tool: synthesizes URLs for records whose metadata lacks a `url` field
21-
- `query_documents` tool: reassembles full documents from chunks grouped by document identifier
22-
- Centralized structured logger (`src/logger.ts`) with level-gated stderr output and stack-trace capture
23-
- Dockerfile for containerised deployment
24-
- `About.md` project documentation covering architecture, tools, and operating principles
13+
- `SERVER_VERSION` is now read from `package.json` at runtime so MCP `serverInfo` always matches the published package version.
14+
- `--version` CLI flag prints the package version and exits.
15+
- `list_namespaces` response now includes `expires_at_iso` so clients see the cache expiry as an ISO-8601 timestamp without converting `cache_ttl_seconds`.
16+
- `docs/` handbook: `TOOLS.md`, `CONFIGURATION.md`, `FAQ.md`, `MIGRATION.md`, `CI_CD.md`, and `docs/README.md` index; root `RELEASING.md` stub points to `docs/RELEASING.md`.
17+
- `SECURITY.md`, `CONTRIBUTING.md`, and `CODE_OF_CONDUCT.md` for OSS hygiene.
18+
- `examples/README.md` describing the library embedding sample.
19+
- GitHub Actions: **multi-OS** CI matrix (Ubuntu, Windows, macOS × Node 18/20/22), **Codecov** upload (Ubuntu + Node 20), **CycloneDX SBOM** artifact, **Release Please**, and **Docker** multi-arch publish to **GHCR**.
20+
- `src/config.test.ts` and `npm run test:coverage` with Vitest coverage thresholds (see `vitest.config.ts`).
21+
- `@vitest/coverage-v8` devDependency for coverage reports (`lcov`, `json-summary`, HTML).
2522

2623
### Changed
2724

28-
- Modularised server into focused files under `src/server/` (tools, caches, formatters, suggestion flow)
29-
- CI workflow updated: multi-node matrix (`18.x`, `20.x`, `22.x`), separate quality job with `continue-on-error`
30-
- Replaced all `console.error` calls in `pinecone-client.ts` with typed `logInfo` / `logDebug` / `logError`
25+
- `.env.example` log-level options corrected to the four levels actually supported (`DEBUG`, `INFO`, `WARN`, `ERROR`); the stale `WARNING`/`CRITICAL` values are gone.
26+
- README Slack URL example now matches the generator output (`https://app.slack.com/client/{team_id}/{channel_id}/p{messageId}`).
27+
- README "Comparison with Python Version" no longer claims an identical API interface; the new TypeScript-only tools (`guided_query`, `query_documents`, `keyword_search`, `namespace_router`, `suggest_query_params`, `count`, `generate_urls`) are listed explicitly.
28+
- `npm run ci` now runs `test:coverage` so merges are gated on coverage thresholds.
29+
- Dependabot groups related **vitest**, **typescript-eslint**, and **eslint/prettier** updates.
3130

32-
### Fixed
3331

34-
- Timestamp-based metadata filter now correctly handles numeric epoch values
32+
### Removed
33+
34+
- Dead `test:mcp` npm script (referenced a `test-mcp-server.js` file that has never existed).
3535

36-
### Security
36+
## [0.1.6] - 2026-04-24
3737

38-
- N/A
38+
Historical 0.1.x releases (0.1.0 → 0.1.6) shipped the full tool surface
39+
(`list_namespaces`, `namespace_router`, `suggest_query_params`, `count`,
40+
`query`, `query_fast`, `query_detailed`, `keyword_search`, `query_documents`,
41+
`guided_query`, `generate_urls`), the structured `src/logger.ts`, the
42+
`Dockerfile`, and the modularised `src/server/` layout. See git history for
43+
details — going forward, all changes are tracked here by release-please.
3944

4045
## [0.1.1] - 2026-01-27
4146

@@ -69,6 +74,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6974
- Environment variable support
7075
- Full documentation and examples
7176

72-
[Unreleased]: https://github.com/CppDigest/pinecone-read-only-mcp-typescript/compare/v0.1.1...HEAD
77+
[Unreleased]: https://github.com/CppDigest/pinecone-read-only-mcp-typescript/compare/v0.1.6...HEAD
78+
[0.1.6]: https://github.com/CppDigest/pinecone-read-only-mcp-typescript/compare/v0.1.1...v0.1.6
7379
[0.1.1]: https://github.com/CppDigest/pinecone-read-only-mcp-typescript/compare/v0.1.0...v0.1.1
7480
[0.1.0]: https://github.com/CppDigest/pinecone-read-only-mcp-typescript/releases/tag/v0.1.0

README.md

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,20 @@
77

88
A Model Context Protocol (MCP) server that provides semantic search over Pinecone vector databases using hybrid search (dense + sparse) with reranking.
99

10+
## Documentation
11+
12+
| Doc | Description |
13+
|-----|---------------|
14+
| [docs/README.md](docs/README.md) | Index of all guides |
15+
| [docs/TOOLS.md](docs/TOOLS.md) | Tool catalog & flows |
16+
| [docs/CONFIGURATION.md](docs/CONFIGURATION.md) | Env vars, CLI flags, library config |
17+
| [docs/FAQ.md](docs/FAQ.md) | Common questions |
18+
| [docs/MIGRATION.md](docs/MIGRATION.md) | Deprecations & breaking changes |
19+
| [docs/CI_CD.md](docs/CI_CD.md) | GitHub Actions, SBOM, Docker, releases |
20+
| [RELEASING.md](RELEASING.md) | Pointer to the full release guide in `docs/` |
21+
| [CONTRIBUTING.md](CONTRIBUTING.md) | How to contribute |
22+
| [SECURITY.md](SECURITY.md) | Vulnerability reporting |
23+
1024
## Features
1125

1226
- **Hybrid Search**: Combines dense and sparse embeddings for superior recall
@@ -54,16 +68,19 @@ npm run build
5468

5569
## Configuration
5670

57-
The server requires a Pinecone API key and supports the following configuration options:
71+
You need a **Pinecone API key** and (by default) a **dense** index plus matching **sparse** index; see [docs/CONFIGURATION.md](docs/CONFIGURATION.md) for every environment variable and CLI flag.
72+
73+
Quick reference:
5874

59-
### Environment Variables
75+
| Variable | Required | Default |
76+
| -------- | -------- | ------- |
77+
| `PINECONE_API_KEY` | Yes (for live Pinecone) ||
78+
| `PINECONE_INDEX_NAME` | No | `rag-hybrid` |
79+
| `PINECONE_SPARSE_INDEX_NAME` | No | `{index}-sparse` |
80+
| `PINECONE_READ_ONLY_MCP_LOG_LEVEL` | No | `INFO` (`DEBUG``ERROR`) |
81+
| `PINECONE_READ_ONLY_MCP_LOG_FORMAT` | No | `text` (`json` for log pipelines) |
6082

61-
| Variable | Required | Default | Description |
62-
| ---------------------------------- | -------- | ---------------------- | ------------------------------------------------ |
63-
| `PINECONE_API_KEY` | Yes | - | Your Pinecone API key |
64-
| `PINECONE_INDEX_NAME` | No | `rag-hybrid` | Pinecone index name (dense + sparse for hybrid) |
65-
| `PINECONE_RERANK_MODEL` | No | `bge-reranker-v2-m3` | Reranking model |
66-
| `PINECONE_READ_ONLY_MCP_LOG_LEVEL` | No | `INFO` | Logging level |
83+
Run `pinecone-read-only-mcp --help` for CLI equivalents (`--cache-ttl-seconds`, `--request-timeout-ms`, `--disable-suggest-flow`, etc.).
6784

6885
### Claude Desktop Configuration
6986

@@ -301,7 +318,7 @@ Rules:
301318
Format: `https://lists.boost.org/archives/list/{doc_id_or_thread_id}/`
302319
- **`slack-Cpplang`**: prefer `source` directly if present; otherwise use `team_id`, `channel_id`, and `doc_id`
303320
`message_id = doc_id.replace('.', '')`
304-
Format: `https://app.slack.com/{team_id}/{channel_id}/p{message_id}`
321+
Format: `https://app.slack.com/client/{team_id}/{channel_id}/p{message_id}`
305322

306323
**Parameters:**
307324

@@ -577,13 +594,20 @@ npm run dev -- --api-key YOUR_API_KEY
577594

578595
## Comparison with Python Version
579596

580-
This TypeScript implementation provides the same functionality as the [Python version](https://github.com/CppDigest/pinecone-read-only-mcp) with the following benefits:
597+
This TypeScript implementation grew out of the [Python version](https://github.com/CppDigest/pinecone-read-only-mcp) and now exposes a strict superset of its tool surface, including:
598+
599+
- `guided_query` (single-call orchestrator with decision trace)
600+
- `query_documents` (full-document reassembly from chunks)
601+
- `keyword_search` (sparse-index-only retrieval)
602+
- `namespace_router` and `suggest_query_params` (flow guidance)
603+
- `count` and `generate_urls`
604+
605+
Other benefits:
581606

582607
- Native Node.js integration
583608
- Better npm ecosystem integration
584609
- TypeScript type safety
585610
- Similar performance characteristics
586-
- Same API interface
587611

588612
## Troubleshooting
589613

0 commit comments

Comments
 (0)