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
- Sign up at mcp.forceweaver.com
- Connect your Salesforce organizations via OAuth
- Generate API keys in your Dashboard
API Key Format
fk_1234567890abcdef1234567890abcdef
Getting Started
Follow this step-by-step guide to get ForceWeaver MCP up and running with your AI agent.
Step 1: Setup Your Account
- Visit mcp.forceweaver.com
- Click "Sign Up" and create your account
- Log in to access your dashboard
- Go to Dashboard โ API Keys
- Click "Create New API Key"
- Enter a descriptive name (e.g., "VS Code MCP", "Claude Desktop")
- Copy and save your API key securely - it's only shown once!
fk_
and be about 40 characters long.
Step 2: Connect Your Salesforce Organization
Salesforce OAuth Setup
- Go to Dashboard โ Salesforce Organizations
- Click "Connect New Salesforce Org"
- Enter your org details:
- Org Identifier: A unique name (e.g., "production", "sandbox")
- Choose if it's a Production/Developer Edition or Sandbox org
- Click "Connect to Salesforce" to start the OAuth flow
- Sign in with your Salesforce username and password
- Authorize ForceWeaver to access your org
- You'll be redirected back to your ForceWeaver dashboard
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.
- "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
~/.config/claude/claude_desktop_config.json
%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
- 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
- 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
- Go to mcp.forceweaver.com/dashboard/keys
- Click "Create New API Key"
- Name it "VS Code Copilot"
- Copy the key (starts with
fk_
)
๐ข Org Identifier
- Go to mcp.forceweaver.com/dashboard/orgs
- Find your Salesforce org
- 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:
- Open your project in VS Code
- Create a
.vscode
folder in your project root (if it doesn't exist) - Create
.vscode/mcp.json
- 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:
- Open VS Code
- Press
Ctrl+Shift+P
(Windows/Linux) orCmd+Shift+P
(Mac) - Type "Preferences: Open User Settings (JSON)"
- 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:
- Save the mcp.json or settings.json file
- Close VS Code completely
- Reopen VS Code and your project
- Wait for GitHub Copilot to initialize (you'll see a status in the bottom bar)
- Start forceweaver MCP server
Step 7: Test the Integration
Now let's verify that ForceWeaver is working with GitHub Copilot:
- Open GitHub Copilot Chat (press
Ctrl+Alt+I
or click the Copilot icon) - 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
- 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
- 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
- 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
- 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
tools/list
Discover available tools with their schemas and descriptions
tools/call
Execute a specific tool with provided arguments
Revenue Cloud Health Check 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 validationsharing_model
- Organization-Wide Default sharing settings for PCM objects
bundle_analysis
- Bundle hierarchy depth, component limits, and circular dependency analysisdata_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.
/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.
/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"
}'
/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.
/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"
}'
/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
}'
/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
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