mcp-server-patterns

Build and register MCP servers for Salesforce integration with Node and TypeScript.

13|2|Updated Mar 18, 2026
One-click install
npx skills add https://github.com/jiten-singh-shahi/salesforce-claude-code --skill mcp-server-patterns-jiten-singh-shahi
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: mcp-server-patterns
Source: https://github.com/jiten-singh-shahi/salesforce-claude-code/tree/main/.cursor/skills/mcp-server-patterns
Command: npx skills add https://github.com/jiten-singh-shahi/salesforce-claude-code --skill mcp-server-patterns-jiten-singh-shahi

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Provides clear patterns and best practices to design, register, and operate MCP servers that expose tools, resources, and prompts for Salesforce integration, removing guesswork when choosing transports, validation, and registration APIs.

Core Features & Use Cases

  • Tool and resource registration: Guidance for registering tools, resources, and prompts across evolving SDK signatures and Context7 discovery.
  • Transport guidance: Decision criteria for stdio, streamable HTTP, and legacy HTTP/SSE including how to keep server logic transport-agnostic.
  • Validation and safety: Recommendations for schema-first validation with Zod, input sanitization, timeouts, idempotency, and secure execution of Salesforce CLI calls.
  • Use Case: Build a custom MCP server that validates input, performs SOQL via the Salesforce CLI, and exposes a search tool usable by Claude or Cursor clients.

Quick Start

Ask the assistant to scaffold a Node MCP server that registers a Zod-validated search tool for Salesforce records and connects using streamable HTTP.

Frequently Asked Questions about mcp-server-patterns

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build an MCP server for Salesforce integration in Node and TypeScript?

To build an MCP server for Salesforce, use Node and TypeScript patterns to register tools, resources, and prompts. Apply schema validation with Zod and choose a transport like stdio or streamable HTTP to expose operations such as SOQL queries.

When should I use stdio versus streamable HTTP transport for an MCP server?

Choose stdio for local MCP server transport during development, and use streamable HTTP for production deployments. Legacy HTTP/SSE is also supported, but keeping server logic transport-agnostic allows you to switch between these options as needed.

How does Zod schema validation work when registering MCP tools?

Zod schema validation secures MCP tool registration by enforcing strict input types and sanitization. This ensures that parameters passed to Salesforce CLI operations, like SOQL queries, are validated before execution to prevent unsafe inputs.

Can I expose Salesforce SOQL search tools to Claude or Cursor using an MCP server?

Yes, you can scaffold a custom MCP server that registers a Zod-validated search tool. This tool performs SOQL via the Salesforce CLI and is fully compatible with MCP clients like Claude or Cursor for direct Salesforce record searches.

What are the best practices for secure input handling in Salesforce MCP servers?

Best practices for Salesforce MCP servers include schema-first validation with Zod, explicit timeouts, and idempotency practices. Secure execution of Salesforce CLI calls and proper input sanitization are also critical for safe server operation.

Does this MCP server pattern support Context7 registration APIs?

Yes, these MCP server patterns support compatibility with both @salesforce/mcp and Context7 registration APIs. This ensures that your registered tools, resources, and prompts are discoverable across evolving SDK signatures.