Salesforce Documentation MCP Server

Salesforce Documentation MCP Server

A local-first MCP server that enables intent-based searching across over 350 official Salesforce developer documents and release notes. It allows users to retrieve API references, code examples, and technical documentation directly through natural language queries.

Category
访问服务器

README

Salesforce Documentation MCP Server

MCP Node.js License: MIT

A local-first Model Context Protocol (MCP) server for searching Salesforce Developer Documentation. Search across 360 official Salesforce PDF documents directly from VS Code, Claude Desktop, or any MCP-compatible client.

✨ Features

  • 🎯 Intent-Based Search - Automatically detects query topic (Apex, REST API, LWC, etc.) and searches in relevant docs
  • 📚 360 Documents - 291 developer guides + 69 release notes (Apex, LWC, REST API, Metadata API, and more)
  • 🏠 100% Local - All data stays on your machine, works offline
  • Fast - Sub-second query latency with intelligent filtering + LRU caching
  • 🔍 Smart Fallback - Expands search if topic-filtered results are sparse
  • 📦 Packageable - Pure JavaScript (sql.js), no native dependencies
  • 🔐 Secure - Parameterized queries, input validation with zod

🚀 Quick Start

Prerequisites

  • Node.js 18 or higher
  • npm or yarn
  • VS Code with GitHub Copilot or Claude Desktop

Installation

# Clone the repository
git clone https://github.com/SalesforceDiariesBySanket/salesforce-docs-mcp.git
cd salesforce-docs-mcp

# Install dependencies
npm install

# Build the TypeScript
npm run build

# Build the search index (parses all PDFs - takes 5-10 minutes)
npm run build-index

Configure VS Code

Add to your VS Code MCP configuration (%APPDATA%\Code\User\mcp.json on Windows):

{
  "servers": {
    "salesforce-docs": {
      "type": "stdio",
      "command": "node",
      "args": ["C:\\path\\to\\salesforce-docs-mcp\\dist\\index.js"]
    }
  }
}

Configure Claude Desktop

Add to your Claude Desktop configuration (%APPDATA%\Claude\claude_desktop_config.json):

{
  "mcpServers": {
    "salesforce-docs": {
      "command": "node",
      "args": ["C:\\path\\to\\salesforce-docs-mcp\\dist\\index.js"]
    }
  }
}

🛠️ Available Tools

search_salesforce_docs

Search across all Salesforce documentation with natural language queries.

Example: "How to create an Apex trigger on Account"
Example: "REST API authentication with OAuth 2.0"
Example: "Lightning Web Component wire service"

get_api_reference

Get specific Salesforce API reference documentation.

Example: API name "REST API", endpoint "/services/data"
Example: API name "Bulk API 2.0", endpoint "jobs"

get_release_notes

Get Salesforce release notes for specific releases or features.

Example: release "Winter 26"
Example: feature "Dynamic Forms"

get_code_example

Get code examples from Salesforce documentation.

Example: topic "trigger on Account", language "apex"

list_doc_categories

List all documentation categories with document counts.

get_document

Get full content of a specific document by ID or filename.

🎯 Intent-Based Search

The MCP server automatically detects the topic of your query and searches in the most relevant documentation:

Query Detected Intent Searches In
"How to create an Apex trigger" Apex Development ~15 Apex docs
"REST API OAuth authentication" REST API ~10 REST API docs
"LWC wire decorator" Lightning/LWC ~12 Lightning docs
"Bulk API 2.0 job" Bulk API ~5 Bulk API docs
"sharing rules permission set" Security 12 Security docs
"SOQL query limits" SOQL/SOSL ~5 SOQL docs

Benefits:

  • 🎯 More relevant results - Searches in topic-specific docs first
  • Faster queries - Scans ~15 docs instead of 357
  • 🔄 Smart fallback - Expands search if too few results found

Override: You can always specify category or subcategory to search in a specific area.

