ForceWeaver MCP API Documentation

What is ForceWeaver MCP?

ForceWeaver MCP (Model Context Protocol) is an enterprise-grade platform that provides AI agents with secure access to Salesforce Revenue Cloud for comprehensive health checking, analysis, and monitoring. Our dual-architecture approach combines a MCP proxy client with a private backend infrastructure for maximum security and ease of use.

System Architecture

๐Ÿ”’ Secure Dual-Repository Design: ForceWeaver uses a proxy client that connects to our private backend infrastructure, ensuring your data security while providing seamless AI agent integration. The proxy client handles MCP protocol communication, while our private backend manages Salesforce connectivity, health analysis algorithms, and data processing.

For AI Agents

Install our lightweight proxy client to enable natural language interactions with Salesforce Revenue Cloud health checking and analysis.

For Developers

Integrate our REST APIs directly into your applications for programmatic access to Salesforce health metrics and organizational data.

Enterprise Security

Enterprise-grade security with IP protection, secure token management, and comprehensive audit logging.

System Components

Proxy MCP Client

Repository: github.com/arohitu/forceweaver-mcp-server

Purpose: Lightweight proxy that handles MCP protocol communication

Installation: pip install forceweaver-mcp-server

Private Backend Infrastructure

Web Dashboard: https://mcp.forceweaver.com

REST API: https://mcp.forceweaver.com/api

Purpose: Secure Salesforce integration and health analysis engine

System Architecture

How ForceWeaver Works

ForceWeaver implements a secure dual-architecture strategy designed for both IP protection and easy distribution. AI agents connect to a lightweight proxy client, which securely communicates with our private backend infrastructure.

๐Ÿ”„ Communication Flow

AI Agent
VS Code, Claude

MCP Server
Proxy Client

Backend API
Private Infrastructure

Salesforce
Revenue Cloud

Key Benefits
  • IP Protection: Core algorithms remain private
  • Easy Installation: Simple pip install process
  • High Performance: Optimized backend infrastructure
  • Automatic Updates: Backend improvements without client changes
  • Enterprise Security: Comprehensive security controls
  • Scalability: Cloud-native architecture

Security Architecture

ForceWeaver implements enterprise-grade security measures across all system components to protect your Salesforce data and maintain compliance.

Data Protection
  • End-to-end encryption (TLS 1.3)
  • Zero-knowledge architecture
  • Secure credential management
  • Data minimization principles
Access Control
  • API key-based authentication
  • Salesforce OAuth 2.0 integration
  • Rate limiting and throttling
  • Comprehensive audit logging
Security Compliance

ForceWeaver follows MCP Security Best Practices, implements OWASP security guidelines, and maintains SOC 2 compliance standards. Our architecture prevents common security vulnerabilities including Confused Deputy attacks, token hijacking, and session management issues.

Authentication

ForceWeaver MCP uses API keys for authentication. All API requests must include your API key.

Getting Your API Key

  1. Sign up at mcp.forceweaver.com
  2. Connect your Salesforce organizations via OAuth
  3. Generate API keys in your Dashboard

API Key Format

fk_1234567890abcdef1234567890abcdef
Security: Never expose your API keys in client-side code. Store them securely on your server.

Getting Started

Follow this step-by-step guide to get ForceWeaver MCP up and running with your AI agent.

Step 1: Setup Your Account

  1. Visit mcp.forceweaver.com
  2. Click "Sign Up" and create your account
  3. Log in to access your dashboard
  4. Go to Dashboard โ†’ API Keys
  5. Click "Create New API Key"
  6. Enter a descriptive name (e.g., "VS Code MCP", "Claude Desktop")
  7. Copy and save your API key securely - it's only shown once!
Tip: Your API key will start with fk_ and be about 40 characters long.

Step 2: Connect Your Salesforce Organization

Salesforce OAuth Setup

  1. Go to Dashboard โ†’ Salesforce Organizations
  2. Click "Connect New Salesforce Org"
  3. Enter your org details:
    • Org Identifier: A unique name (e.g., "production", "sandbox")
    • Choose if it's a Production/Developer Edition or Sandbox org
  4. Click "Connect to Salesforce" to start the OAuth flow
  5. Sign in with your Salesforce username and password
  6. Authorize ForceWeaver to access your org
  7. You'll be redirected back to your ForceWeaver dashboard
