salesforce-deployment-guard
Salesforce Deployment Guard MCP
一个仅限本地的 Model Context Protocol 服务器,可将 Salesforce 风格的部署证据转化为结构化的发现结果和修复步骤。
这是一个净室(clean-room)作品集项目。它使用确定性规则和合成示例——不涉及 Salesforce 组织、凭据、LLM、遥测或网络访问。
工具
工具 | 用途 |
| 对缺失元数据、无效引用、Apex 测试失败、权限失败、格式错误的 XML 和未知证据进行分类。 |
| 检测缺失依赖、重复项、无效名称、自依赖和循环依赖。 |
| 标记宽泛的系统权限、对象 Modify All 权限、重复更改以及只写不读的组合。 |
| 将发现结果转化为确定性的、按优先级排序的检查清单。 |
每个工具都是只读的,并同时返回人类可读的文本和结构化 JSON。
Related MCP server: Security & GRC MCP Server
快速开始
要求:Node.js 20.19 或更高版本。
git clone https://github.com/qpulce-dev/salesforce-deployment-guard-mcp.git
cd salesforce-deployment-guard-mcp
npm ci
npm run verify
npm run build连接 MCP 客户端
Codex CLI:
codex mcp add salesforce-deployment-guard -- node "/absolute/path/to/salesforce-deployment-guard-mcp/dist/server.js"Claude Desktop 兼容配置:
{
"mcpServers": {
"salesforce-deployment-guard": {
"command": "node",
"args": [
"/absolute/path/to/salesforce-deployment-guard-mcp/dist/server.js"
]
}
}
}更改 MCP 配置后,请重启客户端。
实时 MCP 记录
以下内容来自一个通过 stdio 连接到构建后服务器的真实 MCP 客户端:
connected: salesforce-deployment-guard-mcp
tools: analyze_deployment_log, validate_metadata_manifest, assess_permission_risk, build_remediation_plan
call: analyze_deployment_log
arguments: {"log":"Error: no CustomField named Demo__c.Region__c found"}
{
"status": "issues_found",
"findings": [
{
"code": "SF_MISSING_METADATA",
"category": "missing_dependency",
"severity": "error",
"evidence": "Error: no CustomField named Demo__c.Region__c found",
"likelyCause": "A referenced metadata component is absent from the deployment set or target org.",
"nextChecks": [
"Confirm the referenced component exists in source control.",
"Add the dependency to the deployment manifest before its consumer."
]
}
]
}fixtures/ 目录包含额外的合成输入。
架构
MCP client
-> Zod input schema
-> small tool handler
-> deterministic domain function
-> structured JSON + concise textsrc/server.ts注册工具并负责 stdio 启动。src/domain/包含纯诊断和规划逻辑。src/tools/result.ts格式化稳定的 MCP 响应。tests/涵盖领域行为、隐私规则以及真实的 stdio MCP 握手。fixtures/仅包含合成示例。
验证
npm run verify该命令会运行格式化、ESLint、严格的 TypeScript 检查、39 个测试、生产构建和隐私扫描。MCP 冒烟测试会启动构建后的服务器,协商客户端连接,列出全部四个工具,并调用其中一个工具。
CI 在 Node.js 20.19 和 22 上运行相同的验证。
隐私与安全
无运行时网络调用。
无数据持久化或遥测。
无需环境变量或凭据。
输入在分析前会进行限制。
错误不会返回堆栈跟踪或本地路径。
包含的示例使用诸如
Demo__c和Demo_Access之类的名称。隐私扫描器仅报告文件和规则标识符,绝不报告匹配到的机密文本。
如需额外的本地组织名称检查:
PRIVATE_ORG_NAMES="Private Org One,Private Org Two" npm run privacy:scan请勿将真实的生产日志粘贴到公开的 issue、提交或 fixtures 中。
限制
此服务器提供确定性的审查指导。它不会连接 Salesforce、不会针对真实组织进行验证、不会替代安全审查,也不会保证部署成功。未知证据仍归类为 unknown。
许可证
MIT © 2026 Queanu Pulce
Available Tools
4 toolsanalyze_deployment_logAnalyze Salesforce Deployment LogARead-only
Classify common Salesforce deployment failures using deterministic, local-only rules.
| Name | Required | Description | Default |
|---|---|---|---|
| log | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| status | Yes | |
| findings | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true and destructiveHint=false, so the tool is known to be safe. The description adds meaningful behavioral context: 'deterministic, local-only rules' indicates that it does not depend on external services or randomness. This goes beyond the annotation coverage without contradicting it.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, dense sentence that front-loads the core action and key constraints. Every word contributes value, with no filler or repetition.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool is simple (one parameter) and has an output schema, so return values need no explanation. The description conveys the purpose, the deterministic and local nature, and the scope ('common' failures). It lacks explicit guidance on what to pass as the log, but the parameter name and title make this reasonably clear. Overall, it is complete for an agent to call the tool correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0% and the description does not elaborate on the expected format or content of the 'log' parameter beyond the name and the implied context of deployment logs. It provides some meaning through the tool title and phrase 'deployment failures,' but the agent must infer what a valid log looks like. This is only minimally sufficient compensation for the missing schema description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('classify') and resource ('common Salesforce deployment failures'), and adds a distinguishing method ('deterministic, local-only rules'). It clearly separates this from sibling tools that validate, assess, or build plans.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies the tool is used when you have a deployment log to classify, but it does not explicitly state when to use it versus the siblings, nor when not to use it. The context is inferable from the tool name and description, but no alternatives or exclusions are given.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
assess_permission_riskAssess Salesforce Permission RiskARead-only
Review synthetic permission changes for broad access and least-privilege concerns.
| Name | Required | Description | Default |
|---|---|---|---|
| changes | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| risk | Yes | |
| findings | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations indicate read-only behavior, and the description aligns with that by using 'review'. It adds useful context about the focus (broad access and least-privilege) beyond the bare annotation, which helps the agent understand the tool's purpose without overexplaining.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, focused sentence with no redundant words. It immediately conveys the primary action and intent, making it easy to parse and understand.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The description gives a clear purpose but omits details about input/output behavior, such as what the tool returns or how to interpret results. Given that an output schema exists, the description does not need to elaborate on return, but it could mention expected usage patterns or any prerequisites. It is adequate but not thorough.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The description offers minimal insight into the 'changes' parameter. It implies that 'changes' are permission changes, but does not explain the structure, required fields, or enums present in the schema. Since schema coverage from the description is 0%, the description does not compensate for the lack of parameter documentation.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states a specific action ('review') and a specific subject ('synthetic permission changes') with a clear objective ('broad access and least-privilege concerns'). It distinguishes itself from sibling tools like 'analyze_deployment_log' and 'validate_metadata_manifest' which focus on other aspects.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies when to use the tool (when reviewing permission changes for broad access and least-privilege) but does not explicitly contrast it with alternatives or state exclusion criteria. The sibling tools are not mentioned, so an agent might not know whether to pick this over 'build_remediation_plan' without additional context.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
build_remediation_planBuild Salesforce Deployment Remediation PlanBRead-only
Turn diagnostic findings into a deterministic, prioritized remediation checklist.
| Name | Required | Description | Default |
|---|---|---|---|
| findings | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| steps | Yes | |
| status | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true and destructiveHint=false, so the safety profile is covered. The description adds behavioral context by saying the output is deterministic and prioritized, but it does not disclose ordering logic, edge-case handling, or whether anything is persisted. This is adequate for a read-only transformation but not rich.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single front-loaded sentence with no filler. Every word contributes meaning: it specifies input, transformation, determinism, prioritization, and output.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The purpose and return intent are clear, and the output schema presumably covers the return structure. However, the description lacks usage guidance and adequate parameter semantics, making it incomplete for an agent that must decide when to call this tool and how to prepare the findings input.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, and the description only references 'diagnostic findings' without explaining the structure or meaning of the findings array. The nested schema defines required fields and enums, but the description does not compensate for the lack of schema descriptions by clarifying what constitutes a finding or how the fields should be interpreted.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('Turn') with a clear resource ('diagnostic findings') and a concrete output ('deterministic, prioritized remediation checklist'). This differentiates it from siblings like analyze_deployment_log, validate_metadata_manifest, and assess_permission_risk, which focus on analysis, validation, and risk assessment rather than remediation planning.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description does not state when to use this tool versus its siblings, nor does it mention prerequisites or downstream usage. It implies 'diagnostic findings' as input but never explains that the tool should be run after diagnosis or how it relates to the analyze/validate/assess pipeline.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
validate_metadata_manifestValidate Salesforce Metadata ManifestARead-only
Detect missing dependencies, duplicate entries, invalid names, self-references, and dependency cycles.
| Name | Required | Description | Default |
|---|---|---|---|
| components | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| valid | Yes | |
| findings | Yes | |
| componentCount | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare readOnlyHint=true and destructiveHint=false, so the description does not need to restate safety. It adds value by disclosing the specific types of issues it detects, which is beyond the annotations and helps the agent understand what to expect from the validation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, information-dense sentence that front-loads the verb 'Detect' and lists all validations. There is no filler or redundant wording, making it highly efficient.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool has one undocumented parameter (high schema coverage gap) and the description provides no guidance on how to construct the 'components' input. While an output schema exists (so return format is covered), the missing parameter explanation makes the description incomplete for a tool that expects a complex array structure.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, and the description does not explain the 'components' parameter at all. The schema structures the input (array of objects with name, type, dependsOn) but without descriptions, the agent is left to infer the meaning. The description should clarify what 'components' represents and the expected format, but it remains silent.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses the specific verb 'Detect' and lists the exact validation checks (missing dependencies, duplicate entries, invalid names, self-references, dependency cycles). This clearly distinguishes it from sibling tools like analyze_deployment_log or build_remediation_plan, which address different concerns.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies when to use this tool (when validating a manifest) but does not explicitly state when not to use it or provide alternatives. Sibling names are different enough that an agent can infer the purpose, but there is no explicit routing guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
4 tool updates
v1.0.0- First observed
analyze_deployment_log - First observed
assess_permission_risk - First observed
build_remediation_plan - First observed
validate_metadata_manifest
TDQS
Scored across 4 tools
Each tool has a clearly distinct role in the deployment-guard workflow: analyzing logs, validating manifests, reviewing permissions, and generating remediation plans. There is no overlap or ambiguity between them.
All tool names follow the same verb_noun pattern (analyze_, validate_, assess_, build_), creating a predictable and consistent naming convention that makes it easy for an agent to infer each tool's purpose.
Four tools is well-scoped for a deployment guard server. The set covers the essential phases—diagnosis, validation, risk assessment, and remediation—without unnecessary bloat or missing core functionality.
The four tools form a coherent pipeline from failure analysis through remediation planning. Minor gaps exist, such as no direct tool for retrieving raw deployment logs or applying fixes, but these are likely outside the server's declared guard purpose.
Maintenance
Related MCP Connectors
Detects database migration table locks, terraform cost leaks, and OWASP API flaws.
Screens public GitHub repos and PRs to generate risk maps, findings, and merge-readiness signals.
Generate SBOMs, scan vulnerabilities, and analyze dependencies from local projects or Git repos.
Deep security scans of repos you own from your editor: dependency CVEs, SAST, git-history secrets.
Related MCP Servers
- FlicenseNot gradedqualityCmaintenanceEnables auditors to scan cloud IAM policies for privilege-escalation paths, wildcards, and risky grants directly within Cursor or Claude Code, using a deterministic rule engine that runs entirely on local infrastructure.1-
- FlicenseNot gradedqualityCmaintenanceEnables local security scanning and compliance gap analysis for code and text, detecting secrets, PII, and OWASP vulnerabilities, and assessing readiness across major frameworks like NCA, ISO 27001, NIST CSF, and SOC 2.-
- FlicenseNot gradedqualityCmaintenanceEnables security review of code diffs and files in Cursor/VS Code using local rule-based analysis with the same rule IDs as CI, no cloud required.-
- AlicenseAqualityCmaintenanceEnables local SOC 2 compliance work by scanning Infrastructure-as-Code, mapping findings to SOC 2 Trust Services Criteria, explaining risks in plain English, and drafting audit-ready documents without uploading files.161MIT