4d
БесплатноНе проверенEnables AI assistants to interact with 4D databases via REST API, supporting authentication, schema inspection, data querying, manipulation, and ORDA function c
Описание
Enables AI assistants to interact with 4D databases via REST API, supporting authentication, schema inspection, data querying, manipulation, and ORDA function calls.
README
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
Installation
For MCP Client Usage
Install globally via npm:
npm install -g 4d-mcp
For Development
- Clone and install dependencies:
git clone <repository-url>
cd 4d-mcp
npm install
- 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
- 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 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-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_SIGNEDto"true"only for development with self-signed certificates - Example configuration files are available in the
examples/directory
Установка 4d
У этого сервера нет опубликованного пакета — он собирается из исходников. Открой репозиторий и следуй инструкции в README.
▸ github.com/KyleKincer/4d-mcpFAQ
4d MCP бесплатный?
Да, 4d MCP бесплатный — установка в пару кликов через Unyly без оплаты.
Нужен ли API-ключ для 4d?
Нет, 4d работает без API-ключей и переменных окружения.
4d — hosted или self-hosted?
Доступен hosted-вариант: Unyly запускает сервер в облаке, локальная установка не обязательна.
Как установить 4d в Claude Desktop, Claude Code или Cursor?
Открой 4d на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.
Похожие MCP
Fetch
Web content fetching and conversion for efficient LLM usage.
AWS KB Retrieval
Retrieval from AWS Knowledge Base using Bedrock Agent Runtime.
автор: modelcontextprotocolSpring AI MCP Server
Provides auto-configuration for setting up an MCP server in Spring Boot applications.
llm-analysis-assistant
A very streamlined mcp client that supports calling and monitoring stdio/sse/streamableHttp, and can also view request responses through the /logs page. It also
автор: xuzexin-hzCompare 4d with
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории ai
