4d-mcp
Click on "Install 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-mcpquery 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 Salesforce Server
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
| Name | Required | Description | Default |
|---|---|---|---|
| func | Yes | Function name to call | |
| params | No | Array of parameters to pass to the function | |
| target | Yes | Target interface (dataclass name or other interface) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden. It fails to disclose side effects, permission requirements, error behavior, or return value characteristics. Calling an arbitrary class function could have unknown effects, and the description gives no hint of that.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, compact sentence with no filler. It front-loads the verb and resource, making the purpose immediately clear.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a tool that can invoke arbitrary server-side functions, this description is insufficient. With no output schema, no annotations, and no mention of return values, side effects, or errors, an agent has too little context to understand the tool's full behavior.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema provides descriptions for all three parameters (target, func, params), covering 100% of them. The description itself adds nothing beyond the schema, so the baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('Call') with a clear resource ('ORDA class function') and context ('on the 4D server'). It distinguishes itself from sibling CRUD tools like query, upsert, and delete by focusing on function invocation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The usage is implied: it is for calling ORDA class functions. However, there is no explicit guidance on when to use this tool versus alternatives, nor any exclusions or prerequisites.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
catalogB
Get 4D database schema information
| Name | Required | Description | Default |
|---|---|---|---|
| all | No | Include all catalog information |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description must disclose behavioral traits, but it only states 'Get 4D database schema information' without detailing what the operation returns, whether it requires prior login, or how the 'all' parameter affects the output. The verb 'Get' implies a read-only operation, but no further behavioral context is given.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, front-loaded sentence with no filler or redundant information. It is appropriately sized for a tool with one parameter and a straightforward purpose, earning a high score for conciseness and structure.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given that there is no output schema and no annotations, the description should provide enough context to understand what 'schema information' entails (e.g., tables, fields, types). It does not, leaving the return format ambiguous. The absence of usage guidance further reduces completeness, making the description insufficient for an agent to predict the tool's full behavior.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema fully documents the only parameter 'all' (100% coverage). The description itself adds no parameter semantics beyond the schema, which is acceptable given the high schema coverage. The description does not mention the parameter at all, so it neither enhances nor detracts from the schema's existing explanation.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states a specific verb ('Get') and resource ('4D database schema information'), immediately distinguishing this tool from the data-manipulation siblings (query, upsert, delete, callFunction). It unambiguously identifies the tool's purpose as retrieving metadata rather than operating on data.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no context for when to use this tool versus alternatives. It does not mention that it should be used for schema introspection before queries, nor does it exclude usage scenarios. The only implied usage is 'when you need schema info', but there is no explicit guidance or comparison to sibling tools.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
deleteB
Delete records from a 4D dataclass
| Name | Required | Description | Default |
|---|---|---|---|
| key | No | Primary key of specific record to delete | |
| filter | No | 4D query filter to select records to delete | |
| dataClass | Yes | Name of the dataclass |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. It only states 'Delete records' without mentioning that deletion is permanent, may require specific permissions, or could have cascading effects. This is a significant gap for a destructive operation.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence with no wasted words. It front-loads the core action and resource, though it could incorporate more context without becoming verbose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no output schema, no annotations, and the destructive nature of the operation, the description is incomplete. It fails to explain that key or filter is needed to target records, the permanence of deletion, or any safety/confirmation mechanisms, making it insufficient for safe invocation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema describes all parameters with 100% coverage, providing clear roles for 'key', 'filter', and 'dataClass'. The description adds no additional parameter meaning, so the baseline of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb ('Delete') and resource ('records from a 4D dataclass'), making the tool's primary function clear. It is naturally distinguished from sibling tools like 'query' and 'upsert' which handle reading and writing, not deletion.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives, no mention of prerequisite conditions, and no exclusions (e.g., cannot be undone). It merely states the action without contextual usage advice.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
loginB
Authenticate with 4D REST server and establish session
| Name | Required | Description | Default |
|---|---|---|---|
| user | No | Username for authentication | |
| hashed | No | Whether the password is already hashed | |
| minutes | No | Session duration in minutes | |
| password | No | Password or hashed password |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full responsibility for behavioral disclosure. It states that a session is established, hinting at a side effect, but does not explain what happens on success/failure, session lifetime, security implications, or whether prior sessions are invalidated. This is insufficient for a tool with such critical side effects.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, front-loaded sentence: 'Authenticate with 4D REST server and establish session.' Every word adds value, with no filler or redundancy. It is compact and immediately communicates the core purpose.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Despite having no output schema, the description does not mention what the tool returns (e.g., session token, status), which is essential for an authentication tool. It also lacks details on session behavior, error handling, or prerequisites. The schema covers parameters, but the overall description is too thin for the tool's significance.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, with all four parameters (user, hashed, minutes, password) clearly documented in the schema. The description itself adds no additional parameter context, but the schema already handles parameter meaning, so a baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a specific verb ('Authenticate') and resource ('4D REST server'), clearly stating the tool's function. It also mentions 'establish session', distinguishing it from sibling tools like catalog, query, upsert, delete, and callFunction, which are operational rather than authentication-focused.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Usage is implied: the tool is for authenticating and starting a session. However, no explicit guidance is given about when to use it (e.g., before other calls) or when not to. There are no exclusions or alternative tool references, but the purpose is clear enough for an agent to infer typical use.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
queryC
Query data from a 4D dataclass
| Name | Required | Description | Default |
|---|---|---|---|
| top | No | Maximum number of records to return | |
| skip | No | Number of records to skip | |
| expand | No | Related attributes to expand | |
| filter | No | 4D query filter expression | |
| orderby | No | Sort order specification | |
| dataClass | Yes | Name of the dataclass to query | |
| attributes | No | Comma-separated list of attributes to include |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden of behavioral disclosure, but it only states 'Query data from a 4D dataclass'. It does not mention return format, pagination, authentication needs, error behavior, or any side effects. This is a significant gap for a data retrieval tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, front-loaded sentence with no wasted words. It is appropriately concise for a tool whose parameters are fully documented in the schema, though it is slightly under-specified in content.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool has 7 parameters and no output schema, so the description should provide more context about what the query returns and how it behaves. It does not mention that the result is a list of records, whether pagination is required, or any limitations. This is incomplete for a developer evaluating how to use the tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has 100% description coverage for all 7 parameters, so the baseline is 3. The description itself adds no additional parameter context, but the schema already provides clear semantics for each field, so the tool description does not need to compensate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description uses a clear verb ('Query') and identifies the resource ('4D dataclass'), distinguishing it from sibling tools like upsert, delete, and callFunction. It is not a tautology, but it lacks the specificity of higher-scoring examples (e.g., no mention of filtering or listing all records).
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool versus alternatives, and no exclusions or prerequisites are mentioned. While the verb 'query' implies reading, it does not explicitly say to use this instead of catalog or callFunction for data access.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
upsertB
Create or update records in a 4D dataclass
| Name | Required | Description | Default |
|---|---|---|---|
| body | Yes | Record data to create or update (object for single record, array for multiple) | |
| dataClass | Yes | Name of the dataclass |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries full responsibility for disclosing behavioral traits. It only states 'Create or update records' without mentioning idempotency, partial vs full updates, how records are matched for update (e.g., primary key), or return values. Given that this is a mutating operation, this is a significant transparency gap.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, front-loaded sentence with no wasted words. It is efficient and to the point, though it could optionally incorporate more behavioral detail without losing conciseness.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool has no annotations and no output schema, so the description must compensate. It fails to mention bulk update behavior (array body), how existing records are identified for update, or what the response contains. For an upsert operation, this leaves the agent under-informed about critical usage details.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema descriptions cover 100% of the parameters, so the baseline is 3. The tool description adds no additional parameter semantics beyond what the schema already provides. The body parameter's object/array duality is documented in the schema but not elaborated in the description.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the operation ('Create or update') and the resource ('records in a 4D dataclass'), which is specific and distinct from sibling tools like query or delete. The verb 'upsert' in the name is reinforced by the description, leaving no ambiguity about the tool's purpose.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives no guidance on when to use this tool versus alternatives, nor does it mention prerequisites or context (e.g., 'use this to insert or modify records'). The usage context is only implied by the name and operation, not explicitly stated.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
6 tool updates
v1.0.0- First observed
callFunction - First observed
catalog - First observed
delete - First observed
login - First observed
query - First observed
upsert
TDQS
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
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
- mcpOAuthcom.vibgrate
Query your team's drift, vulnerability, and upgrade data from any AI assistant. OAuth 2.1, 51 tools.
Connects AI assistants to QCDatabase.AI for everyday construction quality-control work.
- mcpOAuthcom.keboola
Connect your AI assistants to Keboola and expose your data, transformations, SQL queries, ...
Zero-setup MCP gateway securely connecting AI to your tools with authentication and workflows
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.-
- AlicenseAqualityCmaintenanceEnables AI assistants to interact with Salesforce through a secure interface for performing CRUD operations, executing SOQL queries, and managing schema discovery. It features a smart learning system that analyzes custom objects and fields to provide intelligent assistance tailored to specific Salesforce configurations.141917BSD 2-Clause "Simplified"
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with and manage multiple database types (PostgreSQL, MySQL, SQLite, SQL Server, MongoDB, Redis) through natural language, supporting query analysis, schema management, data analysis, backup/restore, and security analysis.102MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI assistants to interact with Bubble.io applications through the Data API, supporting CRUD operations, schema discovery, and workflow execution.MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/KyleKincer/4d-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server