proposal-generator-mcp
# Proposal Generator MCP Server
Autonomous proposal-generation server for Claude Desktop. Reads your
company's templates, service profile, and rate card from Google Drive,
and produces a fully branded, chart-and-table-rich .docx proposal — with
zero manual formatting.
## 1. Install dependencies
```bash
cd proposal-mcp-server
python3 -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
pip install -e .
```
## 2. Create the Google Service Account (one-time, ~5 min)
1. Go to console.cloud.google.com → create/select a project.
2. Enable the **Google Drive API** (APIs & Services → Library → search "Drive API" → Enable).
3. APIs & Services → Credentials → Create Credentials → **Service Account**.
4. Give it a name (e.g. `proposal-bot`) → Create → Done (no roles needed at project level).
5. Click the new service account → Keys tab → Add Key → **JSON** → downloads a file.
6. Rename it `service_account.json` and place it in `proposal-mcp-server/secrets/`.
7. Note the service account's email — looks like:
`proposal-bot@your-project.iam.gserviceaccount.com`
## 3. Share your 3 Drive folders with the service account
In Google Drive, right-click each of **Template**, **Resources**, **Output**
→ Share → paste the service account email → give **Editor** access (Output
needs write access; Template/Resources only need Viewer, but Editor is
simplest). This is the *only* manual Drive step — no OAuth login needed
after this.
## 4. Configure environment
```bash
cp .env.example .env
```
Fill in `TEMPLATE_FOLDER_ID`, `RESOURCES_FOLDER_ID`, `OUTPUT_FOLDER_ID`
(the string in each folder's URL after `/folders/`).
Confirm/rename your Resources files to match `COMPANY_PROFILE_FILENAME`
and `RATE_CARD_FILENAME` in `.env` (or just edit those variables to match
your actual filenames).
## 5. Register the server with Claude Desktop
Edit your Claude Desktop config file:
- macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
- Windows: `%APPDATA%\Claude\claude_desktop_config.json`
```json
{
"mcpServers": {
"proposal-generator": {
"command": "/absolute/path/to/proposal-mcp-server/venv/bin/python",
"args": ["-m", "proposal_mcp.server"],
"cwd": "/absolute/path/to/proposal-mcp-server/src",
"env": {
"SERVICE_ACCOUNT_FILE": "/absolute/path/to/proposal-mcp-server/secrets/service_account.json",
"TEMPLATE_FOLDER_ID": "...",
"RESOURCES_FOLDER_ID": "...",
"OUTPUT_FOLDER_ID": "..."
}
}
}
}
```
Restart Claude Desktop. You should see "proposal-generator" listed under
the 🔌 connectors/tools icon.
## 6. Use it
Just ask, in a fresh chat:
> Make a proposal for XYZ Bank who wants to switch to cloud technology. Country: India.
Claude will, on its own:
1. Call `get_mandatory_sections` to see what's required.
2. Call `get_company_profile` to ground the content in real capabilities.
3. Confirm the proposed company's country from the brief or trusted company
research, then call `resolve_rate_card_country(country)`.
4. Call `get_rate_card(country, [...])` for the relevant roles only. The
response includes the exact selected tab and currency; if the workbook has
no country tab, it clearly reports the Constants/USD day-rate fallback.
5. Draft each of the 9 sections (with real tables/bullets/charts and a concise technical workflow).
6. Call `generate_proposal(...)` once, which renders the branded .docx
and uploads it to your Output folder — returning a Drive link.
## Adding new templates later
Upload a new `.docx` (e.g. `template_rfp.docx`) into the Template folder,
and add an entry to `template_registry.json` (see
`assets/template_registry.example.json`) in that same folder, e.g.:
```json
{ "default": "template.docx", "rfp": "template_rfp.docx" }
```
Claude can then call `list_templates()` and pass `template_id: "rfp"`.
## Project layout
```
src/proposal_mcp/
config.py # env config + the 9 mandatory sections (hardcoded)
drive_client.py # Google Drive service-account wrapper
cache.py # TTL cache to avoid redundant Drive downloads
rate_card.py # multi-sheet (per-country) rate card parser
company_profile.py # extracts condensed text from services doc
charts.py # bar / pie / gantt chart and workflow-diagram PNG generation
proposal_sections.py # Pydantic schema Claude's content must follow
docx_generator.py # merges content into the branded template
server.py # MCP tool definitions (the public API)
```
## Token-efficiency notes
- Every tool returns only the specific data requested (filtered rate rows,
a condensed profile) — never a whole file's raw bytes/rows.
- Chart/table/document rendering happens entirely in Python; Claude never
needs to reason about layout, XML, or image encoding.
- Rate-card selection is exact or an explicit country alias (for example,
`United Kingdom` → `UK`); it never uses a risky substring match. Countries
without a dedicated table automatically use the Constants sheet's USD base
day rates and are labelled as such in the result.
- Rate card / profile downloads are cached for `CACHE_TTL_SECONDS`, so
generating several proposals in one session doesn't re-hit Drive each time.
- `generate_proposal` is a single call — Claude doesn't need multiple
round-trips to assemble the document piece by piece.
TDQS
Scored across 9 tools
Each tool has a clearly distinct purpose: retrieving mandatory sections, listing templates, fetching company profile, querying rate cards, verifying countries, creating/validating project rate cards, and generating the final proposal. Even the three rate-card-related tools are well separated: get_rate_card fetches rates, list_rate_card_countries enumerates available countries, and resolve_rate_card_country previews selection. No two tools overlap in function.
All tool names follow a consistent snake_case verb_noun pattern with clear verbs (get, list, resolve, create, validate_and_reload, generate). Rate-card tools share the descriptive 'rate_card' suffix, and the overall naming is predictable and scannable. Deviations are none—even the longer validate_and_reload_project_rate_card is internally consistent.
With 9 tools, the server is well-scoped for its purpose of generating branded proposals. Each tool earns its place in a logical pipeline—from fetching requirements to creating and validating a project-specific rate card to producing the final document. The count is within the ideal 3-15 range and neither feels sparse nor bloated.
The tool surface covers the full proposal-generation lifecycle: mandatory section structure, template selection, company profile retrieval, rate card lookup and creation, validation, and final generation. There are no obvious dead ends—every step required to produce a proposal is supported, and the workflow is clearly documented via tool descriptions and stage markers.