Secure Authentication: ForceWeaver uses OAuth 2.0 with PKCE (Proof Key for Code Exchange) for enhanced security. We never store your Salesforce password - only secure, encrypted access tokens.

Step 3: Install the ForceWeaver MCP Client

Install the ForceWeaver MCP client that will connect to our secure backend infrastructure:

Installation Options

The ForceWeaver MCP Client is available as a Python package and GitHub repository. Choose the method that works best for your setup.

Option A: Install from PyPI (Recommended)

# Install the ForceWeaver MCP Client
pip install forceweaver-mcp-server

# Verify installation
python -m forceweaver_mcp_client --version

Option B: Install from GitHub

# Clone the repository
git clone https://github.com/arohitu/forceweaver-mcp-server.git
cd forceweaver-mcp-server

# Install dependencies
pip install -r requirements.txt

# Install in development mode
pip install -e .

Step 4: Configure Your AI Agent

Choose your preferred AI agent and follow the configuration steps below. The setup uses the installed ForceWeaver MCP Client to connect to our secure backend.

Ready to go! Once configured, you can ask your AI agent:
  • "Check the health of my Salesforce org"
  • "Analyze my Revenue Cloud bundle structure"
  • "Run a comprehensive health check on my production org"
  • "Show me detailed bundle analysis statistics"

Integration Examples

ForceWeaver MCP integrates with various AI development tools and MCP clients.

Claude Desktop

Claude Desktop is one of the most popular MCP clients. Here's how to configure it:

1. Find Configuration File

macOS/Linux:
~/.config/claude/claude_desktop_config.json
Windows:
%APPDATA%\Claude\claude_desktop_config.json

2. Add ForceWeaver MCP Client

{
  "mcpServers": {
    "forceweaver": {
      "command": "python3",
      "args": ["-m", "mcp_client"],
      "env": {
        "FORCEWEAVER_API_KEY": "fk_your_api_key_here",
        "FORCEWEAVER_BASE_URL": "https://mcp.forceweaver.com",
        "SALESFORCE_ORG_ID": "production"
      }
    }
  }
}

3. Restart Claude Desktop

After saving the configuration, restart Claude Desktop to load the ForceWeaver MCP server.

VS Code GitHub Copilot

Configure ForceWeaver with GitHub Copilot Chat in VS Code using our lightweight proxy client. This comprehensive guide is designed for users of all skill levels.

Prerequisites
  • VS Code 1.102+ installed with GitHub Copilot extension
  • Python 3.8+ installed on your system
  • ForceWeaver API key from mcp.forceweaver.com
  • At least one connected Salesforce org in your ForceWeaver account

Step 1: Install ForceWeaver MCP Client

Install the ForceWeaver MCP Client package that handles communication with our secure backend:

# Install the ForceWeaver MCP Client
pip install forceweaver-mcp-server

# Verify installation
python -m forceweaver_mcp_client --version
โœ… Why Use the Proxy Client?
  • Easy Setup: No need to download or configure server code
  • Automatic Updates: Backend improvements happen automatically
  • Secure: Your API keys and data remain protected
  • Lightweight: Minimal local resource usage
โš ๏ธ Troubleshooting Installation:
  • Permission Error: Try pip install --user forceweaver-mcp-server
  • Python Not Found: Install Python from python.org
  • Package Not Found: Ensure you have internet connectivity

Step 2: Get Your Credentials

You'll need two pieces of information from your ForceWeaver account:

๐Ÿ”‘ API Key
  1. Go to mcp.forceweaver.com/dashboard/keys
  2. Click "Create New API Key"
  3. Name it "VS Code Copilot"
  4. Copy the key (starts with fk_)
๐Ÿข Org Identifier
  1. Go to mcp.forceweaver.com/dashboard/orgs
  2. Find your Salesforce org
  3. Copy the "Org Identifier" (e.g., "production", "sandbox")

Step 3: Configure VS Code MCP Integration

Now we'll configure VS Code to use ForceWeaver MCP server using the official MCP configuration format:

Prerequisites Check

VS Code 1.102+ Required: MCP support is only available in VS Code 1.102 and later. Check your version:

  • Go to Help โ†’ About in VS Code
  • Look for version number (should be 1.102.0 or higher)
  • If you have an older version, update VS Code first
MCP Configuration Options

