# Salesforce Admin & Metadata MCP

> Salesforce Admin & Metadata gives your AI client deep, natural-language access to the internals of any Salesforce organization. It lets you inspect data models, audit security settings, monitor API usage limits, and execute code all from a single conversation. You can quickly list users, map object schemas down to every field type, or even run anonymous Apex code for complex cleanups without needing manual UI navigation.

## Overview
- **Category:** industry-titans
- **Price:** Free
- **Tags:** crm-administration, apex-execution, metadata-management, schema-inspection, org-limits, user-management

## Description

Need to understand what an organization's data model looks like? This MCP connects your AI client directly to the Salesforce metadata layer. It lets you ask natural questions and get structured answers about everything from object relationships to field types, saving hours of clicking through setup menus.

Imagine asking, 'What fields does Account have?' and getting a perfect schema breakdown immediately. Or perhaps you need to know if your org is running low on API calls; this MCP monitors those limits for you. You can audit security profiles or even execute small pieces of Apex code directly against the live system.

By connecting this MCP through Vinkius, you give your agent a full administrative toolkit. It's designed for experts who need to diagnose complex issues—whether it’s an architect mapping data flows or a consultant checking compliance rules across dozens of client environments.

## Tools

### sf_describe_object
Retrieves a full, detailed breakdown of an object's schema, listing every field, its type, and rules.

### sf_execute_apex
Runs temporary Apex code snippets on the Salesforce org for testing or running small data fixes.

### sf_org_limits
Checks current usage versus maximum limits for core resources like API calls and storage space.

### sf_list_objects
Provides a list of all available objects in the org, including standard ones and custom components.

### sf_list_profiles
Lists all security profiles, which define what different user types are allowed to see and do.

### sf_list_users
Shows a list of active team members, including their email, role, profile, and when they last logged in.

### sf_search_metadata
Searches the org's configuration for specific code like Apex classes, triggers, or custom flows using keywords.

### sf_search_users
Finds a specific team member by name, email, or username and returns their key account details.

## Prompt Examples

**Prompt:** 
```
Describe the Opportunity object schema
```

**Response:** 
```
📋 **Opportunity** — 42 fields
| Field | Type | Required |
|---|---|---|
| Name | string | ✅ |
| Amount | currency | ❌ |
| StageName | picklist | ✅ |
| CloseDate | date | ✅ |
| AccountId | reference | ❌ |
```

**Prompt:** 
```
Check our API limits
```

**Response:** 
```
📊 **Org Limits**
| Limit | Remaining | Status |
|---|---|---|
| DailyApiRequests | 14,200/15,000 | ✅ OK |
| DailyBulkV2QueryJobs | 98/100 | ⚠️ LOW |
| DataStorageMB | 450/500 | ✅ OK |
```

**Prompt:** 
```
List all Apex classes containing Account
```

**Response:** 
```
🔍 Found 5 Apex classes:
1. AccountTriggerHandler
2. AccountService
3. AccountValidator
4. AccountBatchUpdate
5. AccountTestFactory
```

## Capabilities

### Map Object Schemas
Get a complete breakdown of any Salesforce object, showing every field's type, whether it needs a value, and its relationship to other objects.

### Audit User Access and Roles
List all system profiles and active users, letting you check who has access to what data or features within the org.

### Monitor System Health
Check current usage against maximum limits for critical resources like API calls and storage capacity.

### Search Configuration Code
Find specific metadata—like Apex classes, triggers, or custom flows—across the entire organization's configuration.

### Run Admin Scripts
Execute anonymous Apex code for one-time tasks, data fixes, or running small batch operations against the live records.

## Use Cases

### Data Mapping for New Features
A Solutions Architect needs to build a new feature but doesn't know the source data structure. They ask their agent, 'What does Opportunity have?' The agent uses `sf_describe_object` and immediately returns all fields, types, and required status, letting the architect start coding right away.

### User Access Review for Audit
A Compliance Officer must prove that only certain roles can see sensitive data. They ask their agent to list profiles and then use `sf_list_users` to confirm which active accounts belong to those restricted profiles.

### Troubleshooting Failed Code
A Developer gets a runtime error that is hard to track down. They prompt the agent, asking it to run a diagnostic script using `sf_execute_apex` and attach the debug logs for immediate review.

### Inventory Check of Custom Objects
A new consultant joins the project and needs to know what data objects exist. They ask, 'What custom objects do we have?' The agent uses `sf_list_objects` and provides a clean inventory list.

## Benefits

- Understand data structures immediately. Instead of reading complex setup guides, just ask the agent to `sf_describe_object` to get a clean, field-by-field schema breakdown.
- Stop guessing about security permissions. Use `sf_list_profiles` and `sf_list_users` to audit exactly who can do what in the org—critical for compliance checks.
- Stay ahead of capacity issues. The `sf_org_limits` tool gives you a clear picture of API call consumption, so your agent won't fail mid-migration due to hitting an invisible wall.
- Debug complex automations faster. Use `sf_search_metadata` to quickly locate all instances of a specific trigger or Apex class across the entire codebase.
- Execute fixes without manual steps. When you need to run one-off data cleanup, calling `sf_execute_apex` lets your agent perform the required code operation instantly.

## How It Works

The bottom line is that you get real-time, structured data about Salesforce's inner workings without touching the UI.

1. Your AI client invokes a tool (e.g., sf_list_objects) to query Salesforce's internal metadata.
2. The MCP receives the raw, structured data and translates it into a clean, actionable format for your agent to read.
3. Your agent synthesizes this information—whether it’s a list of users or an object schema—and presents the final answer in plain text.

## Frequently Asked Questions

**How does sf_describe_object help me understand data types?**
The `sf_describe_object` tool provides a field-by-field breakdown, listing every field's precise data type (string, picklist, reference, etc.). This is crucial for knowing what kind of data you can write to an object.

**Can I check API limits using sf_org_limits?**
Yes. `sf_org_limits` reports your current usage versus the maximums for key resources, like daily API calls and storage. It’s essential for capacity planning.

**Is sf_execute_apex safe to use?**
The tool executes real code on the org, so it can modify data. Always test with a non-production environment or run read-only scripts first. Use caution when running complex operations.

**Which tool should I use to find who owns a record?**
You'll want to combine `sf_list_users` and then potentially `sf_search_users`. The user listing provides role context, while the search function helps pinpoint specific individuals.

**Does sf_search_metadata look at flows?**
Yes. `sf_search_metadata` covers a wide range of configuration elements, including Apex classes, triggers, validation rules, and complex automated flows.