ForceKit MCP Server
Exposes Salesforce development tools (scan, lint, test, deploy, verify) to AI assistants via the Model Context Protocol, enabling programmatic interaction with Salesforce projects.
README
ForceKit — AI Agent Framework for Salesforce
ForceKit is a programmatic AI Agent Framework designed for Salesforce development. It enables declarative agent definitions, custom lifecycle plugins, unified CLI execution, and seamless integration with Large Language Models (LLMs) via the Model Context Protocol (MCP).
Key Features
- Declarative Agent Definitions: Define agent capabilities, constraints, tool permissions, and lifecycle rules in clean YAML files.
- Model Context Protocol (MCP) Server: Run ForceKit as a standard stdio MCP server to expose Salesforce tools programmatically to LLM clients (like Claude Desktop or Cursor).
- Structured State Management: Track agent sessions, decisions, tasks, and blockers in a centralized, serializable JSON state, rendering automatic Markdown updates.
- Active Salesforce Integration: Wrap the Salesforce CLI (
sf) to verify metadata existence, execute Apex unit tests, parse code coverage, and deploy files securely. - Static Analysis (Linter): Includes 10 built-in, Salesforce-specific linting rules (e.g. banning DML/SOQL in loops, enforcing user-mode operations, detecting empty catch blocks).
Project Status
ForceKit v2.0.0-beta.1 — the following table describes the maturity of each major feature area:
| Feature | Status | Notes |
|---|---|---|
| CLI (scan, lint, verify, deploy, test) | ✅ Production-ready | Wraps sf CLI with full JSON output support |
| MCP Server Integration | ✅ Production-ready | Tested with Claude Desktop and Cursor |
| Agent Definitions (YAML) | ✅ Production-ready | 5 built-in agents, AJV-validated schema |
| State Management & Markdown Rendering | ✅ Production-ready | Atomic writes, structured JSON, backward-compatible |
| Static Analysis (Linter) | ✅ Production-ready | 12 built-in rules, plugin-extensible |
| Plugin System | 🧪 Experimental | API stable, 3 built-in plugins |
| Orchestrator Multi-Agent Loop | 🧪 Experimental | Sequential task delegation, quality gates |
| Web Search Tool | 🧪 Curated reference DB | 27+ Salesforce doc entries, offline-capable |
Legend: ✅ = Stable and tested for production Salesforce projects | 🧪 = Functional but under active development
Directory Structure
forcekit/
├── agents/
│ └── definitions/ # Declarative YAML definitions
│ ├── developer.yaml # Code generation & modification agent
│ ├── reviewer.yaml # Code review & linter agent
│ ├── qa.yaml # Test executor & coverage analyzer agent
│ ├── researcher.yaml # Doc search & release notes agent
│ └── orchestrator.yaml# Lead task planner & coordination agent
├── src/
│ ├── bin/
│ │ └── forcekit.ts # Unified CLI Entry Point
│ ├── config/
│ │ └── defaults.ts # Configuration defaults & dynamic loaders
│ ├── core/
│ │ ├── engine.ts # Agent Engine lifecycle runner
│ │ ├── orchestrator.ts # Multi-agent delegation controller
│ │ ├── state.ts # JSON state manager & markdown renderer
│ │ ├── context.ts # Context assembler & prompt builder
│ │ ├── events.ts # Centralized event bus
│ │ ├── mcp.ts # Model Context Protocol stdio server
│ │ └── registry.ts # Tool and Plugin registry
│ ├── plugins/ # Extensible plugins api and built-ins
│ ├── tools/ # Salesforce and platform CLI tools
│ └── tests/ # 100% mocked, sandbox-independent unit tests
└── tsconfig.json
AI Assistant & IDE Compatibility
ForceKit integrates with your favorite AI coding tools in two primary ways: Model Context Protocol (MCP) for active tool execution, and Markdown Grounding Context for passive workspace indexing.
1. Claude Desktop & Cursor (Active Tool Execution via MCP)
- Claude Desktop & Cursor IDE: Expose ForceKit tools (such as
scan,lint,test,verify, andweb-search) directly into chats or agent loops by registering ForceKit as a Model Context Protocol (MCP) server. When the AI assistant needs to check rules or run Apex tests, it executes the tool natively on your project directory.
2. Claude Code & Terminal Agents (CLI Command Execution)
- Claude Code: Standard command-line terminal agents can run ForceKit's compiled commands directly from your local terminal workspace (e.g.
node forcekit/dist/bin/forcekit.js lint --project-root .) to verify build health or static code guidelines before making commits.
3. Gemini / Antigravity (Active Pair Programming Integration)
- Gemini/Antigravity: As pair-programming agents with terminal command and filesystem access, we run the ForceKit CLI, synchronize org settings, verify test coverage, and automate refactoring loops directly on your behalf.
4. GitHub Copilot & OpenAI Codex (Passive Grounding Context)
- Copilot & Codex: These systems index files in your workspace automatically. ForceKit's state engine outputs structured Markdown logs:
forcekit/current-state.mdandforcekit/inventory.md. Copilot and Codex read these files, making them aware of existing classes, object definitions, and session goals without field name hallucinations.
Getting Started
1. Installation
You can install ForceKit globally or locally via npm, or build it from source.
Global CLI Installation
npm install -g @rvaghela-09/forcekit
Verify the installation:
forcekit help
Local Project Dependency
npm install --save-dev @rvaghela-09/forcekit
Verify the local installation:
npx forcekit help
Build From Source
Clone the repository, install dependencies, and build the TypeScript codebase:
npm install
npm run build
Verify that the CLI is correctly installed:
node dist/bin/forcekit.js --help
Configuration
ForceKit supports cascading configuration loading. It merges defaults with local overrides in the following priority order:
DEFAULT_CONFIG(Base settings)forcekit.config.json(Static project overrides)forcekit.config.js(Dynamic script overrides)- Runtime Options (CLI flags / programmatic parameters)
Example forcekit.config.js
Place this file in your Salesforce project root:
export default {
apiVersion: '68.0',
minTestCoverage: 95,
lint: {
maxClassLines: 150,
rules: {
'no-security-enforced': true,
'user-mode-enforced': true
}
}
};
CLI Usage Guide
Run commands by providing the target Salesforce project root via --project-root:
1. Scan Project
Catalog all Salesforce metadata (Apex, LWC, Flows, Triggers) into the local inventory state:
forcekit scan --project-root /path/to/sf-project
2. Lint Code
Run static analysis checks on your Apex classes, triggers, and LWC files:
forcekit lint --project-root /path/to/sf-project
3. Sync Salesforce Org & Limits
Query active org status, Daily API limits, Data Storage, and File Storage usage:
forcekit org sync --project-root /path/to/sf-project
4. Verify Metadata
Check if custom objects, fields, classes, or flows exist on the active org:
forcekit verify --type field --name Active__c --object Account --project-root /path/to/sf-project
5. Deploy Metadata
Deploy target source directories or files to the active org:
forcekit deploy --source-dir force-app/main/default/classes/AccountService.cls --project-root /path/to/sf-project
6. Run Unit Tests
Execute target Apex unit tests and verify code coverage:
forcekit test --tests AccountServiceTest --project-root /path/to/sf-project
7. Run Lead Orchestrator
Execute the complete, multi-agent task loop (Research → Dev → Review → QA) to achieve a high-level goal:
forcekit run-orchestrator --goal "Create Lead trigger assigning default owner" --project-root /path/to/sf-project
Model Context Protocol (MCP) Server Setup
Expose ForceKit's tools to AI IDEs or chat interfaces (like Claude Desktop) by configuring ForceKit as an MCP server.
Configuration in Claude Desktop
Add the following entry to your claude_desktop_config.json:
{
"mcpServers": {
"forcekit": {
"command": "node",
"args": [
"/absolute/path/to/forcekit/dist/bin/forcekit.js",
"mcp",
"--project-root",
"/absolute/path/to/sf-project"
]
}
}
}
Note: Replace /absolute/path/to/forcekit and /absolute/path/to/sf-project with the actual absolute paths on your local machine.
Exposed MCP Tools
Once configured, the following tools will be discoverable:
scan: Catalog all metadata.lint: Static analysis of Apex/LWC code.verify: Check metadata definitions.deploy: Deploy source/metadata.test: Run unit tests and calculate coverage.web-search: Search Salesforce documentation & release notes.session: Control task progression.
Verification & Testing
ForceKit contains a suite of sandbox-independent unit tests. Run them using:
npm test
All tests mock the Salesforce CLI commands, file streams, and JSON-RPC protocols to guarantee execution stability and speeds.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
Neon Database
MCP server for interacting with Neon Management API and databases
E2B
Using MCP to run code via e2b.
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.