Skip to main content
Glama
SalesforceDiariesBySanket

Salesforce Documentation MCP Server

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.

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.

Install Server
A
security โ€“ no known vulnerabilities
F
license - not found
A
quality - confirmed to work

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/SalesforceDiariesBySanket/salesforce-docs-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server