rtk-sf
Indexes Salesforce DX projects (Apex classes, custom objects, fields, and Flows) into compressed YAML specs, providing AI agents with token-efficient component lookup, codebase search, relation mapping, component annotation, and a visual architecture map.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@rtk-sfShow me the compressed spec for AccountService"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
rtk-sf
Zero-Token Knowledge & Visual Live-Mapping Layer for Salesforce AI Agents
Stop wasting tokens on raw file reads. Give your AI agent a pre-indexed knowledge layer instead.
rtk-sf indexes your entire Salesforce DX project — Apex classes, custom objects, fields, and Flows — into compressed YAML specs served via MCP. Claude Code can query exact component knowledge in ~300 tokens instead of reading the full source file (~4,000 tokens). That's a 92% reduction per lookup.
Before vs. After
❌ WITHOUT rtk-sf ✅ WITH rtk-sf
───────────────────────────────────── ─────────────────────────────────────
Claude: "Show me AccountService" Claude: "Show me AccountService"
→ reads AccountService.cls → calls query_compressed_spec()
→ reads AccountService.cls-meta.xml → returns YAML spec instantly
→ reads related trigger files
→ reads test class for context
Tokens consumed: ~300
Tokens consumed: ~15,000 Time: <0.1 s
Time: ~8 s Cost (@$3/1M): $0.0009
Cost (@$3/1M): $0.045
Savings per lookup: 98%Related MCP server: ContextAtlas
ROI Calculator
Plug in your team size — the numbers speak for themselves.
Team size | Sessions/month | Without rtk-sf | With rtk-sf | Monthly savings |
Solo dev | 20 | $19.20 | $0.58 | $18.62 |
3-dev team | 60 | $57.60 | $1.73 | $55.87 |
5-dev team | 100 | $96.00 | $2.88 | $93.12 |
10-dev team | 200 | $192.00 | $5.76 | $186.24 |
20-dev team | 400 | $384.00 | $11.52 | $372.48 |
20 devs, annual | — | $4,608/yr | $138/yr | 🔥 $4,470/yr saved |
Assumptions: Claude Sonnet 4 @ $3/1M input tokens · 80 component lookups per session · 15,000 tokens without rtk-sf vs. 450 tokens with.
Full benchmark methodology and enterprise-scale projections: docs/roi.md
Architecture
┌─────────────────────────────────────────────────────────────┐
│ Salesforce DX Project │
│ force-app/main/default/ │
│ classes/AccountService.cls ← raw: ~4,000 tokens │
│ objects/Account__c.object-meta.xml │
│ flows/OnboardingFlow.flow-meta.xml │
└──────────────────┬──────────────────────────────────────────┘
│ rtk-sf index
▼
┌─────────────────────────────────────────────────────────────┐
│ .rtk-sf/ │
│ registry.json ← mtime differential tracker │
│ db.sqlite ← SQLite FTS5 full-text search │
│ relations.json ← nodes + edges graph │
│ specs/ │
│ AccountService.yaml ← compressed: ~300 tokens │
│ Account__c.yaml │
│ OnboardingFlow.yaml │
└──────────────────┬──────────────────────────────────────────┘
│ MCP stdio JSON-RPC
▼
┌─────────────────────────────────────────────────────────────┐
│ AI Agent (Claude Code) │
│ │
│ query_compressed_spec("AccountService") → 300-token YAML │
│ + annotations │
│ search_codebase("payment processing") → top 5 matches │
│ search_codebase("不備修正") → Japanese OK │
│ get_relations("AccountService") → callers + deps │
│ list_components(type="ApexClass") → all Apex classes │
│ annotate_component("Account__c", ...) → write knowledge │
└─────────────────────────────────────────────────────────────┘
│ optional
▼
┌─────────────────────────────────────────────────────────────┐
│ dist/architecture_map.html (Cytoscape.js SPA) │
│ │
│ ● Interactive graph of all components │
│ ● Click node → YAML spec in sidebar │
│ ● Path highlighting: upstream (amber) / downstream (red) │
│ ● Full-text search filter │
│ ● Self-contained HTML — no web server needed │
└─────────────────────────────────────────────────────────────┘Quick Start
Option A — One-liner (recommended)
curl -sSL https://raw.githubusercontent.com/furuCRM-Inc/rtk-sf/main/scripts/install.sh | bashThis checks Python, installs rtk-sf, indexes your project, and prints your next steps — all in one command.
Option B — Manual
Step 1 — Install
pip install rtk-sf
# With vector re-ranking (optional):
pip install "rtk-sf[vector]"Step 2 — Index your Salesforce project
cd your-salesforce-project
rtk-sf indexrtk-sf indexer starting...
Project root : /projects/my-org
Source path : /projects/my-org/force-app
Indexing complete:
Indexed : 84
Skipped : 0 (unchanged)
Errors : 0
Synced 84 components into search index.Step 3 — Register with Claude Code
claude mcp add rtk-sf -- python -m rtk_sf serveStep 4 — Tell Claude to use rtk-sf (critical)
The install script does this automatically. If you ran it manually, add this block to the top of your CLAUDE.md:
## Code Search — Use rtk-sf First (Required)
| Task | Tool to call |
|---|---|
| Find a component | `search_codebase(query)` |
| Read a spec | `query_compressed_spec(component_name)` |
| Blast-radius check | `get_relations(component_name)` |
| List components | `list_components(type)` |
| Write back discovered logic | `annotate_component(component_name, key, value)` |
Never open raw `.cls` or `.xml` files unless the spec is insufficient.Without this, Claude defaults to reading raw source files and ignores the MCP tools.
Step 5 — (Optional) Generate the visual architecture map
rtk-sf ui && open dist/architecture_map.htmlYour AI agent now has instant, token-efficient access to your entire Salesforce codebase.
MCP Integration
Claude Code
# Register the MCP server (run once per project)
claude mcp add rtk-sf -- python -m rtk_sf serve
# Verify
claude mcp listOnce registered, Claude Code can call these tools directly:
Claude: I need to understand AccountService.
→ [calls query_compressed_spec("AccountService")]
→ Returns 300-token YAML instead of reading the 4,000-token .cls file
Claude: Find all payment-related code.
→ [calls search_codebase("payment processing", limit=5)]
→ Returns ranked list of matching components with snippets
Claude: What calls AccountService?
→ [calls get_relations("AccountService")]
→ Upstream: [OrderTriggerHandler, QuoteController]
Downstream: [PaymentGateway, EmailService]Any MCP-compatible client
# Start the server manually
python -m rtk_sf serve
# The server reads JSON-RPC 2.0 from stdin, writes to stdout
# Protocol: MCP 2024-11-05Visual Architecture Map
Generate an interactive HTML graph of your entire component landscape:
rtk-sf ui
# Opens: dist/architecture_map.html
open dist/architecture_map.htmlFeatures:
Interactive graph powered by Cytoscape.js (CoSE layout)
Click any node to view its compressed YAML spec in the sidebar
Path highlighting: selected (amber), upstream callers (light amber), downstream deps (red)
Search box to filter/dim non-matching nodes
Re-layout button for large graphs
Keyboard shortcuts:
Escclear,Ctrl+K/Ffocus searchSelf-contained single HTML file — share with your team, open in any browser
Dark theme with furuCRM branding
Screenshot: docs/architecture_map_demo.png
How It Works
Differential Indexing
rtk-sf tracks file modification times in .rtk-sf/registry.json. On subsequent rtk-sf index runs, only changed files are re-parsed — making incremental indexing fast even on large orgs.
First run (84 files): ~2.3 seconds
Re-index (3 changed) : ~0.1 secondsHybrid Search
Keyword search uses SQLite's built-in FTS5 full-text search — no external dependencies, no network calls. When numpy is installed (pip install rtk-sf[vector]), results are re-ranked using bag-of-words cosine similarity for improved relevance.
Japanese search is fully supported. rtk-sf uses the FTS5 trigram tokenizer combined with a LIKE fallback for 1–2 character terms, so Japanese metadata labels, picklist values, and annotation text are all searchable:
# All of these work — including short Japanese terms
search_codebase("申込") # 2-char: LIKE fallback → hits Application__c fields
search_codebase("不備") # 2-char: LIKE fallback → hits DeficiencyReason__c
search_codebase("主任教諭") # 4-char: FTS5 trigram → hits RT_ChiefTeacher, related fields
search_codebase("管理職") # 3-char: FTS5 trigram → hits RT_Management, related fieldsCamelCase splitting is also applied at index time — ExamTicketDownloadController is indexed as both the full identifier and its word fragments (Exam, Ticket, Download, Controller), so partial English searches work without knowing the exact component name.
YAML Compression
Instead of the full Apex source, rtk-sf extracts only what the AI agent needs to reason about a component:
# Full Apex class: ~4,000 tokens
# rtk-sf spec: ~300 tokens (92% reduction)
component: AccountService
type: ApexClass
summary: Handles Account CRUD operations and related business logic
methods:
- name: createAccount
returns: Account
params: [String name, String industry]
description: Creates and inserts a new Account record
- name: getAccountsByIndustry
returns: List<Account>
params: [String industry]
description: Returns all Accounts matching the given industry
- name: updateBillingAddress
returns: void
params: [Id accountId, Address newAddress]Live Watch Mode
rtk-sf watch
# Watching: force-app/
# Ctrl+C to stopAutomatically re-indexes any .cls or .xml file that changes on disk. Ideal for active development sessions.
All Commands
rtk-sf index # Index ./force-app (differential)
rtk-sf index --path ./src # Custom source directory
rtk-sf index --force # Force re-index all files
rtk-sf watch # Live file watcher
rtk-sf watch --path ./src # Watch custom directory
rtk-sf serve # Start MCP stdio server
rtk-sf ui # Generate dist/architecture_map.html
rtk-sf ui --output ~/map.html # Custom output path
rtk-sf --version # Show version
rtk-sf --help # Show helpMCP Tools Reference
Tool | Parameters | Returns |
|
| YAML spec (~300 tokens) + all annotations |
|
| Ranked results with snippets (English & Japanese) |
|
| Upstream callers + downstream deps |
|
| All indexed components by type |
|
| Saves discovered business logic back to the index |
annotate_component — Knowledge Annotation (v0.3.0)
When your AI agent discovers business logic hidden inside method bodies — conditions, SOQL filters, access rules — it can write that knowledge back to the index so future agents find it without re-reading the source.
# First session: AI reads source and discovers a condition
Agent → [reads ApplicationSubmissionController.cls]
→ finds: if (app.Status__c != '不備') throw AuraHandledException
→ [calls annotate_component(
component_name = "Application__c",
key = "business_rule",
value = "Correction (saveApplicationCorrection) only allowed when Status__c = '不備'. Owner check: EligibleStaff__r.Contact__c = current user. After correction, status reverts to '申込済'.",
source = "ai_discovery"
)]
# All future sessions: no source read needed
Agent → [calls search_codebase("correction condition")]
→ returns Application__c with annotation in results
Agent → [calls query_compressed_spec("Application__c")]
→ returns YAML spec PLUS:
## Annotations (discovered business logic)
[business_rule] (ai_discovery · 2026-09-06)
Correction only allowed when Status__c = '不備'. ...Virtuous cycle: each session makes the knowledge base richer for the next one — at zero additional token cost.
Supported Salesforce Metadata
rtk-sf indexes all major Salesforce metadata types supported by the sf CLI, grouped below by category.
Code / Programmatic
Type | Source | What is indexed |
ApexClass |
| Class name, ApexDoc summary, all method signatures + descriptions |
ApexTrigger |
| Trigger name, sObject, trigger events (before/after insert/update/…) |
ApexPage |
| Controller, title attribute |
ApexComponent |
| Controller, access attribute |
LightningComponentBundle (LWC) |
| Targets, |
AuraDefinitionBundle |
| Bundle type (Component/App), |
UI / Metadata
Type | Source | What is indexed |
Custom Object |
| Label, fields list, lookup relationships |
Custom Field |
| Name, type, label, required, description |
Flow |
| Label, process type, status, element counts |
FlexiPage |
| Page type, template, component count + references |
Layout |
| Section count, related list count |
CompactLayout |
| Label, fields list |
ListView |
| Label, filter scope, columns |
QuickAction |
| Type, target object, label |
CustomTab |
| Custom object, Aura component, or page reference |
Security / Access
Type | Source | What is indexed |
Profile |
| User license, object permissions (CRUD), enabled user permissions |
PermissionSet |
| Object permissions, enabled user permissions |
PermissionSetGroup |
| Included permission sets list |
CustomPermission |
| Label, description |
Rules / Automation
Type | Source | What is indexed |
ValidationRule | embedded in | Active flag, formula, error message, description |
WorkflowRule |
| Rule names, trigger types, action counts |
AssignmentRules |
| Rule count |
EscalationRules |
| Rule count |
AutoResponseRules |
| Rule count |
SharingRules |
| Owner rule count, criteria rule count |
Data / Config
Type | Source | What is indexed |
CustomMetadata |
| Label, field/value pairs |
CustomLabel |
| Label count, all fullName/value/language/categories entries |
GlobalValueSet |
| Master label, all picklist values |
StandardValueSet |
| All standard values |
RecordType |
| Full name, label, active, business process |
MatchingRule |
| Active, matching rule item count |
DuplicateRule |
| Master label, active, matching rules list |
App / Navigation
Type | Source | What is indexed |
CustomApplication |
| Label, nav type, tab count + list |
AppMenu |
| App menu item count |
HomePageLayout |
| Component count + list |
Integration / External
Type | Source | What is indexed |
ConnectedApp |
| Label, OAuth scopes |
NamedCredential |
| Label, endpoint URL, principal type |
RemoteSiteSetting |
| URL, active flag, description |
AuthProvider |
| Provider type, friendly name |
CspTrustedSite |
| Endpoint URL, active flag |
Type | Source | What is indexed |
EmailTemplate |
| Name, subject, type, description |
Agentforce / AI
Type | Source | What is indexed |
PromptTemplate |
| Master label, type, template type, active version count |
GenAiPromptTemplate |
| Master label, type |
GenAiFunction |
| Master label, description, function definition |
AIApplication |
| Developer name, status |
Bot / BotVersion |
| Label, private conversation log setting, dialog count |
Analytics
Type | Source | What is indexed |
WaveApplication |
| Name, label |
WaveDashboard |
| Name, label |
Static / Assets
Type | Source | What is indexed |
StaticResource |
| Content type, cache control, description |
ContentAsset |
| Master label, language |
Installation
From PyPI
pip install rtk-sfWith vector re-ranking
pip install "rtk-sf[vector]"From source
git clone https://github.com/furuCRM-Inc/rtk-sf.git
cd rtk-sf
pip install -e ".[dev]"Requirements
Python 3.9+
Salesforce DX project with
force-app/structurewatchdog(for watch mode)pyyaml(included)numpy(optional, for vector re-ranking)
Project Structure
rtk-sf/
├── rtk_sf/
│ ├── __init__.py # Package exports
│ ├── __main__.py # CLI entry point
│ ├── indexer.py # Differential parser (Apex, XML, objects)
│ ├── search.py # SQLite FTS5 + vector hybrid search
│ ├── watcher.py # OS file watcher (watchdog)
│ ├── mcp_server.py # MCP stdio JSON-RPC server
│ └── ui_generator.py # Generates dist/architecture_map.html
├── ui/
│ └── template.html # Cytoscape.js SPA template reference
├── docs/
│ ├── installation.md # Platform-specific install guide
│ ├── mcp-integration.md # MCP setup for Claude Code
│ └── roi.md # Detailed ROI analysis
└── scripts/
└── install.sh # One-command setup scriptContributing
We actively want the Salesforce developer community to build on top of rtk-sf. Here are the most impactful ways to contribute right now:
🔧 High-Impact: Write a new metadata parser
The indexer lives in rtk_sf/indexer.py. Adding a new parser means AI agents can understand one more Salesforce metadata type without reading raw XML. Open tasks:
Metadata | File pattern | Status |
OmniStudio FlexCard |
| wanted |
OmniStudio DataRaptor |
| wanted |
Experience Cloud page |
| wanted |
Slack App |
| wanted |
Custom Notification |
| wanted |
See CONTRIBUTING.md for the 30-line parser template.
📊 Medium: Improve the architecture map
rtk_sf/ui_generator.py generates the Cytoscape.js SPA. Ideas:
Add edge labels showing the relationship type (calls / references / extends)
Add a timeline view sorted by
updated_at(shows recently changed components)Export the graph as PNG/SVG
📝 Easy: Add annotations from your own project
If you discover business rules, access conditions, or SOQL filters that are important to document, use annotate_component and open a discussion — we want to build a community knowledge base.
Quick start for contributors
git clone https://github.com/furuCRM-Inc/rtk-sf.git
cd rtk-sf
pip install -e ".[dev]"
pytestRoadmap
Permission Set indexing
Custom Label indexing
Apex Trigger indexing (separate from class)
LWC component indexing (HTML + JS summary)
Aura bundle indexing
Full coverage of all sf CLI metadata types (v0.2.0)
Japanese search — FTS5 trigram + LIKE fallback for 1–2 char terms (v0.3.0)
CamelCase splitting for partial English identifier search (v0.3.0)
annotate_componentMCP tool — write discovered business logic back to index (v0.3.0)Annotations included in
query_compressed_specresponse (v0.3.0)VS Code extension with inline spec preview
GitHub Actions integration for CI spec validation
Org-aware indexing (pull metadata from connected org via
sfCLI)Annotation export/import for team knowledge sharing
License
MIT — free to use, modify, and distribute.
Built with love by furuCRM Inc.
Helping Salesforce development teams move faster with AI.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
No tool schema history has been recorded yet.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Give your AI agent a persistent map of your project's structure, dependencies, and bugs.
Salesforce-grounded retrieval, diagnoses, and a vetted-Force marketplace for MCP clients.
Your org's AI agents, tasks, runs, search, and brain files as MCP tools and resources.
Let AI agents query data and act across all your business apps via MCP.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to search code by meaning, explore codebase structure, store and query knowledge with temporal facts, and read source code through a set of MCP tools.4817MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI coding agents to retrieve and manage code context with hybrid search, project memory, and observability via MCP tools.29MIT

NEAT MCP Serverofficial
AlicenseNot gradedqualityAmaintenanceProvides AI agents with a live architecture model of a codebase, enabling queries for root cause analysis, blast radius, and dependency traversal through MCP tools.23818Apache 2.0- AlicenseNot gradedqualityAmaintenanceEnables AI coding agents to query a codebase as a knowledge graph, providing token-budgeted context, search, and impact analysis via MCP tools.MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/furuCRM-Inc/rtk-sf'
If you have feedback or need assistance with the MCP directory API, please join our Discord server