Skip to main content
Glama

Proposal Generator MCP Server

面向 Claude Desktop 的自主提案生成服务器。从 Google Drive 读取你公司的模板、服务简介和费率表,生成完全品牌化、图表和表格丰富的 .docx 提案——零手动排版。

1. 安装依赖

cd proposal-mcp-server
python3 -m venv venv
source venv/bin/activate        # Windows: venv\Scripts\activate
pip install -e .

Related MCP server: MCP Dataset Onboarding Server

2. 创建 Google 服务账号(一次性,约 5 分钟)

  1. 前往 console.cloud.google.com → 创建/选择一个项目。

  2. 启用 Google Drive API(APIs & Services → Library → 搜索 "Drive API" → Enable)。

  3. APIs & Services → Credentials → Create Credentials → Service Account。

  4. 给它一个名称(例如 proposal-bot)→ Create → Done(项目级别无需任何角色)。

  5. 点击新的服务账号 → Keys 标签页 → Add Key → JSON → 下载一个文件。

  6. 将其重命名为 service_account.json 并放入 proposal-mcp-server/secrets/。

  7. 记下服务账号的邮箱——形如: proposal-bot@your-project.iam.gserviceaccount.com

3. 与服务账号共享你的 3 个 Drive 文件夹

在 Google Drive 中,右键点击 Template、Resources、Output 中的每一个 → Share → 粘贴服务账号邮箱 → 授予 Editor 权限(Output 需要写入权限;Template/Resources 只需要 Viewer,但 Editor 最简单)。这是唯一的手动 Drive 步骤——此后无需 OAuth 登录。

4. 配置环境

cp .env.example .env

填写 TEMPLATE_FOLDER_ID、RESOURCES_FOLDER_ID、OUTPUT_FOLDER_ID(每个文件夹 URL 中 /folders/ 后面的字符串)。

确认/重命名你的 Resources 文件,使其与 .env 中的 COMPANY_PROFILE_FILENAME 和 RATE_CARD_FILENAME 匹配(或者直接编辑这些变量以匹配你的实际文件名)。

5. 向 Claude Desktop 注册服务器

编辑你的 Claude Desktop 配置文件:

  • macOS:~/Library/Application Support/Claude/claude_desktop_config.json

  • Windows:%APPDATA%\Claude\claude_desktop_config.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": "..."
      }
    }
  }
}

重启 Claude Desktop。你应该会在 🔌 连接器/工具图标下看到 "proposal-generator"。

6. 使用

只需在新会话中提问:

为想要迁移到云技术的 XYZ Bank 制作一份提案。国家:印度。

Claude 将自主完成以下操作:

  1. 调用 get_mandatory_sections 查看必需内容。

  2. 调用 get_company_profile 将内容建立在真实能力之上。

  3. 根据简报或可信的公司调研确认提案公司的国家,然后调用 resolve_rate_card_country(country)。

  4. 仅针对相关角色调用 get_rate_card(country, [...])。响应包含精确选中的标签页和货币;如果工作簿没有国家标签页,它会明确报告 Constants/USD 日费率回退。

  5. 起草全部 9 个章节(包含真实的表格/项目符号/图表和简洁的技术工作流)。

  6. 一次性调用 generate_proposal(...),渲染品牌化的 .docx 并上传到你的 Output 文件夹——返回一个 Drive 链接。

之后添加新模板

将新的 .docx(例如 template_rfp.docx)上传到 Template 文件夹,并在同一文件夹中的 template_registry.json(参见 assets/template_registry.example.json)中添加一个条目,例如:

{ "default": "template.docx", "rfp": "template_rfp.docx" }

然后 Claude 可以调用 list_templates() 并传入 template_id: "rfp"。

项目结构

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 效率说明

  • 每个工具只返回所请求的特定数据(过滤后的费率行、精简简介)——绝不返回整个文件的原始字节/行。

  • 图表/表格/文档渲染完全在 Python 中完成;Claude 无需处理布局、XML 或图像编码。

  • 费率表选择是精确匹配或显式国家别名(例如 United Kingdom → UK);绝不使用有风险的子字符串匹配。没有专用表格的国家自动使用 Constants 工作表的 USD 基础日费率,并在结果中如此标注。

  • 费率表/简介下载会缓存 CACHE_TTL_SECONDS 秒,因此在一个会话中生成多份提案不会每次都重新访问 Drive。

  • generate_proposal 是单次调用——Claude 无需多次往返来逐块组装文档。

Available Tools

9 tools
create_project_rate_cardA

STAGE 1: Create a project-specific rate card from the master rate card.

This tool MUST be called BEFORE generate_proposal. It:

  1. Reads the master/company rate card for the specified country

  2. Analyzes the project requirements and required roles

  3. Creates a new 5-sheet workbook (Rate Card, Effort Model, Milestones, Retainer, Assumptions)

  4. Validates the workbook for internal consistency

  5. Saves it locally and uploads to the Output Drive folder

Args: client_name: Client company name (e.g., "ABC Company") project_name: Project name (e.g., "Cloud Transformation") country: Project country (e.g., "Nepal", "United Kingdom") project_scope: Brief description of project scope and requirements timeline_months: Project duration in months budget: Budget indication (e.g., "NPR 25,00,000" or "GBP 150,000") required_roles: List of dicts with keys: role, discipline, seniority, estimated_days Example: [ {"role": "Backend Engineer", "discipline": "Backend Developer", "seniority": "Senior", "estimated_days": 60}, {"role": "Frontend Engineer", "discipline": "Frontend Developer", "seniority": "Mid Senior", "estimated_days": 45}, ]