📁 Documentation Categories

Category Description
core_platform Apex, LWC, Visualforce, SOQL/SOSL, Formulas
apis REST, SOAP, Metadata, Bulk, Tooling APIs
dev_tools Salesforce CLI, VS Code, Packaging
clouds Sales, Service, Experience, Industry Clouds
security Authentication, Authorization, Sharing
integration Integration Patterns, Connectors
best_practices Limits, Performance, Cheatsheets
release_notes Winter '15 to present

🏗️ Project Structure

salesforce-docs-mcp/
├── src/
│   ├── index.ts              # MCP server entry point
│   ├── types.ts              # TypeScript type definitions
│   ├── db/
│   │   ├── database.ts       # SQLite connection (sql.js)
│   │   └── queries.ts        # Search queries with intent detection
│   └── utils/
│       ├── formatter.ts      # Result formatting
│       ├── intent.ts         # Intent detection patterns
│       ├── classifier.ts     # Document classification
│       └── chunker.ts        # PDF text chunking
├── scripts/
│   ├── build-index.ts        # PDF parsing and indexing
│   ├── test-search.ts        # Search testing (114 tests)
│   ├── test-llm-judge.ts     # LLM-as-judge evaluation
│   └── postinstall.js        # Post-install setup
├── docs/
│   ├── pdfs/                 # 291 Salesforce developer PDFs
│   └── release-notes/        # 69 release notes PDFs
├── data/
│   └── salesforce-docs.db    # SQLite search index (357 docs)
├── package.json
├── tsconfig.json
└── README.md

📥 Adding Documentation

Download Salesforce PDFs to docs/pdfs/ then rebuild the index:

npm run build-index

PDFs can be downloaded from:

https://resources.docs.salesforce.com/{version}/latest/en-us/sfdc/pdf/{name}.pdf

Current version: 258 (Winter '26, API v65.0)

🔧 Development

# Run in development mode
npm run dev

# Build TypeScript
npm run build

# Test search functionality
npm run test-search

⚡ Performance

Metric Value
PDF Documents 360 (291 + 69 release notes)
Documents indexed 357
Search chunks ~156,000
Database size ~520 MB
Intent-filtered query < 50ms (scoped search)
Unfiltered query < 500ms (full corpus)
Cached query < 10ms

How Intent-Based Search Improves Performance

Traditional Search:
  "Apex trigger" → Scan all 156K chunks → Filter → Rank → ~500ms

Intent-Based Search:
  "Apex trigger" → Detect: Apex (high confidence)
                 → Filter to apex subcategory (~15 docs, ~6,000 chunks)
                 → Scan → Rank → ~50ms

Note: Uses sql.js (pure JavaScript SQLite) with LIKE-based text search. Intent detection reduces search scope by 90%+ for topic-specific queries.

🔐 Security

  • 100% Local: No data leaves your machine
  • No API Keys: Works completely offline
  • stdio Transport: No exposed HTTP endpoints
  • Parameterized Queries: Protection against SQL injection
  • Input Validation: All tool inputs validated with zod schemas

📜 License

MIT License - see LICENSE for details.

⚠️ Disclaimer

Salesforce Documentation: The Salesforce documentation PDF files included in this repository are the property of Salesforce, Inc. and are provided for convenience only. These documents are subject to Salesforce's own terms of use and copyright.

Trademark Notice: The trademarks and product names of Salesforce®, including the mark Salesforce®, are the property of Salesforce, Inc. This project is not affiliated with, sponsored by, or endorsed by Salesforce, Inc. The use of the Salesforce® trademark and Salesforce documentation in this project does not indicate an endorsement, recommendation, or business relationship between Salesforce, Inc. and the project maintainers.

Official Documentation: For official Salesforce documentation, please visit developer.salesforce.com/docs.


© 2026 Sanket (SalesforceDiariesBySanket) | Salesforce documentation © Salesforce, Inc.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选