VS Code uses the official MCP configuration format:

  • Workspace Configuration (Recommended): Uses .vscode/mcp.json
  • User Settings: Uses global VS Code settings
Option A: Workspace Configuration (Recommended)

This configuration applies only to your current project/workspace:

  1. Open your project in VS Code
  2. Create a .vscode folder in your project root (if it doesn't exist)
  3. Create .vscode/mcp.json
  4. Add the following configuration:
{
  "servers": {
    "forceweaver": {
      "command": "python3",
      "args": ["-m", "forceweaver_mcp_client"],
      "env": {
        "FORCEWEAVER_API_KEY": "fk_your_api_key_here",
        "FORCEWEAVER_BASE_URL": "https://mcp.forceweaver.com",
        "SALESFORCE_ORG_ID": "your_org_identifier_here"
      }
    }
  }
}
Option B: User Settings (Global)

This configuration applies to all VS Code projects:

  1. Open VS Code
  2. Press Ctrl+Shift+P (Windows/Linux) or Cmd+Shift+P (Mac)
  3. Type "Preferences: Open User Settings (JSON)"
  4. Add the ForceWeaver MCP configuration to your settings.json:
{
  "mcp.servers": {
    "forceweaver": {
      "command": "python3",
      "args": ["-m", "forceweaver_mcp_client"],
      "env": {
        "FORCEWEAVER_API_KEY": "fk_your_api_key_here",
        "FORCEWEAVER_BASE_URL": "https://mcp.forceweaver.com",
        "SALESFORCE_ORG_ID": "your_org_identifier_here"
      }
    }
  }
}

Step 4: Update Configuration Values

โš ๏ธ IMPORTANT: You must replace the placeholder values with your actual information:

Placeholder Replace With Example
fk_your_api_key_here Your actual ForceWeaver API key fk_1234567890abcdef...
your_org_identifier_here Your Salesforce org identifier production, sandbox, dev
https://mcp.forceweaver.com Backend URL (usually no change needed) https://mcp.forceweaver.com

Step 5: Configuration Examples by Operating System

๐ŸชŸ Windows Example (.vscode/mcp.json)
{
  "servers": {
    "forceweaver": {
      "command": "python",
      "args": ["-m", "forceweaver_mcp_client"],
      "env": {
        "FORCEWEAVER_API_KEY": "fk_abc123def456...",
        "FORCEWEAVER_BASE_URL": "https://mcp.forceweaver.com",
        "SALESFORCE_ORG_ID": "production"
      }
    }
  }
}
๐ŸŽ macOS Example (.vscode/mcp.json)
{
  "servers": {
    "forceweaver": {
      "command": "python3",
      "args": ["-m", "forceweaver_mcp_client"],
      "env": {
        "FORCEWEAVER_API_KEY": "fk_abc123def456...",
        "FORCEWEAVER_BASE_URL": "https://mcp.forceweaver.com",
        "SALESFORCE_ORG_ID": "production"
      }
    }
  }
}
๐Ÿง Linux Example (.vscode/mcp.json)
{
  "servers": {
    "forceweaver": {
      "command": "python3",
      "args": ["-m", "forceweaver_mcp_client"],
      "env": {
        "FORCEWEAVER_API_KEY": "fk_abc123def456...",
        "FORCEWEAVER_BASE_URL": "https://mcp.forceweaver.com",
        "SALESFORCE_ORG_ID": "production"
      }
    }
  }
}

Step 6: Restart VS Code

After saving your configuration:

  1. Save the mcp.json or settings.json file
  2. Close VS Code completely
  3. Reopen VS Code and your project
  4. Wait for GitHub Copilot to initialize (you'll see a status in the bottom bar)
  5. Start forceweaver MCP server

Step 7: Test the Integration

Now let's verify that ForceWeaver is working with GitHub Copilot:

  1. Open GitHub Copilot Chat (press Ctrl+Alt+I or click the Copilot icon)
  2. Type one of these test messages:
๐Ÿงช Test Messages
  • "Check the health of my Salesforce org"
  • "Run a ForceWeaver health check on my production org"
  • "Analyze my Salesforce Revenue Cloud configuration"
  • "What ForceWeaver tools are available?"

Step 8: Expected Results

If everything is working correctly, you should see:

โœ… Success Indicators
  • Copilot recognizes ForceWeaver commands
  • Health check results appear in chat
  • Detailed Salesforce analysis provided
  • Cost and execution time displayed
โŒ Common Issues
  • Python path incorrect
  • API key invalid or expired
  • Org identifier not found
  • Dependencies not installed

๐Ÿ”ง Troubleshooting Guide

Solutions:
  • Try "python3" instead of "python" in the command
  • Use full Python path: "C:\\Python\\python.exe" (Windows) or "/usr/bin/python3" (Mac/Linux)
  • Install Python from python.org
  • Add Python to your system PATH
  • Verify ForceWeaver MCP Client is installed: pip show forceweaver-mcp-server

Solutions:
  • Verify your API key starts with fk_
  • Check that the API key is active in your dashboard
  • Ensure no extra spaces or characters in the key
  • Generate a new API key if needed

Solutions:
  • Check your org identifier in the dashboard
  • Ensure the org is connected and active
  • Try a different org identifier
  • Re-authenticate your Salesforce org if needed

Solutions:
  • Verify ForceWeaver MCP Client is installed: pip show forceweaver-mcp-server
  • Test the client manually: python -m forceweaver_mcp_client --version
  • Check internet connectivity to https://mcp.forceweaver.com
  • Check VS Code's Output panel for error details
  • Ensure firewall allows HTTPS connections

๐Ÿ’ก Pro Tips

๐Ÿš€ Advanced Usage
  • Multiple Orgs: Use "List my orgs" to see all connected organizations
  • Specific Checks: Ask for "sharing model analysis" or "data integrity check"
  • Cost Tracking: Each request shows execution time and cost
  • Natural Language: Use conversational requests like "How healthy is my Salesforce setup?"

๐Ÿ“‹ Quick Reference

Command Description Example
Health Check Run comprehensive Salesforce analysis "Check my Salesforce org health"
Sharing Analysis Analyze sharing model and permissions "Analyze my sharing model"
Data Integrity Check for data quality issues "Check my data integrity"
Revenue Cloud Specific Revenue Cloud analysis "Analyze Revenue Cloud setup"

MCP Building Blocks

ForceWeaver MCP provides functionality through three core building blocks defined by the Model Context Protocol:

Tools Available

For AI Actions

AI models can discover and invoke tools to perform actions. Tool execution requires user approval.

  • โ€ข Model-controlled
  • โ€ข Require user approval
  • โ€ข Perform specific operations
Resources Planned

For Context Data

Structured access to information from files, APIs, databases, or other sources for AI context.

  • โ€ข Application-controlled
  • โ€ข URI-based identification
  • โ€ข Support templates
Prompts Planned

For Interaction Templates

Reusable templates that define expected inputs and interaction patterns for common workflows.

  • โ€ข User-controlled
  • โ€ข Parameterized templates
  • โ€ข Streamlined workflows
Current ForceWeaver Capabilities

ForceWeaver currently implements Tools for performing Salesforce health checks and analysis. Resources and Prompts are planned for future releases to provide richer context access and workflow templates.

Tools

Tools enable AI models to perform actions through server-implemented functions. Each tool defines a specific operation with typed inputs and outputs, requiring user approval for execution.

Currently Available Tools

ForceWeaver currently provides 1 tool for Salesforce health checking and analysis. Additional tools for configuration management, data operations, and advanced analytics are planned for future releases.

Protocol Operations

METHOD tools/list

Discover available tools with their schemas and descriptions

METHOD tools/call

Execute a specific tool with provided arguments

Revenue Cloud Health Check Tool

TOOL revenue_cloud_health_check

Performs comprehensive health checks on Salesforce Revenue Cloud configurations.

Parameters
Parameter Type Required Description
forceweaver_api_key string โœ… Your ForceWeaver API key (starts with fk_)
salesforce_org_id string โœ… Salesforce org identifier (e.g., 'production', 'sandbox')
check_types array โŒ Types of checks to perform (see below)
api_version string โŒ Salesforce API version (default: v64.0)
Available Check Types
  • basic_org_info - Organization details and setup validation
  • sharing_model - Organization-Wide Default sharing settings for PCM objects
  • bundle_analysis - Bundle hierarchy depth, component limits, and circular dependency analysis
  • data_integrity - Attribute picklist integrity and orphaned record detection
Multi-Org Workflow

For users with multiple Salesforce organizations, first list your connected orgs to get the available identifiers:

1. List available organizations:
   POST /api/v1.0/orgs/list with Bearer token

2. Use the org_id from the response in your health check:
   revenue_cloud_health_check(org_id="production")
Example Usage (AI Agent)
Please run a health check on my production Salesforce org using my ForceWeaver API key fk_abc123... 
I want to check the basic org info, sharing model, and data integrity.

Note: If you have multiple orgs, first list them using the Organizations API to get the correct org_id.
Example Response
๐Ÿฅ ForceWeaver Revenue Cloud Health Check Results

๐Ÿ“Š Overall Score: 85/100

โœ… Basic Org Info (Score: 90/100)
โ€ข Organization: Acme Corp Production
โ€ข Type: Production
โ€ข Users: 150
โ€ข Currency: USD properly configured

โœ… Sharing Model (Score: 88/100)  
โ€ข Account sharing: Private
โ€ข Opportunity sharing: Private with role hierarchy
โ€ข 2 sharing rules configured
โ€ข โš ๏ธ Recommendation: Review guest user sharing settings

โš ๏ธ Data Integrity (Score: 78/100)
โ€ข Found 15 duplicate accounts
โ€ข 3 orphaned contacts detected  
โ€ข Custom field validation: Good
โ€ข ๐Ÿ”ง Recommendation: Run duplicate management process

๐Ÿ’ฐ Cost: $0.03 | โฑ๏ธ Execution: 1.2s

REST API

REST APIs provide programmatic access to ForceWeaver capabilities for traditional applications.

Organizations API

Manage and list your connected Salesforce organizations for multi-org health checking.

POST /api/v1.0/orgs/list

List all connected Salesforce organizations for your account. Use this to get org identifiers for health checks.

Authentication
Authorization: Bearer fk_your_api_key_here
Request Body
{
  "username": "user@example.com"
}
Success Response 200 OK
{
  "success": true,
  "username": "user@example.com",
  "organizations": [
    {
      "org_id": "production",
      "org_name": "Acme Corp Production",
      "instance_url": "https://acme.my.salesforce.com",
      "salesforce_org_id": "00D000000000001EAA",
      "is_sandbox": false,
      "oauth_completed": true,
      "last_connected": "2024-01-15T10:30:00Z",
      "usage_count": 42,
      "status": "active"
    },
    {
      "org_id": "sandbox",
      "org_name": "Acme Corp Sandbox",
      "instance_url": "https://acme--sandbox.sandbox.my.salesforce.com",
      "salesforce_org_id": "00D000000000002EAA",
      "is_sandbox": true,
      "oauth_completed": true,
      "last_connected": "2024-01-14T15:22:00Z",
      "usage_count": 18,
      "status": "active"
    }
  ],
  "total_count": 2,
  "execution_time_ms": 45
}
Error Response 401 Unauthorized
{
  "error": "Invalid API key",
  "message": "API key not found or inactive"
}
cURL Example
curl -X POST https://mcp.forceweaver.com/api/v1.0/orgs/list \
  -H "Authorization: Bearer fk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "username": "user@example.com"
  }'

Health Check API

Direct REST API access to Salesforce health checking functionality. Perfect for developers who want to integrate health checks into their applications without using the MCP protocol.

POST /api/v1.0/health/check

Run comprehensive Salesforce health checks and get detailed results in JSON format.

Authentication
Authorization: Bearer fk_your_api_key_here
Request Body
{
  "org_id": "production",
  "check_types": [
    "basic_org_info",
    "sharing_model",
    "data_integrity"
  ],
  "api_version": "v64.0"
}
Parameters
Parameter Type Required Description
org_id string โœ… Salesforce org identifier from your connected orgs
check_types array โŒ Types of checks to perform (default: basic_org_info, sharing_model)
api_version string โŒ Salesforce API version (default: v64.0)
Success Response 200 OK
{
  "success": true,
  "org_id": "production",
  "org_name": "Acme Corp Production",
  "check_types": [
    "basic_org_info",
    "sharing_model",
    "data_integrity"
  ],
  "results": {
    "basic_org_info": {
      "status": "success",
      "score": 90,
      "details": [
        "Organization: Acme Corp Production",
        "Type: Production",
        "Users: 150",
        "Currency: USD properly configured"
      ],
      "recommendations": []
    },
    "sharing_model": {
      "status": "success", 
      "score": 88,
      "details": [
        "Account sharing: Private",
        "Opportunity sharing: Private with role hierarchy",
        "2 sharing rules configured"
      ],
      "recommendations": [
        "Review guest user sharing settings"
      ]
    },
    "data_integrity": {
      "status": "warning",
      "score": 78,
      "details": [
        "Found 15 duplicate accounts",
        "3 orphaned contacts detected",
        "Custom field validation: Good"
      ],
      "recommendations": [
        "Run duplicate management process"
      ]
    },
    "overall_score": 85
  },
  "summary": {
    "overall_score": 85,
    "checks_performed": 3,
    "execution_time_ms": 1250,
    "cost_cents": 3
  }
}
Error Response 400 Bad Request
{
  "error": "Invalid check types",
  "message": "Invalid check types: ['invalid_check']",
  "valid_check_types": [
    "basic_org_info",
    "sharing_model",
    "bundle_analysis",
    "data_integrity",
    "performance_metrics",
    "security_audit"
  ]
}
cURL Example
curl -X POST https://mcp.forceweaver.com/api/v1.0/health/check \
  -H "Authorization: Bearer fk_your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "org_id": "production",
    "check_types": ["basic_org_info", "sharing_model", "data_integrity"],
    "api_version": "v64.0"
  }'
