Retrieval covers all ten vertical IDs:
education, enterprise_operations, entertainment, fintech, healthcare, healthcare_legal, legal, political, real_estate, and saas_tech.
Private Corpus API
All routes below usehttps://api.writerzroom.com/api and a user API key. Ownership is resolved from that credential; clients cannot supply or override an owner ID.
Upload a document
document_id, the stored chunk count, and scope: private. Text is capped at 500,000 characters per request.
List, inspect, search, and delete
/corpus/ingest, /corpus/ingest/document, /corpus/stats, and /corpus/vertical/{vertical}) are administrator-only and should not be exposed to end users.
Curated Corpus MCP
The MCP process exposes three tools:
The MCP calls corpus search without a user ID. The store then admits only rows whose owner is null. This is the enforced tenant boundary, not a client option.
The service code and deployment configuration are included in the repository, but this documentation does not assert that your environment has deployed it. The following steps are required before first use.
Operator Deployment
The deployment usesDockerfile.corpus-mcp and cloudbuild.corpus-mcp.yaml. It runs separately from the secret-free verification MCP because corpus retrieval needs database and Voyage embedding credentials.
1
Create the dedicated runtime identity
Create
writerzroom-corpus-mcp@agentic-writer.iam.gserviceaccount.com. Do not reuse the main application runtime identity.2
Grant least-privilege secret access
Grant that identity Secret Manager accessor on only
database-url and voyage-api-key. Grant Cloud SQL connectivity only as required by the production database path. Do not grant project-wide Secret Manager access.3
Verify private networking
Confirm the
writerzroom-connector Serverless VPC Access connector exists in us-central1 and can reach the database. The deployment sends only private ranges through it.4
Build and deploy
From the repository root, run
gcloud builds submit --config cloudbuild.corpus-mcp.yaml --project agentic-writer. The configuration keeps the service private with --no-allow-unauthenticated.5
Authorize callers explicitly
Grant
roles/run.invoker on writerzroom-corpus-mcp only to the service accounts that should call it. MCP clients must send a Google-signed identity token whose audience is the deployed Cloud Run service URL.6
Smoke-test the boundary
Call
corpus_capabilities, then list_curated_corpus, then a scoped search. Confirm curated_only: true, includes_private_documents: false, all ten verticals, and no private document titles or counts.Required Owner Actions
- Confirm the dedicated service account exists and its IAM bindings are no broader than documented.
- Confirm
database-urlandvoyage-api-keycontain production-ready values and that the existing 1,536-dimension corpus index remains compatible withvoyage-large-2. - Confirm the VPC connector and database route from Cloud Run.
- Choose and authorize each MCP caller identity; the service must remain private.
- Deploy and perform the curated-only boundary smoke test before advertising the MCP as available.
Source Quality
Understand scoring, citations, and the limits of retrieval.
API Authentication
Create and protect user API keys for private corpus access.