Skip to main content
Glama

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-mcp

For Development

  1. Clone and install dependencies:

git clone <repository-url>
cd 4d-mcp
npm install
  1. Configure environment variables:

cp .env.example .env

Edit .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 only
  1. Build the project:

npm run build

Usage

Development

npm run dev

Production

npm run build
npm start

Available Tools

1. login

Authenticate with the 4D server and establish a session.

Parameters:

  • user (optional): Username override

  • password (optional): Password override

  • hashed (optional): Whether password is hashed

  • minutes (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 name

  • filter (optional): 4D query filter

  • orderby (optional): Sort specification

  • top (optional): Max records to return

  • skip (optional): Records to skip (pagination)

  • attributes (optional): Specific attributes to include

  • expand (optional): Related attributes to expand

4. upsert

Create or update records.

Parameters:

  • dataClass (required): Dataclass name

  • body (required): Record data (object or array)

5. delete

Delete records from a dataclass.

Parameters:

  • dataClass (required): Dataclass name

  • key (optional): Specific record key

  • filter (optional): Query filter for bulk delete

6. callFunction

Call ORDA class functions.

Parameters:

  • target (required): Interface/dataclass name

  • func (required): Function name

  • params (optional): Function parameters array

4D Server Requirements

  1. Enable REST Server: Set "Expose REST server" in 4D settings

  2. Configure Exposure: Ensure dataclasses and attributes are exposed

  3. HTTPS: Use HTTPS in production

  4. 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-inspector

Point 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_SIGNED to "true" only for development with self-signed certificates

  • Example configuration files are available in the examples/ directory

Available Tools

6 tools
callFunctionB

Call an ORDA class function on the 4D server

ParametersJSON Schema
NameRequiredDescriptionDefault
funcYesFunction name to call
paramsNoArray of parameters to pass to the function
targetYesTarget interface (dataclass name or other interface)

TDQS

B3.2/5.0
Behavior1/5

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.

Conciseness5/5

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.

Completeness2/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines3/5

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

ParametersJSON Schema
NameRequiredDescriptionDefault
allNoInclude all catalog information

TDQS

B3.2/5.0
Behavior2/5

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.

Conciseness5/5

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.

Completeness2/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines2/5

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

ParametersJSON Schema
NameRequiredDescriptionDefault
keyNoPrimary key of specific record to delete
filterNo4D query filter to select records to delete
dataClassYesName of the dataclass

TDQS

B3.1/5.0
Behavior2/5

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.

Conciseness4/5

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.

Completeness2/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines2/5

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

ParametersJSON Schema
NameRequiredDescriptionDefault
userNoUsername for authentication
hashedNoWhether the password is already hashed
minutesNoSession duration in minutes
passwordNoPassword or hashed password

TDQS

B3.4/5.0
Behavior2/5

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.

Conciseness5/5

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.

Completeness2/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines3/5

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

ParametersJSON Schema
NameRequiredDescriptionDefault
topNoMaximum number of records to return
skipNoNumber of records to skip
expandNoRelated attributes to expand
filterNo4D query filter expression
orderbyNoSort order specification
dataClassYesName of the dataclass to query
attributesNoComma-separated list of attributes to include

TDQS

C2.9/5.0
Behavior2/5

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.

Conciseness4/5

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.

Completeness2/5

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.

Parameters3/5

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.

Purpose4/5

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.

Usage Guidelines2/5

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

ParametersJSON Schema
NameRequiredDescriptionDefault
bodyYesRecord data to create or update (object for single record, array for multiple)
dataClassYesName of the dataclass

TDQS

B3.1/5.0
Behavior2/5

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.

Conciseness4/5

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.

Completeness2/5

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.

Parameters3/5

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.

Purpose5/5

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.

Usage Guidelines2/5

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.

  1. 6 tool updatesv1.0.0
    • First observedcallFunction
    • First observedcatalog
    • First observeddelete
    • First observedlogin
    • First observedquery
    • First observedupsert

TDQS

A3.6/5.0
Disambiguation5/5

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.

Naming Consistency4/5

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.

Tool Count5/5

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.

Completeness5/5

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

ActivityInactive
ResponsivenessNo issues

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

Related MCP Servers

  • -
    license
    Not graded
    quality
    Not graded
    maintenance
    Bridges legacy MultiValue databases to modern AI assistants like Claude Desktop, allowing natural language queries and data manipulation through a secure, OAuth-authenticated connection.
    -
  • A
    license
    A
    quality
    C
    maintenance
    Enables 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.
    14
    19
    17
    BSD 2-Clause "Simplified"
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables 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.
    10
    2
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables AI assistants to interact with Bubble.io applications through the Data API, supporting CRUD operations, schema discovery, and workflow execution.
    MIT

Latest Blog Posts

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