Babel Licensing MCP Server
The Babel Licensing MCP Server is a Python-based Model Context Protocol (MCP) server that exposes all Babel Licensing API functions as tools. This enables AI assistants like Claude to interact directly with your Babel Licensing system for license management, customer operations, product management, and more.
What is MCP?
The Model Context Protocol (MCP) is an open standard that enables AI assistants to securely connect to external systems and data sources. MCP servers act as bridges between AI models and your business systems, allowing natural language interactions with APIs, databases, and tools.
Features
- Complete API Coverage: Exposes all 90+ Babel Licensing API endpoints as MCP tools
- Type-Safe Configuration: Pydantic-based configuration with automatic validation
- Authentication Support: Supports both API Key and Bearer Token authentication
- Daily Log Rotation: Automatic logging to
logs/directory with daily file rotation - Comprehensive Toolset: Includes tools for:
- Authentication and user management
- License operations (activate, deactivate, validate, request, release)
- Customer and contact management
- Product and order management
- License templates and tokens
- Webhooks and event management
- Reports and logging
- Email notifications
- System settings and configuration
Requirements
- Python 3.10 or higher
- Babel Licensing API access (base URL and credentials)
- An MCP-compatible client (e.g., Claude Desktop)
Installation
Quick Start
macOS / Linux
- Extract the archive and navigate to the directory:
unzip babel-licensing-mcp-*.zip
cd babel-licensing-mcp-*- Run the setup script:
chmod +x setup.sh
./setup.sh- Configure your environment:
# Edit .env file with your Babel Licensing API credentials
nano .envWindows
-
Extract the ZIP archive and navigate to the directory in PowerShell
-
Enable PowerShell script execution (if needed):
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser- Run the setup script:
.\setup.ps1- Configure your environment:
# Edit .env file with your Babel Licensing API credentials
notepad .envManual Installation
- Create a virtual environment:
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install dependencies:
pip install -r requirements.txt- Configure environment variables:
cp .env.example .env
# Edit .env with your actual credentialsConfiguration
The server requires the following environment variables (configured in .env):
# Babel Licensing API Base URL
BABEL_API_BASE_URL=https://your-babel-licensing-server.com
# Authentication - Use ONE of the following:
# Option 1: API Key
BABEL_API_KEY=your-api-key-here
# Option 2: Bearer Token
# BABEL_BEARER_TOKEN=your-bearer-token-here
# Optional Configuration
# BABEL_VERIFY_SSL=true # Set to false for self-signed certificates
# BABEL_TIMEOUT=30 # Request timeout in seconds
# BABEL_CONTENT_TYPE=application/json # Content type: application/json or application/toon
# DEBUG=false # Enable debug loggingContent Type Configuration
The server supports two content types for API requests:
application/json(default): Standard JSON formatapplication/toon: TOON format for specialized use cases
To use TOON format, set the BABEL_CONTENT_TYPE environment variable:
BABEL_CONTENT_TYPE=application/toonThe client will automatically set the appropriate Content-Type and Accept headers for all API requests.
Usage
Running the MCP Server
Option 1: Using the installed command
babel-licensing-mcpOption 2: Direct execution
python src/server.pyConfiguring with AI Clients
The Babel Licensing MCP Server can be used with any MCP-compatible AI client, including Claude Desktop and Claude Code.
Configuring with Claude Desktop
Add the following to your Claude Desktop configuration file:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json
Recommended Configuration (Direct Path)
{
"mcpServers": {
"babel-licensing": {
"command": "/absolute/path/to/babel-licensing-mcp/venv/bin/python",
"args": [
"/absolute/path/to/babel-licensing-mcp/src/server.py"
],
"env": {
"BABEL_API_BASE_URL": "https://your-babel-server.com",
"BABEL_API_KEY": "your-api-key-here"
}
}
}
}Example with actual paths (macOS):
{
"mcpServers": {
"babel-licensing": {
"command": "/Users/username/Projects/babel-licensing-mcp/venv/bin/python",
"args": [
"/Users/username/Projects/babel-licensing-mcp/src/server.py"
],
"env": {
"BABEL_API_BASE_URL": "https://api.babel-licensing.com",
"BABEL_API_KEY": "abc123def456"
}
}
}
}Example with actual paths (Windows):
{
"mcpServers": {
"babel-licensing": {
"command": "C:\\Users\\username\\Projects\\babel-licensing-mcp\\venv\\Scripts\\python.exe",
"args": [
"C:\\Users\\username\\Projects\\babel-licensing-mcp\\src\\server.py"
],
"env": {
"BABEL_API_BASE_URL": "https://api.babel-licensing.com",
"BABEL_API_KEY": "abc123def456"
}
}
}
}Note: Replace /absolute/path/to/ with the actual path to your project directory. You can find it by running pwd (macOS/Linux) or cd (Windows) in the project folder.
Alternative: Using .env file
Instead of specifying environment variables in the Claude Desktop config, you can create a .env file in the project root:
# Copy the example file
cp .env.example .env
# Edit with your credentials
BABEL_API_BASE_URL=https://your-babel-server.com
BABEL_API_KEY=your-api-key-hereThen use a simpler Claude Desktop configuration:
{
"mcpServers": {
"babel-licensing": {
"command": "/absolute/path/to/babel-licensing-mcp/venv/bin/python",
"args": [
"/absolute/path/to/babel-licensing-mcp/src/server.py"
]
}
}
}After Configuration:
- Completely quit and restart Claude Desktop
- Start a new conversation
- Look for the 🔨 tools icon indicating MCP servers are connected
- Ask Claude: “What Babel Licensing tools do you have access to?”
Configuring with Claude Code
Claude Code is a VS Code extension that provides AI assistance directly in your development environment. To use the Babel Licensing MCP Server with Claude Code:
Step 1: Install Claude Code
Install the Claude Code extension from the VS Code marketplace:
- Open VS Code
- Go to Extensions (Cmd+Shift+X on macOS, Ctrl+Shift+X on Windows/Linux)
- Search for “Claude Code”
- Click Install
Step 2: Add MCP Server to Settings
Open your VS Code settings and add the MCP server configuration:
Option A: Workspace Settings (recommended for project-specific usage)
Create or edit .vscode/settings.json in your workspace:
{
"claude.mcpServers": {
"babel-licensing": {
"command": "/absolute/path/to/babel-licensing-mcp/venv/bin/python",
"args": [
"/absolute/path/to/babel-licensing-mcp/src/server.py"
],
"env": {
"BABEL_API_BASE_URL": "https://licensing.example.com",
"BABEL_API_KEY": "your-api-key-here"
}
}
}
}Option B: User Settings (for global access across all workspaces)
- Open Command Palette (Cmd+Shift+P on macOS, Ctrl+Shift+P on Windows/Linux)
- Type “Preferences: Open User Settings (JSON)”
- Add the
claude.mcpServersconfiguration:
{
"claude.mcpServers": {
"babel-licensing": {
"command": "/Users/username/Projects/babel-licensing-mcp/venv/bin/python",
"args": [
"/Users/username/Projects/babel-licensing-mcp/src/server.py"
],
"env": {
"BABEL_API_BASE_URL": "https://licensing.example.com",
"BABEL_API_KEY": "your-api-key-here"
}
}
}
}Step 3: Using Environment Variables
You can reference environment variables in your configuration:
{
"claude.mcpServers": {
"babel-licensing": {
"command": "/path/to/babel-licensing-mcp/venv/bin/python",
"args": ["/path/to/babel-licensing-mcp/src/server.py"],
"env": {
"BABEL_API_BASE_URL": "${env:BABEL_URL}",
"BABEL_API_KEY": "${env:BABEL_KEY}"
}
}
}
}Then set the environment variables in your shell before starting VS Code:
# macOS/Linux
export BABEL_URL="https://licensing.example.com"
export BABEL_KEY="your-api-key-here"
code .
# Windows PowerShell
$env:BABEL_URL = "https://licensing.example.com"
$env:BABEL_KEY = "your-api-key-here"
code .Step 4: Using .env File (simplest approach)
Configure the .env file in the MCP server directory with your credentials, then use a minimal configuration:
{
"claude.mcpServers": {
"babel-licensing": {
"command": "/path/to/babel-licensing-mcp/venv/bin/python",
"args": ["/path/to/babel-licensing-mcp/src/server.py"]
}
}
}The server will automatically load settings from the .env file.
Step 5: Platform-Specific Path Examples
macOS:
{
"claude.mcpServers": {
"babel-licensing": {
"command": "/Users/username/Projects/babel-licensing-mcp/venv/bin/python",
"args": [
"/Users/username/Projects/babel-licensing-mcp/src/server.py"
]
}
}
}Windows:
{
"claude.mcpServers": {
"babel-licensing": {
"command": "C:\\Users\\username\\Projects\\babel-licensing-mcp\\venv\\Scripts\\python.exe",
"args": [
"C:\\Users\\username\\Projects\\babel-licensing-mcp\\src\\server.py"
]
}
}
}Linux:
{
"claude.mcpServers": {
"babel-licensing": {
"command": "/home/username/projects/babel-licensing-mcp/venv/bin/python",
"args": [
"/home/username/projects/babel-licensing-mcp/src/server.py"
]
}
}
}Step 6: Using Relative Paths
For workspace-specific configurations, you can use VS Code variables:
{
"claude.mcpServers": {
"babel-licensing": {
"command": "${workspaceFolder}/../babel-licensing-mcp/venv/bin/python",
"args": [
"${workspaceFolder}/../babel-licensing-mcp/src/server.py"
],
"cwd": "${workspaceFolder}/../babel-licensing-mcp"
}
}
}This is useful when the MCP server is in a sibling directory to your workspace.
Step 7: Verify Installation
After configuring, reload VS Code to activate the MCP server:
- Open Command Palette (Cmd+Shift+P / Ctrl+Shift+P)
- Type “Developer: Reload Window”
- Press Enter
To verify the server is working:
- Open the Claude panel in VS Code
- Start a new conversation
- Ask: “What Babel Licensing capabilities do you have?”
- Claude should list all 86 available tools
Claude Code Usage Tips:
-
Context-Aware Requests: Claude Code can see your current file and workspace, so you can ask:
- “Based on this code, create a license for this customer”
- “Generate a license activation call for the product in this file”
-
Code Generation: Ask Claude to generate code that uses the Babel Licensing API:
- “Write a C# method to activate a license using these parameters”
- “Create a Python script to query all active licenses”
-
Inline Assistance: Select code and ask Claude to:
- “Check if this license key is valid”
- “Find the customer associated with this user key”
-
Multi-File Operations: Claude can help coordinate licensing across multiple files:
- “Update license keys in all configuration files”
- “Find all hardcoded license keys in this project”
Troubleshooting Claude Code:
If the MCP server doesn’t connect:
- Check Extension Status: Ensure Claude Code extension is activated
- Verify Python Path: Confirm the virtual environment path is correct
- Check Logs: View Claude Code output in VS Code Output panel
- Reload Window: Use “Developer: Reload Window” after config changes
- Check Permissions: Ensure the Python executable has execute permissions
Multiple Environment Setup:
You can configure different Babel Licensing environments:
{
"claude.mcpServers": {
"babel-licensing-prod": {
"command": "/path/to/venv/bin/python",
"args": ["/path/to/src/server.py"],
"env": {
"BABEL_API_BASE_URL": "https://licensing.production.com",
"BABEL_API_KEY": "${env:BABEL_PROD_KEY}"
}
},
"babel-licensing-dev": {
"command": "/path/to/venv/bin/python",
"args": ["/path/to/src/server.py"],
"env": {
"BABEL_API_BASE_URL": "https://licensing.dev.com",
"BABEL_API_KEY": "${env:BABEL_DEV_KEY}"
}
}
}
}This allows you to switch between production and development environments when working with Claude.
Logging
The server automatically logs all operations to daily log files in the logs/ directory:
- Location:
logs/babel_licensing_YYYYMMDD.log - Format: Timestamped logs with level and module information
- Rotation: Automatically creates a new file each day
- Output: Logs are written to both file and console
Example log file: logs/babel_licensing_20251111.log
2025-11-11 10:30:15 - server - INFO - MCP server starting...
2025-11-11 10:30:16 - server - INFO - Babel Licensing client initialized
2025-11-11 10:31:22 - server - INFO - Tool called: babel_get_customersAvailable Tools
The server exposes 86 tools organized into the following categories:
Note: Authentication is handled automatically via API Key or Bearer Token configured in environment variables. Interactive login tools are not required.
Licensing Operations (7 tools)
babel_activate_license- Activate a licensebabel_deactivate_license- Deactivate a licensebabel_request_license- Request a licensebabel_release_license- Release a licensebabel_license_heartbeat- Send license heartbeatbabel_validate_license- Validate a licensebabel_get_license_info- Get license information
Management
API Keys (4 tools)
babel_get_api_keys- List API keysbabel_insert_api_key- Create new API keybabel_update_api_key- Update API keybabel_delete_api_key- Delete API key
Users (7 tools)
babel_get_users- List usersbabel_insert_user- Create userbabel_update_user- Update userbabel_delete_user- Delete userbabel_get_user_roles- Get user rolesbabel_add_user_to_roles- Add user to rolesbabel_remove_user_from_roles- Remove user from roles
Customers (7 tools)
babel_get_customers- List customersbabel_insert_customer- Create customerbabel_update_customer- Update customerbabel_delete_customer- Delete customerbabel_get_customer_contacts- Get customer contactsbabel_get_customer_orders- Get customer ordersbabel_get_customer_licenses- Get customer licenses
Products (15 tools)
- Product management (get, insert, update, delete)
- Product releases management
- Release assemblies management
- License templates for releases
Orders (9 tools)
- Order management (get, insert, update, delete)
- Order products management
- Order licenses retrieval
Licenses (9 tools)
- License management (get, insert, update, delete)
- License tokens management
- License traces
- License templates
Webhooks (9 tools)
- Webhook subscriptions management
- Event types retrieval
- Webhook testing
- Event management
Additional Management Tools
- Assemblies (4 tools)
- Contacts (4 tools)
- Resources (4 tools)
- Reports (3 tools)
- Logging (3 tools)
- Settings (2 tools)
- Email (2 tools)
- Server Info (1 tool)
Working with the API
Data Format for Insert/Update Operations
When using tools that create or update resources (tools starting with babel_insert_ or babel_update_), the client automatically wraps your data in the appropriate request format required by the Babel Licensing API.
You only need to provide the raw data - the wrapping is handled automatically.
Examples
Creating a new customer:
// You provide:
{
"customer_data": {
"name": "Acme Corporation",
"email": "contact@acme.com"
}
}
// The client automatically wraps it as:
{
"customer": {
"name": "Acme Corporation",
"email": "contact@acme.com"
}
}Creating a new user:
// You provide:
{
"user_data": {
"userName": "johndoe",
"email": "john@example.com",
"password": "SecureP@ssw0rd"
}
}
// The client automatically wraps it as:
{
"user": {
"userName": "johndoe",
"email": "john@example.com"
},
"password": "SecureP@ssw0rd"
}Updating a license:
// You provide:
{
"license_data": {
"id": 123,
"revoked": false,
"description": "Updated description"
}
}
// The client automatically wraps it as:
{
"license": {
"id": 123,
"revoked": false,
"description": "Updated description"
}
}Query Parameters
Many GET endpoints support the following query parameters:
select- Comma-separated list of field names to include in responsefilter- Filtering criteria using .NET syntax (see Filter Syntax below)include- Comma-separated list of related objects to include (see Include Parameter below)sort- Field name with optional ‘asc’ or ‘desc’take- Pagination limit (page size)skip- Pagination offset
Include Parameter
The include parameter allows you to fetch related objects in a single request.
IMPORTANT Rules:
- Use PascalCase names (capitalized):
Customer,Order,Product(NOTcustomer,order,product) - MUST add included objects to select - include them in both parameters
- Multiple objects: separate with comma without spaces
Examples:
// Correct - Get licenses with customer and order objects
{
"params": {
"select": "id,licenseId,licenseType,createdAt,customerId,orderId,Customer,Order", // Include Customer,Order here
"include": "Customer,Order" // PascalCase, no spaces
}
}
// Wrong - lowercase names
{
"params": {
"select": "id,licenseId,customer,order", // L Lowercase
"include": "customer,order" // L Will fail
}
}
// Wrong - missing from select
{
"params": {
"select": "id,licenseId,licenseType", // L Missing Customer,Order
"include": "Customer,Order" // Objects won't be returned!
}
}Available Include Options:
babel_get_licenses: Product, Order, Customer, Template, Licenseebabel_get_customers: Contacts, Orders, Licensesbabel_get_orders: Customer, Reseller, Products, Licensesbabel_get_products: Releases, Ordersbabel_get_users: Roles, Settings, Customerbabel_get_api_keys: Ownerbabel_get_all_license_tokens: License, NodeLockedLicensebabel_get_license_templates: Product
Filter Syntax
The API uses .NET filter syntax, NOT OData standard.
Comparison Operators:
| Operator | Description | Example |
|---|---|---|
>= | Greater than or equal | createdAt >= "2025-11-11T00:00:00" |
<= | Less than or equal | expireDate <= "2025-12-31T23:59:59" |
> | Greater than | id > 100 |
< | Less than | id < 1000 |
== | Equal | revoked == false |
!= | Not equal | status != "expired" |
Logical Operators:
| Operator | Description | Example |
|---|---|---|
&& | Logical AND | revoked == false && expireDate >= "2025-01-01" |
|| | Logical OR | status == "active" || status == "trial" |
! | Negation (NOT) | !revoked or !licenseType.Contains("Trial") |
String Functions:
| Function | Description | Example |
|---|---|---|
Contains() | Check if string contains substring | licenseType.Contains("Ultimate") |
StartsWith() | Check if string starts with substring | userKey.StartsWith("ABC") |
EndsWith() | Check if string ends with substring | licenseeEmail.EndsWith("@example.com") |
Complex Filter Examples:
# Active licenses of Ultimate type created after Nov 11
revoked == false && licenseType.Contains("Ultimate") && createdAt >= "2025-11-11T00:00:00"
# Exclude Enterprise licenses
!licenseType.Contains("Enterprise")
# User keys starting with ABC or XYZ
userKey.StartsWith("ABC") || userKey.StartsWith("XYZ")
# Expired licenses excluding trial
expireDate < "2025-01-01T00:00:00" && !licenseType.Contains("Trial")IMPORTANT: Do NOT use OData syntax (eq, ne, gt, lt, and, or). These will not work.
Sort Parameter:
The sort parameter accepts:
- Field name with direction:
createdAt desc(descending) - Field name with direction:
createdAt asc(ascending) - Field name only:
createdAt(defaults to ascending)
Complete Example:
{
"params": {
"filter": "revoked == false && licenseType.Contains(\"Ultimate\") && expireDate >= \"2025-01-01T00:00:00\"",
"select": "id,licenseId,userKey,expireDate,licenseType",
"take": 10,
"skip": 0,
"sort": "createdAt desc"
}
}Examples
Activating a License
Ask Claude:
“Activate a license with user key ABC-123-DEF, product code PROD001, and hardware ID HW-12345”
Claude will use the babel_activate_license tool:
{
"tool": "babel_activate_license",
"arguments": {
"license_data": {
"userKey": "ABC-123-DEF",
"productCode": "PROD001",
"hardwareId": "HW-12345"
}
}
}Getting Customers
Ask Claude:
“Show me the first 10 reseller customers, sorted by company name”
Claude will use the babel_get_customers tool:
{
"tool": "babel_get_customers",
"arguments": {
"params": {
"filter": "isReseller == true",
"take": 10,
"sort": "company asc"
}
}
}Creating a Webhook Subscription
Ask Claude:
“Create a webhook subscription for license activation and deactivation events pointing to https://example.com/webhook ”
Claude will use the babel_create_webhook_subscription tool:
{
"tool": "babel_create_webhook_subscription",
"arguments": {
"subscription_data": {
"url": "https://example.com/webhook",
"events": ["license.activated", "license.deactivated"],
"isActive": true
}
}
}Complex Query Example
Ask Claude:
“Show me all Ultimate licenses created after November 11, 2025 that are not revoked, including customer and order details, sorted by creation date”
Claude will construct a query like:
{
"tool": "babel_get_licenses",
"arguments": {
"params": {
"filter": "revoked == false && licenseType.Contains(\"Ultimate\") && createdAt >= \"2025-11-11T00:00:00\"",
"select": "id,licenseId,userKey,expireDate,licenseType,createdAt,Customer,Order",
"include": "Customer,Order",
"sort": "createdAt desc"
}
}
}Troubleshooting
Connection Issues
- Verify your
BABEL_API_BASE_URLis correct - Ensure your API key or bearer token is valid
- Check network connectivity to the Babel Licensing server
- Review server logs in the
logs/directory for detailed error messages
SSL Certificate Issues
If you encounter SSL certificate verification errors (especially with self-signed certificates):
- Set
BABEL_VERIFY_SSL=falsein your.envfile or environment configuration - For Claude Desktop, add it to the
envsection:{ "mcpServers": { "babel-licensing": { "command": "/path/to/venv/bin/python", "args": ["/path/to/src/server.py"], "env": { "BABEL_API_BASE_URL": "https://your-server.com", "BABEL_API_KEY": "your-key", "BABEL_VERIFY_SSL": "false" } } } }
Security Note: Only disable SSL verification for trusted internal servers with self-signed certificates. Never disable it for production systems or public APIs.
Authentication Errors
- Make sure you’re using only ONE authentication method (API key OR bearer token)
- Verify your credentials are not expired
- Check that your API key has the necessary permissions
Tool Execution Errors
- Check the input schema for the tool you’re using
- Ensure all required parameters are provided
- Verify parameter types match the schema
- Review the API response for specific error messages
Token Saturation with babel_get_logs
The babel_get_logs tool can return very large amounts of data, especially when including the exception and properties fields. This can saturate the available AI tokens in the conversation.
Field Selection Guidelines:
exceptionandproperties: Can contain very large amounts of data - avoid when requesting many recordsmessageTemplate: Not strictly necessary as it only contains the formatting template; the actual informative content is inmessage- Recommended fields:
id,message,level,timeStamp
Best Practices:
-
Limit the fields in
select: Avoid includingexception,properties, andmessageTemplateunless specifically needed# Good - excludes large/unnecessary fields { "params": { "select": "id,message,level,timeStamp", "take": 50 } } # Risky - includes large fields { "params": { "select": "id,message,level,timeStamp,exception,properties", "take": 50 # May saturate tokens } } -
Use pagination wisely: When including
exceptionorproperties, use smalltakevalues (10-20 records max) -
Filter before fetching: Use the
filterparameter to reduce the number of records before retrieving them
API Documentation
For detailed information about the Babel Licensing API endpoints, parameters, and responses, refer to the babel-licensing-api.json OpenAPI specification file included in the MCP server package.
Support
For issues or questions, contact: support@babelfor.net
Resources
- Model Context Protocol Documentation
- Claude Desktop
- Babel Licensing Documentation
- Babel Licensing API Reference
Version History
- 0.1.0 (Initial Release)
- Complete implementation of all Babel Licensing API endpoints
- Support for authentication, licensing operations, and management functions
- Comprehensive test suite
- Full documentation