4d-mcp
Click on "Deploy 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., "@4d-mcp query customers with filter 'city=New York'"
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.
4D MCP Server
Model Context Protocol (MCP) server for 4D REST API integration. Provides tools for authentication, data querying, manipulation, and ORDA class function calls.
Features
Authentication: Login with username/password or hashed password
Schema Inspection: Get database catalog information
Data Querying: Query dataclasses with filtering, sorting, and pagination
Data Manipulation: Create, update, and delete records
ORDA Functions: Call class functions on the 4D server
Session Management: Automatic session cookie handling
Related MCP server: MCP Server for Odoo
Installation
For MCP Client Usage
Install globally via npm:
npm install -g 4d-mcpFor Development
Clone and install dependencies:
git clone <repository-url>
cd 4d-mcp
npm installConfigure environment variables:
cp .env.example .envEdit .env with your 4D server settings:
FOURD_BASE=https://your-4d-server:port
FOURD_USER=username
FOURD_PASSWORD=password
FOURD_SESSION_MINUTES=60
FOURD_ALLOW_SELF_SIGNED=true # For development onlyBuild the project:
npm run buildUsage
Development
npm run devProduction
npm run build
npm startAvailable Tools
1. login
Authenticate with the 4D server and establish a session.
Parameters:
user(optional): Username overridepassword(optional): Password overridehashed(optional): Whether password is hashedminutes(optional): Session duration override
2. catalog
Get database schema information.
Parameters:
all(optional): Include all catalog details
3. query
Query data from a dataclass.
Parameters:
dataClass(required): Dataclass namefilter(optional): 4D query filterorderby(optional): Sort specificationtop(optional): Max records to returnskip(optional): Records to skip (pagination)attributes(optional): Specific attributes to includeexpand(optional): Related attributes to expand
4. upsert
Create or update records.
Parameters:
dataClass(required): Dataclass namebody(required): Record data (object or array)
5. delete
Delete records from a dataclass.
Parameters:
dataClass(required): Dataclass namekey(optional): Specific record keyfilter(optional): Query filter for bulk delete
6. callFunction
Call ORDA class functions.
Parameters:
target(required): Interface/dataclass namefunc(required): Function nameparams(optional): Function parameters array
4D Server Requirements
Enable REST Server: Set "Expose REST server" in 4D settings
Configure Exposure: Ensure dataclasses and attributes are exposed
HTTPS: Use HTTPS in production
Authentication: Configure user authentication as needed
Error Handling
The server provides detailed error messages for:
Authentication failures (401 errors)
Missing session cookies
Invalid parameters
4D server errors
Authentication errors will prompt you to run login again.
Security Notes
Use HTTPS when sending credentials
Prefer hashed passwords over plain text
Limit exposed dataclasses and attributes in production
Never log passwords or session cookies
Testing with MCP Inspector
Use the MCP Inspector to test the server:
npm install -g @modelcontextprotocol/inspector
mcp-inspectorPoint the inspector to your built server: node dist/index.js
Client Configuration
Claude Code
Add to your Claude Code configuration file (~/.claude-code/config.json):
{
"mcpServers": {
"4d": {
"command": "npx",
"args": ["4d-mcp"],
"env": {
"FOURD_BASE": "https://your-4d-server.com:443",
"FOURD_USER": "your-username",
"FOURD_PASSWORD": "your-password",
"FOURD_SESSION_MINUTES": "60",
"FOURD_ALLOW_SELF_SIGNED": "false"
}
}
}
}Cursor
Add to your Cursor settings (Settings > Extensions > MCP > Edit in settings.json):
{
"mcp": {
"servers": {
"4d": {
"command": "npx",
"args": ["4d-mcp"],
"env": {
"FOURD_BASE": "https://your-4d-server.com:443",
"FOURD_USER": "your-username",
"FOURD_PASSWORD": "your-password",
"FOURD_SESSION_MINUTES": "60",
"FOURD_ALLOW_SELF_SIGNED": "false"
}
}
}
}
}Cline (VS Code Extension)
Add to your Cline MCP settings:
{
"mcpServers": {
"4d": {
"command": "npx",
"args": ["4d-mcp"],
"env": {
"FOURD_BASE": "https://your-4d-server.com:443",
"FOURD_USER": "your-username",
"FOURD_PASSWORD": "your-password",
"FOURD_SESSION_MINUTES": "60",
"FOURD_ALLOW_SELF_SIGNED": "false"
}
}
}
}Configuration Notes
Replace placeholder values with your actual 4D server details
Use HTTPS in production environments
Set
FOURD_ALLOW_SELF_SIGNEDto"true"only for development with self-signed certificatesExample configuration files are available in the
examples/directory
Available Tools
6 toolscallFunctionB
Call an ORDA class function on the 4D server
Inputs: func (required), target (required), params.
catalogB
Get 4D database schema information
Inputs: all.
deleteB
Delete records from a 4D dataclass
Inputs: dataClass (required), key, filter.
loginB
Authenticate with 4D REST server and establish session
Inputs: user, hashed, minutes, password.
queryC
Query data from a 4D dataclass
Inputs: dataClass (required), top, skip, expand, +3 more.
upsertB
Create or update records in a 4D dataclass
Inputs: body (required), dataClass (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool serves a clear, distinct purpose: authentication, schema introspection, querying, creating/updating, deleting, and calling server functions. There is no meaningful overlap between these operations, so an agent can easily select the right tool for the task.
Most tools use simple lowercase verb names (login, query, upsert, delete), and 'catalog' is a noun but still unambiguous. 'callFunction' breaks the pattern slightly with camelCase, but the naming is otherwise consistent and readable.
With 6 tools, the server is well-scoped for a 4D database interface. Each tool covers a core capability without unnecessary bloat, making the set easy to navigate.
The tool set covers authentication, schema discovery, read, create/update, delete, and server-side function execution. This is a complete lifecycle for typical database operations, with no obvious gaps that would hinder agent workflows.
Maintenance
Related MCP Connectors
Query your team's drift, vulnerability, and upgrade data from any AI assistant. OAuth 2.1, 51 tools.
Connect any AI assistant to Odoo 16–19 via OAuth 2.0 + PKCE. 400 free calls, no local install.
Query Postgres, MySQL, SQL Server, Oracle, BigQuery, ClickHouse and Redshift from your AI client.
- DNS-DATA RemoteDeprecatedcom.dns-data
Connect AI assistants to authorized Windows and macOS devices for files, commands, and management.
Related MCP Servers
- -licenseNot gradedqualityNot gradedmaintenanceBridges legacy MultiValue databases to modern AI assistants like Claude Desktop, allowing natural language queries and data manipulation through a secure, OAuth-authenticated connection.-
- FlicenseNot gradedqualityCmaintenanceEnables AI assistants to securely access and interact with Odoo data through natural language, supporting full CRUD operations, OAuth 2.1 and API key authentication, and granular per-model permissions.-
- FlicenseNot gradedqualityCmaintenanceEnables AI assistants to securely connect to Odoo and perform CRUD operations, custom tool calls, and data queries through natural language, with OAuth 2.1 and API key authentication.-
- FlicenseNot gradedqualityCmaintenanceEnables AI assistants to securely access and perform CRUD operations on Odoo data through natural language, with granular permissions and dual REST/XML-RPC support.-