Returns JSON with the local path, Drive link, and validation status. The generated rate card becomes the authoritative source for all proposal costing.

Inputs: budget (required), country (required), client_name (required), project_name (required), +3 more. Returns: result

generate_proposalA

Generates the final branded proposal .docx and uploads it to the Output Drive folder. This is the LAST step, called once per proposal.

proposal_json must be a JSON string matching this shape: { "title": "Cloud Modernisation Proposal", "client_name": "XYZ Bank", "country": "India", "template_id": "default", "rate_card_path": "/path/to/project_rate_card.xlsx", // optional: path to project-specific rate card "sections": [ { "section_id": "executive_summary", // must match one of get_mandatory_sections() ids "blocks": [ {"type": "paragraph", "text": "..."}, {"type": "bullets", "items": ["...", "..."]}, {"type": "sub_heading", "text": "..."}, {"type": "table", "headers": ["Role","Rate"], "rows": [["Cloud Architect","..."]]}, {"type": "bar_chart", "title": "...", "categories": ["Q1","Q2"], "values": [3,5], "y_label": "FTEs"}, {"type": "pie_chart", "title": "...", "labels": ["Cloud","Security"], "values": [60,40]}, {"type": "gantt_chart", "title": "Engagement Timeline", "tasks": [{"name":"Discovery","start":"2026-08-01","duration_days":14}]}, {"type": "workflow_diagram", "title": "Illustrative Digital-Service Workflow", "workflow_steps": [ {"label":"Users", "detail":"Submit secure requests"}, {"label":"AWS WAF + ALB", "detail":"Protect and route traffic"}, {"label":"Amazon EC2", "detail":"Run application services"}, {"label":"Amazon RDS", "detail":"Store transactional data"}, {"label":"CloudWatch", "detail":"Monitor and alert"} ]} ] }, ... one entry for EACH of the 9 mandatory section ids ... ] }

Authoring standard (important): write as a senior pre-sales consultant. Make every point specific to the supplied client brief and verified tool data. Use concise, complete prose: usually one 50-90 word paragraph per idea and 3-5 parallel bullets where bullets are more scannable. Use tables for comparisons, pricing, roles, assumptions, and milestones; use charts only when the supplied numbers make a decision easier. Avoid filler, repeated claims, unsupported superlatives, and invented numbers. Preserve uncertainty as an assumption or validation item. Return only valid JSON in the required shape—no Markdown, commentary, or duplicated narrative.

The required Illustrative Technical Workflow section must be immediately before Conclusion. Include one workflow_diagram plus, where helpful, one short framing paragraph. Make the components specific to the client domain and selected platform; only use named services (for example Amazon EC2) when they are in scope or clearly labelled illustrative. Keep the diagram to its end-to-end path, rather than a detailed design.

All 9 mandatory sections (see get_mandatory_sections) must be present or this call will fail with a clear error listing what's missing. This compact structure produces a high-quality proposal without wasting output tokens. Returns the Drive link to the finished document.

Inputs: proposal_json (required). Returns: result

get_company_profileA

Returns a condensed summary of the company's services, capabilities and differentiators, to be used for writing the Executive Summary and Understanding sections.

Inputs: no named parameters. Returns: result

get_mandatory_sectionsA

Returns the fixed list and order of sections every proposal MUST contain.

Call this first. Draft all sections from the client brief and tool results, then make one generate_proposal call. Prefer decision-ready, client-specific content over generic marketing language; do not invent facts, pricing, timelines, certifications, or customer commitments.

Inputs: no named parameters. Returns: result

get_rate_cardA

Look up quote-ready manpower rates for the verified client country. Args: country: The proposed company's verified country (e.g. "India" or "United Kingdom"). Country aliases such as UK are resolved safely; this tool never uses an ambiguous substring match. roles: optional list of role names to filter to (e.g. ["Cloud Architect", "Senior Engineer"]). Omit to get all roles for that country. level: optional exact seniority filter, for example "Junior", "Mid Senior", or "Senior". Returns compact JSON with the selected country sheet/fallback metadata and the exact quote rows. If no country sheet exists, the Constants sheet is used automatically and clearly identified as USD day-rate fallback.

Inputs: country (required), level, roles. Returns: result

list_rate_card_countriesA

Returns which countries/sheets exist in the rate card, in case the exact country name needs to be confirmed before calling get_rate_card.

Inputs: no named parameters. Returns: result

list_templatesA

List available proposal templates (e.g. 'default', 'rfp', 'sow'). Call this before generate_proposal if you're unsure which template_id to use.

Inputs: no named parameters. Returns: result

resolve_rate_card_countryA

Preview the rate-card selection for a verified client country before creating a proposal. This returns the exact sheet that will be used, or a clearly marked Constants/USD fallback if the country has no dedicated tab.

Pass the client's country as supplied in the brief or confirmed by trusted company research. A company name alone is intentionally not guessed: that could quote the wrong legal entity or geography.

Inputs: country (required). Returns: result

validate_and_reload_project_rate_cardA

STAGE 1b: Validate and reload a project rate card from disk.

This tool reads the generated .xlsx file back into memory to ensure Stage 2 (proposal generation) uses the actual generated workbook as the source of truth, not the in-memory master rate card data.

Args: local_path: Path to the generated project rate card .xlsx file

Returns the parsed ProjectRateCardData as JSON.

Inputs: local_path (required). Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.4/5.0

    Scored across 9 tools

    Disambiguation5/5

    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.

    Naming Consistency5/5

    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.

    Tool Count5/5

    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.

    Completeness5/5

    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.

    Related MCP Connectors

    Related MCP Servers