Copyright (c) 2025, Software Tree
A Model Context Protocol (MCP) Server to connect your AI applications to relational databases
ORMCP Server enables AI LLMs and MCP clients to easily exchange object-oriented data (in JSON format) with any relational database using the MCP standard protocol.
ORMCP Server makes your relational data AI ready.
ORMCP Server is currently in Beta, and we are offering early access to users who want to check the software, provide feedback, and help us ensure the product meets the highest quality standards. This Beta version is not intended for commercial use, and it is provided for testing purposes only.
- What is MCP?
- Features
- How It Works
- Quick Start
- Installation
- Gilhari Microservice Setup
- Configuration
- Starting the Server
- Client Configuration
- Usage Examples
- MCP Tools Reference
- Troubleshooting
- Development
- Contributing
- License
- Support & Resources
The Model Context Protocol (MCP) is an open standard that provides a unified way for AI models to interact with external tools and data sources. It standardizes communication, making it easier to integrate LLMs into complex workflows without building custom API integrations for every use case.
Learn more at the Official MCP Website.
- β Standardized Interface: Fully compliant with the Model Context Protocol (MCP) specification
- π Database Agnostic: Works with any JDBC-compliant database (e.g., PostgreSQL, MySQL, Oracle, SQL Server, DB2, SQLite)
βοΈ Bi-directional Data Flow: Seamless AI β Database communication with optional support for only READONLY operations- π Object-Relational Mapping (ORM): JSON object operations (CRUD) transparently mapped to relational data
- π Secure Data Access: Domain model-specific operations promote data protection
- π§Ύ Declarative ORM Specification: Intuitive, non-intrusive, and flexible ORM specification based on a simple grammar
- πΈοΈ Support for Complex Object Modeling: Including one-to-one, one-to-many, and many-to-many relationships, and path-expressions
- ποΈ Flexible Queries: Deep and Shallow queries, Various operational directives similar to GraphQL capabilities to refine the shape and scope of returned objects
- π Highly Optimized and Lightweight Mapping Engine: Connection pooling, Prepared statements, Optimized SQL statements, Minimal database trips, Caching of metadata
- π Compatible with Existing Data and Databases: Works with existing schemas and data in any database; Does not require any native JSON data type
- π Comprehensive Documentation: Detailed User manual and README files, API documentation, sample apps
- βοΈ Cloud Agnostic: Deploy anywhere with Docker support
- β‘ High Performance: Built on versatile Gilhari microservice architecture and optimised ORM engine
- π‘οΈ Robust Error Handling: Clear error messages and recovery mechanisms
- π Scalable: Handles multiple concurrent requests efficiently; Scalable Docker deployment
+---------------------+ +----------------------+ +-------------------------+
| AI App / LLM Client | <---> | ORMCP Server | <---> | Relational Database |
| (MCP-compliant tool)| | (MCP + Gilhari) | | (Postgres, MySQL, etc.) |
+---------------------+ +----------------------+ +-------------------------+
| | |
| JSON (via MCP Tools) | |
|------------------------------->| |
| | ORM + JDBC |
| |-------------------------------->|
| | |
| JSON result (MCP format) | |
|<-------------------------------| |
Important: The AI application (LLM client) translates natural language into MCP tool calls. ORMCP Server then translates these MCP tool calls into REST API calls to Gilhari.
ORMCP Server bridges the gap between modern AI applications and relational databases through:
- MCP Protocol: Standardized AI-to-tool communication
- Gilhari: Integration layer with relational databases via ORM and JDBC
- JSON Mapping: Transparent object-relational mapping
1. Scope Your Data
- Define lightweight object models for your relevant data
- Write a declarative ORM specification for those models in a text file using a simple (JDX) grammar
2. Build Your Gilhari Microservice
- Add models, ORM specification, and JDBC driver to a Dockerfile
- Build the Gilhari Docker image
3. Run with ORMCP
- Connect ORMCP to the Gilhari microservice
- Start Gilhari, then ORMCP
- Interact with scoped relational data in an intuitive, object-oriented way using an AI Agent or MCP client
- Python 3.12+
- Docker (for Gilhari microservice)
- JDBC driver for your target database
For Beta Users (Gemfury Private PyPI):
Request beta access and receive your token at: softwaretree.com/products/ormcp
# Install with token
# Note: --extra-index-url is required because build dependencies (like hatchling)
# are available on PyPI but not on Gemfury
pip install --index-url https://YOUR_TOKEN@pypi.fury.io/softwaretree/ \
--extra-index-url https://pypi.org/simple \
ormcp-server
# Verify installation
pip show ormcp-serverReplace YOUR_TOKEN with your beta access token.
π Linux/Mac Users: Modern Linux distributions require virtual environments. See troubleshooting if you get "externally-managed-environment" errors.
# Create virtual environment (required on modern Linux)
python3 -m venv .venv
source .venv/bin/activate
# Install with token
pip install --index-url https://YOUR_TOKEN@pypi.fury.io/softwaretree/ \
--extra-index-url https://pypi.org/simple \
ormcp-serverFor Production Users (PyPI):
# Install from PyPI (available after beta)
pip install ormcp-server
# Verify installation
pip show ormcp-serverWindows Users - Add Python Scripts to PATH:
If you encounter 'ormcp-server' is not recognized errors, add Python's Scripts directory to your PATH:
# Option 1: Quick command (run in PowerShell, then restart terminal)
setx PATH "%PATH%;%APPDATA%\Python\Python313\Scripts"
# Option 2: Use full path directly
%APPDATA%\Python\Python313\Scripts\ormcp-server.exeTo find your Scripts directory:
# Windows
pip show -f ormcp-server | findstr "Location"
# The Scripts folder is in: Location\..\..\Scripts\
# Linux/Mac
pip show -f ormcp-server | grep Location
# The bin folder is in: ~/.local/bin/Linux/Mac Users:
If ormcp-server command is not found:
# Add to PATH in ~/.bashrc or ~/.zshrc
export PATH="$HOME/.local/bin:$PATH"
# Then reload your shell
source ~/.bashrc # or source ~/.zshrcSee detailed setup in Gilhari Microservice Setup section below.
Note: A complete working example is available in a separate repository: gilhari_example1
To run the example:
# Clone the example repository of a sample Gilhari microservice that deals with User type of objects
git clone https://github.com/SoftwareTree/gilhari_example1.git
cd gilhari_example1
# Pull Gilhari Docker image
docker pull softwaretree/gilhari:latest
# Build a Docker image for the sample Gilhari microservice
./build.cmd # On Windows
# or
./build.sh # On Linux/Mac
# Run the sample microservice
docker run -p 80:8081 gilhari_example1:1.0
# Optionally, populate the database with sample data
./curlCommandsPopulate.cmd # On Windows
# or
./curlCommandsPopulate.sh # On Linux/Mac# Linux/Mac
export GILHARI_BASE_URL="http://localhost:80/gilhari/v1/"
export MCP_SERVER_NAME="MyORMCPServer"
# Windows (Command Prompt)
set GILHARI_BASE_URL=http://localhost:80/gilhari/v1/
set MCP_SERVER_NAME=MyORMCPServer
# Windows (PowerShell)
$env:GILHARI_BASE_URL="http://localhost:80/gilhari/v1/"
$env:MCP_SERVER_NAME="MyORMCPServer"ormcp-serverIf you get command not found errors, see Step 1 above for PATH configuration, or use:
# Windows - full path
%APPDATA%\Python\Python313\Scripts\ormcp-server.exe
# Linux/Mac - full path
~/.local/bin/ormcp-server
# Or use Python directly
python -m ormcp_serverFor Claude Desktop, add to claude_desktop_config.json:
Option 1: Using command name (requires PATH configured):
{
"mcpServers": {
"my-ormcp-server": {
"command": "ormcp-server",
"args": [],
"env": {
"GILHARI_BASE_URL": "http://localhost:80/gilhari/v1/",
"MCP_SERVER_NAME": "MyORMCPServer"
}
}
}
}Option 2: Using full path (recommended for Windows):
{
"mcpServers": {
"my-ormcp-server": {
"command": "C:\\Users\\<YourUsername>\\AppData\\Roaming\\Python\\Python313\\Scripts\\ormcp-server.exe",
"args": [],
"env": {
"GILHARI_BASE_URL": "http://localhost:80/gilhari/v1/",
"MCP_SERVER_NAME": "MyORMCPServer"
}
}
}
}To find your exact path:
# Windows (PowerShell)
(Get-Command ormcp-server).Source
# Or use pip
pip show -f ormcp-server | findstr "Location"
# Linux/Mac
which ormcp-serverYou're ready! Your AI client can now interact with your database using natural language.
Note: Steps 3 (Configure Environment) and 4 (Start the ORMCP Server) are not necessary if you are using Claude Desktop as a client because Claude Desktop automatically starts a configured ORMCP server in STDIO mode.
AI Prompt: "Show me all users with age greater than or equal to 55"
Generated MCP Call:
{
"name": "query",
"arguments": {
"className": "User",
"filter": "age >= 55",
"maxObjects": -1,
"deep": true
}
}Result:
[
{"id": 55, "name": "Mary55", "city": "Campbell", "state": "CA"},
{"id": 56, "name": "Mike56", "city": "Boston", "state": "MA"}
]AI Prompt: "Add a new User (id = 65) named John Smith of Boston, MA with age of 65"
Generated MCP Call:
{
"name": "insert",
"arguments": {
"className": "User",
"jsonObjects": [
{
"id": 65,
"name": "John Smith",
"city": "Boston",
"state": "MA",
"age": 65
}
]
}
}AI Prompt: "What's the average age of users in California?"
Generated MCP Call:
{
"name": "getAggregate",
"arguments": {
"className": "User",
"attributeName": "age",
"aggregateType": "AVG",
"filter": "state='CA'"
}
}Result:
49ORMCP Server depends on Gilhari software, a microservice framework for JSON data integration with databases. This setup must be completed before starting the ORMCP server.
-
Pull the Gilhari Docker image:
docker pull softwaretree/gilhari:latest
-
Install the Gilhari SDK:
- The SDK for Gilhari software is bundled in the ORMCP Server package under the Gilhari_SDK folder
- Alternatively, download from: https://www.softwaretree.com/v1/products/gilhari/download-gilhari.php
- The SDK includes documentation (READMEs, API guides, sample applications) to help you use Gilhari software easily
Follow these steps (detailed in Gilhari SDK documentation):
- Define domain model classes - Java container classes for your JSON objects
- Create declarative ORM specification - Map JSON attributes to database schema
- Build Docker image of the app-specific Gilhari microservice - Include domain classes, ORM specification, and JDBC driver
- Run the microservice:
docker run -p 80:8081 your-gilhari-service:1.0
Note: A complete working example is available in a separate repository: gilhari_example1. This example demonstrates a Gilhari microservice that manages User objects.
# Clone the example repository
git clone https://github.com/SoftwareTree/gilhari_example1.git
cd gilhari_example1
# Build a Docker image for the sample Gilhari microservice
./build.cmd # On Windows
# or
./build.sh # On Linux/Mac
# Run the sample microservice
docker run -p 80:8081 gilhari_example1:1.0
# Optionally, populate the database with sample data
./curlCommandsPopulate.cmd # On Windows
# or
./curlCommandsPopulate.sh # On Linux/MacFor detailed setup and configuration instructions, see the gilhari_example1 README.
# Create and activate virtual environment
python -m venv .venv
# Activate the environment
# Linux/Mac:
source .venv/bin/activate
# Windows (Command Prompt):
.venv\Scripts\activate
# Windows (PowerShell):
.venv\Scripts\Activate.ps1
# Install ORMCP Server
# Beta (Gemfury):
# Note: --extra-index-url is required because build dependencies (like hatchling)
# are available on PyPI but not on Gemfury
pip install --index-url https://YOUR_TOKEN@pypi.fury.io/softwaretree/ \
--extra-index-url https://pypi.org/simple \
ormcp-server
# Production (PyPI) - available after beta:
# pip install ormcp-serverReplace YOUR_TOKEN with your beta access token from softwaretree.com/products/ormcp.
Beta (Gemfury):
# Note: --extra-index-url is required because build dependencies (like hatchling)
# are available on PyPI but not on Gemfury
pip install --index-url https://YOUR_TOKEN@pypi.fury.io/softwaretree/ \
--extra-index-url https://pypi.org/simple \
ormcp-serverReplace YOUR_TOKEN with your beta access token.
Production (PyPI) - available after beta:
pip install ormcp-serverNote: When installing globally (without a virtual environment), the ormcp-server executable will be installed to your user's Python Scripts directory. See the PATH configuration instructions in Quick Start if you encounter "command not found" errors.
To access the complete package including Gilhari SDK, examples, and documentation:
Beta (Gemfury):
# Download source distribution
# Note: --extra-index-url is required because build dependencies (like hatchling)
# are available on PyPI but not on Gemfury
pip download --no-binary :all: \
--index-url https://YOUR_TOKEN@pypi.fury.io/softwaretree/ \
--extra-index-url https://pypi.org/simple \
ormcp-server
# Extract it (use the appropriate version number)
tar -xzf ormcp_server-*.tar.gz
cd ormcp_server-*/
# Now you have access to:
# - Gilhari_SDK/ (Complete SDK with documentation)
# - gilhari_example1/ (Ready-to-use example microservice)
# - package/client/ (Example client code)
# - package/docs/ (Additional documentation)Replace YOUR_TOKEN with your beta access token.
Production (PyPI) - available after beta:
# Download source distribution
pip download --no-binary :all: ormcp-server
# Extract it
tar -xzf ormcp_server-*.tar.gz
cd ormcp_server-*/Windows users: If you don't have tar installed, you can:
- Use 7-Zip or WinRAR to extract the .tar.gz file
- Or use PowerShell:
tar -xzf ormcp_server-*.tar.gz - Or download directly from the Gemfury/PyPI website
The ORMCP Server package includes additional resources beyond the Python code:
When you install via pip, you get the core Python package needed to run ORMCP Server:
pip install ormcp-serverThis installs only the essential runtime files to your Python environment.
The complete package includes:
- Gilhari_SDK/ - Complete SDK with documentation, examples, and tools for creating custom Gilhari microservices
- gilhari_example1/ - Ready-to-use example Gilhari microservice
- package/client/ - Example client code and usage documentation
- package/docs/ - Additional technical documentation
- pyproject.toml - Build configuration
- README.md - This file
- LICENSE - License terms
Option 1: Download from PyPI/Gemfury
Beta (Gemfury):
# Download the source distribution (.tar.gz)
# Note: --extra-index-url is required because build dependencies (like hatchling)
# are available on PyPI but not on Gemfury
pip download --no-binary :all: \
--index-url https://YOUR_TOKEN@pypi.fury.io/softwaretree/ \
--extra-index-url https://pypi.org/simple \
ormcp-server
# Extract it (use the appropriate version number; e.g., 0.4.x)
tar -xzf ormcp_server-0.4.x.tar.gz
cd ormcp_server-0.4.x
# Now you have access to:
# - Gilhari_SDK/
# - gilhari_example1/
# - package/client/
# - package/docs/Replace YOUR_TOKEN with your beta access token.
Production (PyPI) - available after beta:
# Download the source distribution
pip download --no-binary :all: ormcp-server
# Extract it
tar -xzf ormcp_server-*.tar.gz
cd ormcp_server-*/Windows users: If you don't have tar installed, you can:
- Use 7-Zip or WinRAR to extract the .tar.gz file
- Or use PowerShell:
tar -xzf ormcp_server-0.4.x.tar.gz - Or download directly from the Gemfury/PyPI website
Option 2: Download from Package Page
Beta: Contact ormcp_support@softwaretree.com for direct download links.
Production (after beta): Visit https://pypi.org/project/ormcp-server/ and download the .tar.gz file.
Look for the "Download files" section and download the source distribution (.tar.gz).
After extracting the source distribution:
# Navigate to the SDK
cd Gilhari_SDK
# Read the documentation
# - Check README files for setup instructions
# - Review examples in the examples/ directory
# - See API documentation for ORM specification details
# The SDK includes:
# - Gilhari Docker base image information
# - Documentation (READMEs, API guides)
# - Sample applications
# - Tools for reverse-engineering ORM from existing databases
# - JDX grammar specification# Navigate to the example
cd gilhari_example1
# Follow the README.md in that directory to:
# 1. Build the Docker image
# 2. Run the microservice
# 3. Populate sample data
# 4. Test with ORMCP ServerWhy Two Package Formats?
- Wheel (.whl) - Binary distribution, fast to install, includes only runtime code (~50KB)
- Source Distribution (.tar.gz) - Complete package with all resources (~several MB)
Most users only need the wheel for running ORMCP Server. Download the source distribution if you need:
- The Gilhari SDK for creating custom microservices
- Example applications and client code
- Complete documentation
- Additional technical guides
Configure via environment variables:
| Variable | Description | Default | Example |
|---|---|---|---|
GILHARI_BASE_URL |
Gilhari microservice URL | http://localhost:80/gilhari/v1/ |
http://myhost:8888/gilhari/v1/ |
MCP_SERVER_NAME |
Server identifier | ORMCPServerDemo |
MyCompanyORMCP |
GILHARI_TIMEOUT |
API timeout (seconds) | 30 |
60 |
LOG_LEVEL |
Logging verbosity | INFO |
DEBUG, WARNING, ERROR |
READONLY_MODE |
Expose only read operations | False |
True |
GILHARI_NAME |
Name of the app-specific Gilhari microservice | "" | my-gilhari-microservice |
GILHARI_IMAGE |
Docker image name of the app-specific Gilhari microservice | "" | gilhari_example1:1.0 |
GILHARI_HOST |
IP address of the host machine for Gilhari microservice | localhost |
10.20.30.40 |
GILHARI_PORT |
Port number to contact the Gilhari microservice | 80 |
8888 |
Notes:
- If
READONLY_MODEis set toTrue, the MCP tools that can potentially modify the data (e.g., insert, update, update2, delete, delete2) are not exposed by the ORMCP server to the MCP client. By default, all MCP tools are exposed. GILHARI_BASE_URLandGILHARI_NAMEare used to probe an already running Gilhari microservice containerGILHARI_IMAGE,GILHARI_NAME, andGILHARI_PORTare used to run a new instance of Gilhari microservice if an existing microservice is not found. Please make sure that the values ofGILHARI_HOSTandGILHARI_PORTvariables match the corresponding values inGILHARI_BASE_URLsetting because that is where the ORMCP server will contact the Gilhari microservice.
# Linux/Mac
export GILHARI_BASE_URL="http://localhost:80/gilhari/v1/"
export GILHARI_TIMEOUT="30"
export MCP_SERVER_NAME="MyORMCPServer"
export LOG_LEVEL="INFO"
# Windows (Command Prompt)
set GILHARI_BASE_URL=http://localhost:80/gilhari/v1/
set GILHARI_TIMEOUT=30
set MCP_SERVER_NAME=MyORMCPServer
set LOG_LEVEL=INFO
# Windows (PowerShell)
$env:GILHARI_BASE_URL="http://localhost:80/gilhari/v1/"
$env:GILHARI_TIMEOUT="30"
$env:MCP_SERVER_NAME="MyORMCPServer"
$env:LOG_LEVEL="INFO"Activate your virtual environment (if using one):
# Linux/Mac
source .venv/bin/activate
# Windows (Command Prompt)
.venv\Scripts\activate
# Windows (PowerShell)
.venv\Scripts\Activate.ps1Start the server using the CLI command:
ormcp-serverThis runs the MCP server in stdio mode via the main.py entry point.
Troubleshooting - Command Not Found:
If you get 'ormcp-server' is not recognized or command not found error:
Windows:
# Option 1: Use full path
%APPDATA%\Python\Python313\Scripts\ormcp-server.exe
# Option 2: Add Scripts to PATH (see Quick Start section)
setx PATH "%PATH%;%APPDATA%\Python\Python313\Scripts"
# Then restart your terminal
# Option 3: Use Python module directly
python -m ormcp_serverLinux/Mac:
# Option 1: Use full path
~/.local/bin/ormcp-server
# Option 2: Add to PATH in ~/.bashrc or ~/.zshrc
export PATH="$HOME/.local/bin:$PATH"
source ~/.bashrc # or source ~/.zshrc
# Option 3: Use Python module directly
python -m ormcp_serverNote: Requires source distribution. Download with:
# Note: --extra-index-url is required because build dependencies (like hatchling)
# are available on PyPI but not on Gemfury
pip download --no-binary :all: \
--index-url https://YOUR_TOKEN@pypi.fury.io/softwaretree/ \
--extra-index-url https://pypi.org/simple \
ormcp-server
tar -xzf ormcp_server-*.tar.gz
cd ormcp_server-*/Run the server directly with Python:
python src/ormcp_server.pyThis bypasses the CLI wrapper and runs the server directly.
Direct executable execution:
# Windows
.venv\Scripts\ormcp-server.exe
# Linux/Mac
.venv/bin/ormcp-serverUsing fastmcp CLI (requires source distribution):
fastmcp run src/ormcp_server.pyUsing MCP Inspector dev mode (requires source distribution):
mcp dev src/ormcp_server.pyUsing MCP Inspector without source code:
If you have the ormcp-server package installed, you can use MCP Inspector to explore the server's capabilities:
# Using the installed package
npx @modelcontextprotocol/inspector python -m ormcp_server
# Or if you have the command in PATH
npx @modelcontextprotocol/inspector ormcp-serverThis allows you to interactively test and explore ORMCP Server tools without needing the source distribution.
Note: Currently only the
stdiotransport is fully supported out of the box. Support for HTTP or SSE transports is experimental.
You can start the ORMCP server in HTTP mode from the command line:
# Basic HTTP mode
python src/ormcp_server.py --transport http
# Or using the CLI
ormcp-server --mode httpCustomize host and port:
python src/ormcp_server.py --transport http --host 0.0.0.0 --port 9000
# Or using CLI
ormcp-server --mode http --host 0.0.0.0 --port 9000Available command-line options:
--mode/--transport: Choose between "stdio" (default) or "http"--host: Set the host address (default: 127.0.0.1, only used in HTTP mode)--port: Set the port number (default: 8080, only used in HTTP mode)
Quick HTTP setup:
python src/ormcp_server.py --transport http
# or
ormcp-server --mode httpMake sure you have uvicorn installed as a dependency since HTTP mode uses it to serve the application.
The MCP server running in HTTP mode isn't designed to be accessed directly through a web browser. It's an API server that expects specific MCP protocol messages, not HTTP GET requests to the root path.
- Use
ormcp-serverCLI for the cleanest, recommended experience. - Use direct
python src/ormcp_server.pyfor simple runs with source distribution. - Use
mcp devorfastmcp runfor advanced dev/testing scenarios with source distribution.
[INFO] ORMCP server name: ORMCPServerDemo
[INFO] GILHARI BASE URL: http://localhost:80/gilhari/v1/
[INFO] ORMCP server v0.4.x starting in stdio (or http) mode ...
{
"mcpServers": {
"my-ormcp-server": {
"command": "ormcp-server",
"args": [],
"env": {
"GILHARI_BASE_URL": "http://localhost:80/gilhari/v1/",
"MCP_SERVER_NAME": "MyORMCPServer"
}
}
}
}{
"mcpServers": {
"my-ormcp-server": {
"command": "C:\\Users\\<YourUsername>\\AppData\\Roaming\\Python\\Python313\\Scripts\\ormcp-server.exe",
"args": [],
"env": {
"GILHARI_BASE_URL": "http://localhost:80/gilhari/v1/",
"MCP_SERVER_NAME": "MyORMCPServer"
}
}
}
}To find your exact installation path:
# Windows (PowerShell)
(Get-Command ormcp-server).Source
# Windows (Command Prompt)
where ormcp-server
# Linux/Mac
which ormcp-server
# Any platform
pip show -f ormcp-server | grep "ormcp-server.exe" # Windows
pip show -f ormcp-server | grep "ormcp-server$" # Linux/Mac{
"mcpServers": {
"my-ormcp-server": {
"command": "python",
"args": [
"-m",
"ormcp_server"
],
"env": {
"GILHARI_BASE_URL": "http://localhost:80/gilhari/v1/",
"MCP_SERVER_NAME": "MyORMCPServer"
}
}
}
}{
"mcpServers": {
"ORMCPServerDemo": {
"command": "uv",
"args": [
"run",
"--with",
"fastmcp",
"fastmcp",
"run",
"<path_to_your_ormcp-server-project>/src/ormcp_server.py"
],
"env": {
"GILHARI_BASE_URL": "http://localhost:80/gilhari/v1/",
"MCP_SERVER_NAME": "MyORMCPServer"
}
}
}
}{
"mcpServers": {
"my-ormcp-server-http": {
"command": "ormcp-server",
"args": [
"--mode", "http",
"--port", "8080"
],
"env": {
"GILHARI_BASE_URL": "http://localhost:80/gilhari/v1/",
"MCP_SERVER_NAME": "MyORMCPServerHTTP"
}
}
}
}Notes:
ORMCPServerDemois the default name of the ORMCP server.- Replace
<YourUsername>with your actual Windows username - If you are providing a port number of the associated Gilhari microservice through the "GILHARI_BASE_URL" environment variable, make sure that is the port where that Gilhari microservice is listening.
- Note: As of July 20, 2025, Claude desktop did not support connecting to an MCP server running in http mode.
Update the Gemini settings.json file:
{
"mcpServers": {
"my-ormcp-server-http": {
"httpUrl": "http://127.0.0.1:8080/mcp"
}
}
}Note: Gemini CLI currently requires HTTP mode.
To connect the ORMCP server to a custom GPT in developer mode, the server must be running in HTTP mode and be accessible from a public URL.
-
Prepare the Backend:
- First, ensure the Gilhari microservice is compiled and running in its Docker container as per the setup instructions.
- Use
curlto verify the Gilhari service is responsive:curl -i http://localhost:80/gilhari/v1/getObjectModelSummary/now
-
Configure and Run the ORMCP Server:
- Set the required environment variables for the ORMCP server to connect to Gilhari.
export GILHARI_BASE_URL="http://localhost:80/gilhari/v1/" export MCP_SERVER_NAME="MyORMCPServer" export GILHARI_TIMEOUT="30" export LOG_LEVEL="INFO"
- Start the ORMCP server in HTTP mode, as this is required for web-based clients.
# Run from the project's root directory ormcp-server --mode http --port 8080
- Set the required environment variables for the ORMCP server to connect to Gilhari.
-
Expose the Server with a Public URL: OpenAI's servers need a public web address to reach your local ORMCP server. Use a tunneling service like
cloudflaredorngrokto create a secure public URL that forwards to your local machine.-
Option A: Using
cloudflared(Recommended)- In a new terminal, start a Cloudflare tunnel pointing to your server's port.
cloudflared tunnel --url http://localhost:8080
cloudflaredwill provide a persistent public URL (e.g.,https://<your-tunnel-name>.trycloudflare.com).
- In a new terminal, start a Cloudflare tunnel pointing to your server's port.
-
Option B: Using
ngrok- In a new terminal, start
ngrokto forward traffic to port 8080.ngrok http 8080
ngrokwill provide a temporary public HTTPS URL (e.g.,https://random-string.ngrok-free.app). Note that this URL changes every time you restartngrokon the free plan.
- In a new terminal, start
-
-
Connect to Your Custom GPT:
- Take the public URL generated by
cloudflaredorngrok. - Append
/mcpto the end of this URL. The final result will be your MCP endpoint, for example:https://<your-public-url>/mcp. - In your GPT's configuration settings (Settings β Apps & Connectors β Create), paste this complete URL into the MCP Server URL field. GPT will then discover and connect to the tools provided by your ORMCP server.
- Take the public URL generated by
- Connect to ORMCP server and use the MCP compatible ORM tools provided by the ORMCP server.
- Configure according to your client's MCP server setup requirements using the appropriate transport mode (STDIO or HTTP).
- π Integration Guides: See detailed documentation on connecting to ORMCP Server:
- MCP Protocol Reference - Low-level JSON-RPC protocol details
- Using the ORMCP Client Example - Python client usage guide
- Interacting with ORMCP Server in STDIO Mode - STDIO transport guide
- Interacting with ORMCP Server in HTTP Mode - HTTP transport guide
- Additional guides available in the documentation repository (also included in the source distribution)
ORMCP Server provides the following MCP tools for interacting with your database.
π Detailed API Documentation: For complete parameter specifications and technical details, see the MCP Tools API Reference.
π‘ Working Examples: See real-world usage examples in the examples directory.
Retrieve information about the underlying object model.
Returns: Information about classes (types), attributes, primary keys, and relationships in your domain model.
Query objects with filtering and relationship traversal.
Parameters:
className(string): Type of objects to queryfilter(string, optional): SQL-like WHERE clause for filteringmaxObjects(integer, optional): Maximum number of objects to retrieve (-1 for all, default: -1)deep(boolean, optional): Include referenced objects in results (default: true)operationDetails(string, optional): JSON array of operational directives for fine-tuning queries. Supports GraphQL-like operations such as:projections: Retrieve only specific attributesignoreorfollow: Control referenced object branchesfilter: Apply filters to referenced objects
Retrieve a specific object by its primary key.
Parameters:
className(string): Type of object to retrieveprimaryKey(object): Primary key values (single value or composite key object)deep(boolean, optional): Include referenced objects (default: true)operationDetails(string, optional): Operational directives for fine-tuning queries
Retrieve object(s) referenced by a specific attribute of a referencing object.
Parameters:
className(string): Type of the referencing objectjsonObject(object): The referencing object containing the referenceattributeName(string): Name of the attribute whose referenced value(s) to retrievedeep(boolean, optional): Include referenced objects of retrieved objects as well (default: true)operationDetails(string, optional): Operational directives for fine-tuning queries
Calculate aggregate values across objects (COUNT, SUM, AVG, MIN, MAX).
Parameters:
className(string): Type of objects to aggregateattributeName(string): Attribute to perform aggregation onaggregateType(string): Type of aggregation -COUNT,SUM,AVG,MIN,MAXfilter(string, optional): SQL-like WHERE clause to filter objects before aggregation
Save one or more JSON objects to the database.
Parameters:
className(string): Type of objects to insertjsonObjects(array): List of JSON objects to save to the databasedeep(boolean, optional): Save referenced objects as well (default: true)
Update one or more existing objects with new values.
Parameters:
className(string): Type of objects to updatejsonObjects(array): List of objects with updated values (must include primary keys)deep(boolean, optional): Update referenced objects as well (default: true)
Bulk update objects matching filter criteria.
Parameters:
className(string): Type of objects to updatefilter(string): SQL-like WHERE clause to identify objects to updatenewValues(array): List of attribute names and their new valuesdeep(boolean, optional): Update referenced objects as well (default: true)
Delete specific objects from the database.
Parameters:
className(string): Type of objects to deletejsonObjects(array): Objects to delete (primary keys required for identification)deep(boolean, optional): Delete referenced objects as well (default: true)
Bulk delete objects matching filter criteria.
Parameters:
className(string): Type of objects to deletefilter(string, optional): SQL-like WHERE clause to identify objects to delete (empty string deletes all objects of the specified class)deep(boolean, optional): Delete referenced objects as well (default: true)
Note: In READONLY_MODE=True, the MCP tools for data modification operations (insert, update, update2, delete, delete2) are not exposed to MCP clients.
For common issues and solutions, see the Complete Troubleshooting Guide.
Installation Issues:
- Command not found β Add Python Scripts to PATH
- Externally managed environment β Use virtual environment (see troubleshooting guide)
- Empty executable β Reinstall package
- Missing dependencies β
pip install --force-reinstall ormcp-server
Gilhari Example Issues:
- Shell script permission denied β
chmod +x *.shor usesh build.sh - Database connection errors β Verify JDBC driver in Gilhari
Runtime Issues:
- Server won't start β Check Gilhari is running
- Database connection errors β Verify JDBC driver in Gilhari
- MCP client connection issues β Check config file syntax
Enable Debug Mode:
# Linux/Mac
export LOG_LEVEL=DEBUG
ormcp-server
# Windows (Command Prompt)
set LOG_LEVEL=DEBUG
ormcp-server
# Windows (PowerShell)
$env:LOG_LEVEL="DEBUG"
ormcp-serverGet Help:
- Documentation: github.com/softwaretree/ormcp-docs
- Issues: github.com/softwaretree/ormcp-docs/issues
- Email: ormcp_support@softwaretree.com
For testing and development with the source distribution:
Beta (Gemfury):
# Download source distribution
# Note: --extra-index-url is required because build dependencies (like hatchling)
# are available on PyPI but not on Gemfury
pip download --no-binary :all: \
--index-url https://YOUR_TOKEN@pypi.fury.io/softwaretree/ \
--extra-index-url https://pypi.org/simple \
ormcp-server
tar -xzf ormcp_server-*.tar.gz
cd ormcp_server-*/
# Install in development mode
pip install -e ".[dev]"
# Run tests (if available in source distribution)
pytestReplace YOUR_TOKEN with your beta access token.
Production (PyPI) - available after beta:
# Download source distribution
pip download --no-binary :all: ormcp-server
tar -xzf ormcp_server-*.tar.gz
cd ormcp_server-*/
# Install in development mode
pip install -e ".[dev]"
# Run tests
pytest- ORMCP Server leverages Gilhari software, a RESTful microservice framework for JSON data integration with databases.
- You first create a custom Gilhari microservice based on the object relational data models of your application.
- An object relational mapping (ORM) specification defines and controls the scope and shape of your object model corresponding to your relational model.
- The ORM specification is defined declaratively in a text file (.jdx) based on a simple grammar.
- You may be able to reverse-engineer ORM specification from an existing database schema using tools/examples provided with Gilhari SDK. Check the
examples\JDX_ReverseEngineeringJSONExampledirectory. - For details on creating custom Gilhari microservices, refer to the Gilhari SDK documentation included in the source distribution package.
- Although an ORMCP server may start a Gilhari microservice if configured to do so (using
GILHARI_IMAGE,GILHARI_NAME, andGILHARI_PORTenvironment variables), it is recommended that you start your custom Gilhari microservice before using the ORMCP server. Also, please make sure that the port number in the 'GILHARI_BASE_URL' environment variable for the ORMCP server matches the port number on which the custom Gilhari microservice is listening for incoming REST calls.
Thank you for your interest in ORMCP Server!
ORMCP Server is proprietary software. We are not accepting code contributions, pull requests, or feature submissions.
We welcome feedback on the beta version! You can help us improve ORMCP Server by:
- Reporting bugs or issues
- Suggesting improvements
- Sharing your experience
- GitHub Issues: Report issues or suggestions
- Email: ormcp_support@softwaretree.com
Any feedback you provide may be used by Software Tree to improve the product, without any obligation to credit or compensate you.
Gilhari Dependency: ORMCP Server requires Gilhari microservice to function. Gilhari incorporates various third-party software components. For complete details of these third-party components and their licenses, see the LICENSE file in the Gilhari SDK or visit: https://www.softwaretree.com/v1/products/gilhari/
Python Dependencies: ORMCP Server uses the following open-source Python libraries, each governed by their respective licenses:
- mcp (Model Context Protocol SDK)
- fastmcp (FastMCP framework)
- httpx (HTTP client library)
- pydantic (Data validation library)
- uvicorn (ASGI server)
- requests (HTTP library)
ORMCP Server is proprietary software owned by Software Tree, LLC. See the LICENSE file for complete terms.
Beta Evaluation: ORMCP Server is currently available as a beta product under an evaluation license. This allows free use for testing and evaluation purposes for a limited evaluation period (approximately 2 months from first use).
Gilhari Dependency: ORMCP Server requires Gilhari microservice to function. By using ORMCP Server, you agree to comply with the Gilhari License Agreement as well. Gilhari incorporates various third-party software components. For details, see the LICENSE file in the Gilhari SDK or visit https://www.softwaretree.com/v1/products/gilhari/.
Commercial Licensing: Commercial licensing terms will be announced at the time of commercial release. For information or to express interest, contact Software Tree at ormcp_support@softwaretree.com or visit https://www.softwaretree.com.
- Documentation: Complete documentation and guides
- Working Examples: Browse Examples | Examples Guide - Real-world use cases and integrations
- Example Microservice: gilhari_example1 Repository
- Bug Reports: Report issues
- Email Support: ormcp_support@softwaretree.com
- Gilhari Support: Software Tree Gilhari Documentation
- MCP Protocol: Official MCP Site
- Beta Access: Request token at softwaretree.com
Made with β€οΈ for the AI and database community