GET /api/v1.0/health/check-types

Get a list of all available health check types with descriptions and pricing.

Success Response 200 OK
{
  "success": true,
  "check_types": [
    {
      "name": "basic_org_info",
      "description": "Organization details and setup validation",
      "cost_cents": 1,
      "category": "basic"
    },
    {
      "name": "sharing_model",
      "description": "Sharing rules and permissions analysis",
      "cost_cents": 1,
      "category": "basic"
    },
    {
      "name": "bundle_analysis",
      "description": "Revenue Cloud bundle configuration review",
      "cost_cents": 1,
      "category": "basic"
    },
    {
      "name": "data_integrity",
      "description": "Data quality and consistency validation",
      "cost_cents": 1,
      "category": "basic"
    },
    {
      "name": "performance_metrics",
      "description": "System performance analysis and optimization",
      "cost_cents": 5,
      "category": "premium"
    },
    {
      "name": "security_audit",
      "description": "Comprehensive security configuration review",
      "cost_cents": 5,
      "category": "premium"
    }
  ],
  "total_available": 6
}
cURL Example
curl https://mcp.forceweaver.com/api/v1.0/health/check-types
Complete Health Check Workflow

Step-by-step example showing how to discover organizations and run health checks:

import requests

api_key = "fk_your_api_key_here"
base_url = "https://mcp.forceweaver.com/api/v1.0"
headers = {"Authorization": f"Bearer {api_key}"}

# Step 1: List available organizations
orgs_response = requests.post(
    f"{base_url}/orgs/list",
    headers=headers,
    json={"username": "user@example.com"}
)

# Step 2: Get available check types (optional)
check_types_response = requests.get(f"{base_url}/health/check-types")
available_checks = check_types_response.json()["check_types"]

# Step 3: Run health check on first organization
orgs = orgs_response.json()["organizations"]
if orgs:
    org_id = orgs[0]["org_id"]
    
    health_response = requests.post(
        f"{base_url}/health/check",
        headers=headers,
        json={
            "org_id": org_id,
            "check_types": ["basic_org_info", "sharing_model", "data_integrity"],
            "api_version": "v64.0"
        }
    )
    
    results = health_response.json()
    print(f"๐Ÿฅ Health Check Results for {results['org_name']}")
    print(f"๐Ÿ“Š Overall Score: {results['summary']['overall_score']}/100")
    print(f"๐Ÿ’ฐ Cost: ${results['summary']['cost_cents']/100:.2f}")
    print(f"โฑ๏ธ Execution Time: {results['summary']['execution_time_ms']}ms")
    
    # Display individual check results
    for check_name, check_result in results["results"].items():
        if check_name != "overall_score":
            status_emoji = "โœ…" if check_result["status"] == "success" else "โš ๏ธ"
            print(f"\n{status_emoji} {check_name.replace('_', ' ').title()}")
            print(f"   Score: {check_result['score']}/100")
            
            for detail in check_result["details"][:3]:  # Show first 3 details
                print(f"   โ€ข {detail}")
                
            if check_result["recommendations"]:
                print(f"   ๐Ÿ”ง Recommendations:")
                for rec in check_result["recommendations"]:
                    print(f"      - {rec}")

print("\n๐ŸŽฏ Health check complete!")

Internal API

These endpoints are used internally by the MCP server but can also be accessed directly.

POST /api/v1.0/internal/validate

Validates an API key and retrieves Salesforce credentials for a specific organization.

Request Body
{
  "api_key": "fk_1234567890abcdef1234567890abcdef",
  "org_id": "production"
}
Success Response 200 OK
{
  "valid": true,
  "user_id": "user-uuid-here",
  "api_key_id": "key-uuid-here", 
  "org_id": "production",
  "salesforce_credentials": {
    "instance_url": "https://company.my.salesforce.com",
    "client_id": "3MVG9...",
    "client_secret": "xxx",
    "access_token": "00D...",
    "refresh_token": "5Aep..."
  }
}
Error Response 401 Unauthorized
{
  "error": "Invalid API key",
  "message": "API key not found or inactive"
}
cURL Example
curl -X POST https://mcp.forceweaver.com/api/v1.0/internal/validate \
  -H "Content-Type: application/json" \
  -d '{
    "api_key": "fk_1234567890abcdef1234567890abcdef",
    "org_id": "production"
  }'
POST /api/v1.0/internal/usage

Logs API usage for billing and analytics purposes.

Request Body
{
  "user_id": "user-uuid-here",
  "api_key_id": "key-uuid-here",
  "salesforce_org_id": "org-uuid-here",
  "tool_name": "revenue_cloud_health_check",
  "execution_time_ms": 1250,
  "success": true,
  "cost_cents": 3,
  "request_id": "req_abc123"
}
Success Response 200 OK
{
  "logged": true,
  "usage_id": "usage-uuid-here"
}
cURL Example
curl -X POST https://mcp.forceweaver.com/api/v1.0/internal/usage \
  -H "Content-Type: application/json" \
  -d '{
    "user_id": "user-uuid-here",
    "api_key_id": "key-uuid-here", 
    "tool_name": "revenue_cloud_health_check",
    "execution_time_ms": 1250,
    "success": true,
    "cost_cents": 3
  }'
GET /api/v1.0/internal/health

Health check endpoint for monitoring service availability.

Success Response 200 OK
{
  "status": "healthy",
  "service": "ForceWeaver Internal API",
  "version": "1.0.0",
  "timestamp": 1703123456.789
}
Error Response 500 Internal Server Error
{
  "status": "unhealthy", 
  "error": "Database connection failed"
}
cURL Example
curl https://mcp.forceweaver.com/api/v1.0/internal/health

Future API Endpoints

These endpoints are planned for future releases.
API Keys Management
  • GET /api/v1/keys - List API keys
  • POST /api/v1/keys - Create API key
  • DELETE /api/v1/keys/{id} - Delete API key
Organizations Management
  • GET /api/v1/orgs - List orgs
  • POST /api/v1/orgs - Connect new org
  • DELETE /api/v1/orgs/{id} - Remove org
Usage & Billing
  • GET /api/v1/usage - Get usage stats
  • GET /api/v1/billing - Get billing info
Authentication
  • POST /api/v1/auth/login - Login
  • POST /api/v1/auth/register - Register

Error Handling

ForceWeaver MCP uses conventional HTTP response codes to indicate the success or failure of API requests.

HTTP Status Codes

200 OK - Request successful
400 Bad Request - Invalid parameters
401 Unauthorized - Invalid API key
429 Too Many Requests - Rate limit exceeded
500 Internal Server Error - Server error

Error Response Format

{
  "error": "Invalid API key",
  "message": "API key not found or inactive",
  "code": "INVALID_API_KEY",
  "timestamp": "2024-01-15T10:30:00Z"
}

Rate Limits

API requests are subject to rate limits to ensure fair usage and system stability.

Endpoint Rate Limit Burst Limit
MCP Tools 100 calls/hour 10 calls/minute
Organizations API 100 calls/hour 5 calls/minute
Health Check API 50 calls/hour 3 calls/minute
Internal API 1000 calls/hour 50 calls/minute
Service Health Check Unlimited -
Rate Limit Headers

Response headers include:
X-RateLimit-Limit
X-RateLimit-Remaining
X-RateLimit-Reset

Need Help?

๐Ÿ“ง Support

support@forceweaver.com

๐ŸŒ Website

mcp.forceweaver.com

๐Ÿ“š Status

System Status