Cds Db Nlquery MCP
개요
제작자가 쓴 설명(영어 원문)
MCP server for natural-language queries against SAP CAP db-layer entities via real CQN/SQL JOINs.
PopNx MCP의 세 기둥
이 세 가지는 절대 하나의 점수로 합치지 않아요. 의견, 측정, 인기는 서로 다른 것이니까요.
- 사용자 의견i아직 리뷰가 없어요리뷰는 다음 단계에서 계정 기능과 함께 열려요
- 우리의 기본 점검i1개 중 1개 통과공개된 정보로 점검했으며, 코드는 아직 스캔하지 않았어요
- 사용 정도i아주 새로움↓ 69/주 · ★ –
할 수 있는 일
이 서버는 아직 쉬운 말로 된 요약을 쓰지 못했어요. 아래는 레지스트리에서 읽어 온 사실이에요.
- 연결 방식: 내 컴퓨터에서 실행
- 전송 방식: stdio
- 카테고리: 데이터베이스 및 데이터셋
- 입력해야 할 값: ANTHROPIC_API_KEY, OPENAI_API_KEY
설치
쓰고 있는 AI 앱을 고른 다음 설정을 복사하세요.
설치하기 전에
- 기본 점검: 1개 중 1개 통과
- 내 컴퓨터에서 내 사용자 계정의 권한(파일, 네트워크, 앱)으로 실행돼요.
- 직접 입력할 값:
ANTHROPIC_API_KEY,OPENAI_API_KEY,MCP_ALLOWED_ENTITIES,MCP_BLOCKED_COLUMNS
비밀로 표시된 값은 내 계정의 열쇠예요. 절대 다른 사람과 공유하거나 채팅에 붙여 넣지 마세요.
필요한 것
- npmNode.js 설치(npx 명령어용)
어떤 앱을 쓰세요?
위에서 앱을 고르세요. 기억해 두었다가 다음부터는 버튼에 “…에 설치”라고 표시해요.
Claude Desktop → Settings → Developer → Edit Config를 열고 claude_desktop_config.json에 이 내용을 붙여 넣으세요
{
"mcpServers": {
"cds-db-nlquery": {
"command": "npx",
"args": [
"-y",
"@shahid.la/cds-db-nlquery-mcp"
],
"env": {
"ANTHROPIC_API_KEY": "your-value",
"OPENAI_API_KEY": "your-value",
"MCP_ALLOWED_ENTITIES": "your-value",
"MCP_BLOCKED_COLUMNS": "your-value"
}
}
}
}터미널에서 이 명령어를 실행하세요
claude mcp add cds-db-nlquery --env ANTHROPIC_API_KEY=your-value --env OPENAI_API_KEY=your-value --env MCP_ALLOWED_ENTITIES=your-value --env MCP_BLOCKED_COLUMNS=your-value -- npx -y @shahid.la/cds-db-nlquery-mcp실행하기 전에 빈 값을 채워 주세요.
또는 설정을 직접 복사하기
프로젝트의 .cursor/mcp.json 또는 ~/.cursor/mcp.json에 붙여 넣으세요
{
"mcpServers": {
"cds-db-nlquery": {
"command": "npx",
"args": [
"-y",
"@shahid.la/cds-db-nlquery-mcp"
],
"env": {
"ANTHROPIC_API_KEY": "your-value",
"OPENAI_API_KEY": "your-value",
"MCP_ALLOWED_ENTITIES": "your-value",
"MCP_BLOCKED_COLUMNS": "your-value"
}
}
}
}브라우저가 앱을 열지 물어본 다음, 앱이 설정을 보여 주고 확인을 요청해요. 키 값은 비워 두니 직접 입력하세요.
또는 설정을 직접 복사하기
프로젝트의 .vscode/mcp.json에 붙여 넣으세요
{
"servers": {
"cds-db-nlquery": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@shahid.la/cds-db-nlquery-mcp"
],
"env": {
"ANTHROPIC_API_KEY": "your-value",
"OPENAI_API_KEY": "your-value",
"MCP_ALLOWED_ENTITIES": "your-value",
"MCP_BLOCKED_COLUMNS": "your-value"
}
}
}
}브라우저가 앱을 열지 물어본 다음, 앱이 설정을 보여 주고 확인을 요청해요. 키 값은 비워 두니 직접 입력하세요.
이 서버는 내 컴퓨터에서 실행되는데, ChatGPT는 인터넷에 있는 서버에만 연결할 수 있어요. 다른 앱을 고르세요.
선택한 앱은 이 기기의 쿠키에만 저장돼요. 계정은 필요 없어요.
직접 입력할 값
- Anthropic API key (used if ANTHROPIC_API_KEY is set and OPENAI_API_KEY is not)
- OpenAI (or OpenAI-compatible) API key
MCP_ALLOWED_ENTITIESenvComma-separated entity allowlist, enforced on JOINs tooMCP_BLOCKED_COLUMNSenvComma-separated column blocklist, stripped before the query is built
이 설정은 제작자의 레지스트리 정보로 만들었어요. README와 다르면 README를 따르세요.
할 수 있는 일
내 컴퓨터에서 실행돼요. 설치하면 AI 앱에 도구 목록이 나타나요.
기본 점검i
누구나 볼 수 있는 정보를 점검했고, 코드는 읽지 않았어요. 해당하지 않는 항목은 개수에서 뺐어요. · 2026년 11월 8일 점검
- ✓ 통과
제작자와 저장소 일치
레지스트리 이름이 GitHub 계정 shahidla 기준으로 확인되었고, 이 계정이 저장소를 소유하고 있어요
- … 아직 점검 안 함
계속 관리되고 있음
아직 GitHub에서 이 저장소를 읽어 오지 않았어요
- … 아직 점검 안 함
라이선스 있음
아직 GitHub에서 이 저장소를 읽어 오지 않았어요
- – 해당 없음
엔드포인트 응답
내 컴퓨터에서 실행되는 서버라 인터넷 엔드포인트가 없어요
- – 해당 없음
OAuth로 로그인
내 컴퓨터에서 실행되며, 대신 로컬 설정을 사용해요
- … 아직 점검 안 함
도구 설명에 숨겨진 지시 없음
내 컴퓨터에서 실행돼요. 도구 목록은 인터넷 엔드포인트가 있는 서버에서만 읽을 수 있어요
데이터베이스 및 데이터셋 카테고리의 다른 서버와 비교i
- 이 카테고리의 다른 서버 1144개 중 0%보다 스타가 많아요
- 이 카테고리의 다른 서버 1144개 중 16%보다 최근에 레지스트리에 공개됐어요
- 기본 점검 결과가 이 카테고리의 다른 서버 1144개 중 100%와 같거나 더 좋아요
레지스트리에서 이 카테고리의 활성 서버 전체와 비교했어요. 스타는 게시자가 저장소를 소유한 경우에만 세요.
자주 묻는 질문
Cds Db Nlquery MCP, 안전한가요?
해당하는 기본 점검 1개 중 1개를 통과했어요. 코드는 읽지 않았어요. 키나 토큰을 넣기 전에 서버가 어떤 권한을 요구하는지 확인하고, 꼭 필요한 권한만 있는 키를 쓰세요.
어떤 키나 코드가 필요한가요?
입력해야 할 값: ANTHROPIC_API_KEY, OPENAI_API_KEY
내 컴퓨터에서 실행되나요, 클라우드에서 실행되나요?
내 컴퓨터에서 실행돼요. AI 앱이 필요할 때 실행하고, 데이터는 제작자의 서버를 거치지 않아요(서버 자체가 온라인 서비스를 호출하는 경우는 제외).
아직 관리되고 있나요?
GitHub 저장소는 마지막으로 – 변경됐고, 최신 버전(0.7.3)은 5개월 전 레지스트리에 올라왔어요.
어떤 앱에서 쓸 수 있나요?
Claude Desktop, Claude Code, Cursor, VS Code처럼 MCP를 지원하는 앱에서 쓸 수 있어요. 내 컴퓨터에 Node.js도 있어야 해요.
대신 쓸 수 있는 건 뭐가 있나요?
같은 카테고리에는: Supabase, MongoDB MCP Server, Elasticsearch MCP Server
대안
같은 카테고리에서 다른 제작자가 만든 서버예요. 스타 순으로 정렬했어요.
카드 보는 법:↓ 주간 다운로드i★ GitHub 스타i세 기둥: 리뷰 · 점검 · 사용 정도i업데이트 = 최신 버전을 레지스트리에 공개한 날i
제작자의 README
README 열기
제작자의 저장소에서 쓰인 그대로 가져왔어요. PopNx MCP가 검토하거나 보증한 내용이 아니에요. HTML, 이미지, 스크립트는 제거했어요. 링크를 누르면 이 사이트를 벗어나요.
@shahid.la/cds-db-nlquery-mcp
MCP server for natural language queries against CDS db-layer entities (db/schema.cds).
Ask questions about your database in plain English. The server discovers your schema automatically, generates real SQL JOINs using CDS, and returns rows. No hardcoded queries, no SQL, no schema configuration. Bring your own LLM: Anthropic or OpenAI, or any OpenAI-compatible endpoint (Azure OpenAI, Groq, Ollama, local models, etc.).
Targets the `db/` layer, not OData services. If your entities are exposed as OData services, use an MCP package that targets the service layer instead.
Read-only. This package only executes SELECT queries. No INSERT, UPDATE, or DELETE.
Prerequisites
- A CAP project with
@sap/cds >= 7 - A configured CDS database (HANA Cloud, SQLite, PostgreSQL)
- An MCP client (Claude Code, Claude Desktop, or any MCP-compatible host)
- An API key for an LLM provider (see LLM provider below), used to translate your question into a query, not to answer it
Quick start
1. Install in your CAP project
npm install @shahid.la/cds-db-nlquery-mcp
2. Create `.mcp.json` in your CAP project root (same folder as package.json)
{
"mcpServers": { "cds-db-nlquery": { "command": "npx", "args": ["-y", "@shahid.la/cds-db-nlquery-mcp"], "cwd": "/absolute/path/to/your/cap/project", "env": { "ANTHROPIC_API_KEY": "sk-ant-..." } } } }
Set cwd to the absolute path of your CAP project root, where db/schema.cds lives. See LLM provider for using OpenAI, Gemini, or another provider instead.
npx -y re-resolves the package on every server start (from npm's cache once downloaded, not a fresh network fetch each time, but still an extra resolution step). If you've run npm install @shahid.la/cds-db-nlquery-mcp already, you can point "command" at the installed binary directly instead, node_modules/.bin/cds-db-nlquery-mcp, for a slightly more predictable startup, especially in production.
3. Open your project in Claude Code and ask a question
Which customers have a DTI ratio above 5?
Show me all open payments overdue by more than 30 days, include the borrower name. List all loans in the MINING sector with the customer's current DTI ratio.
Example response: the server tells the client to render rows as a vertical field/value list, not a markdown table (real output, verified against a live deployment):
Found 3 customers with DTI above 5:
PARTNER : 30100003 DTI_RATIO : 7.20 BU_SORT1 : Domestic Customer AU 3
PARTNER : 30100001 DTI_RATIO : 5.80 BU_SORT1 : Domestic Customer AU 1
PARTNER : 30100002 DTI_RATIO : 5.40 BU_SORT1 : Domestic Customer AU 2
How it works
When you ask a question:
- Your MCP client (e.g. Claude Code) calls the
natural_language_querytool with your question. - The MCP server has already loaded your CDS schema at startup: entity names, columns, and associations. It sends this schema plus your question to the LLM provider you configured (Anthropic, OpenAI, or any OpenAI-compatible endpoint), which translates it into a structured query descriptor.
- The server executes a single CDS query. CDS association paths (
customer.BU_SORT1) generate real SQL JOINs, executed by your database, not by JavaScript. Scales to production data volumes. - Results come back to your MCP client, which formats and presents the answer.
The LLM call in step 2 is a small, cheap planning step (translating your question into JSON). It does not need a large or expensive model. A fast/cheap tier model is recommended.
Configuration
All configuration is via environment variables in the .mcp.json env block.
{
"mcpServers": { "cds-db-nlquery": { "command": "npx", "args": ["-y", "@shahid.la/cds-db-nlquery-mcp"], "cwd": "/path/to/your/cap/project", "env": { "ANTHROPIC_API_KEY": "sk-ant-...", "MCP_ALLOWED_ENTITIES": "Customers,Orders,Products", "MCP_BLOCKED_COLUMNS": "PASSWORD,EMBEDDING,SSN", "MCP_MAX_ROWS": "100", "MCP_MODEL_PATH": "db" } } } }
| Variable | Default | Description |
|---|---|---|
MCP_ALLOWED_ENTITIES | *(all entities)* | Comma-separated list of entity short names, the name after the last dot in the FQN (e.g. Customers, not my.app.Customers). Leave unset during development; always set for production. |
MCP_BLOCKED_COLUMNS | *(none)* | Comma-separated column names to exclude from all results. Stripped before the query runs. Useful for columns like EMBEDDING, PASSWORD, SSN. |
MCP_MAX_ROWS | 500 | Maximum rows per query. Enforced as a SQL LIMIT, not a post-fetch filter. |
MCP_MODEL_PATH | db | Path to your CDS model folder or file, relative to cwd. Change if your schema is at model/, srv/, etc. |
MCP_DB_USER / MCP_DB_PASSWORD | *(consumer app's own DB user)* | Connect with a different HANA user than your app's runtime user. Host/port/schema are reused, only credentials are overridden. See Security → Production for why this matters. |
LLM provider
A small LLM call translates your question into a query descriptor. Bring your own provider, set ONE of the following in the env block:
Anthropic (Claude):
"env": {
"ANTHROPIC_API_KEY": "sk-ant-...", "ANTHROPIC_MODEL": "claude-haiku-4-5-20251001" }
OpenAI, or any OpenAI-compatible provider:
"env": {
"OPENAI_API_KEY": "sk-...", "OPENAI_MODEL": "gpt-4o-mini" }
OPENAI_MODEL accepts any model name. Use whatever your provider expects. Set OPENAI_BASE_URL to point at a different OpenAI-compatible endpoint:
| Provider | OPENAI_BASE_URL | Example OPENAI_MODEL |
|---|---|---|
| OpenAI | *(omit, uses default)* | gpt-4o-mini |
| Google Gemini | https://generativelanguage.googleapis.com/v1beta/openai/ | gemini-2.0-flash |
| Groq | https://api.groq.com/openai/v1 | llama-3.1-8b-instant |
| Mistral | https://api.mistral.ai/v1 | mistral-small-latest |
| DeepSeek | https://api.deepseek.com | deepseek-chat |
| xAI (Grok) | https://api.x.ai/v1 | grok-2-latest |
| Azure OpenAI | your Azure endpoint | your deployment name |
| Ollama (local) | http://localhost:11434/v1 | llama3.1 (API key can be any non-empty string) |
| Variable | Description |
|---|---|
LLM_PROVIDER | "anthropic" or "openai". Auto-detected from whichever API key is set, only needed if both are set and you want to force one. |
ANTHROPIC_API_KEY / ANTHROPIC_MODEL | Anthropic native API |
OPENAI_API_KEY / OPENAI_MODEL / OPENAI_BASE_URL | OpenAI or any OpenAI-compatible endpoint |
This is a planning-only call (question to JSON descriptor). A fast/cheap tier model is sufficient and recommended.
Security
Development
The server uses your project's existing database connection, whatever CDS has configured in default-env.json or your service binding. No extra setup needed.
Production
Important: this package queries the database directly via cds.run(). It does not go through the CAP service layer, so CAP @requires and @restrict annotations are not enforced. Access control is entirely your responsibility at the database and configuration level.
Step 1: Create a dedicated read-only database user
-- Run as DBADMIN in SAP HANA Cloud Central
CREATE USER MCP_READER PASSWORD 'your-password'; GRANT SELECT ON SCHEMA YOUR_HDI_SCHEMA TO MCP_READER;
-- Revoke tables you do not want queryable REVOKE SELECT ON "YOUR_HDI_SCHEMA"."your.AuditLog" FROM MCP_READER; REVOKE SELECT ON "YOUR_HDI_SCHEMA"."your.RegulatoryDocuments" FROM MCP_READER;
This user can only read. No write access. HANA itself enforces it, independently of this package.
Step 2: Point the server at it with `MCP_DB_USER`/`MCP_DB_PASSWORD`
The server connects with these credentials instead of inheriting your app's own database connection. Host, port, and schema are reused automatically, only the user/password are overridden:
"env": {
"MCP_DB_USER": "MCP_READER", "MCP_DB_PASSWORD": "your-password" }
If you keep these in a separate gitignored file instead of directly in .mcp.json, that's fine too. The server just reads process.env, same as any other variable here.
Step 3: Set `MCP_ALLOWED_ENTITIES`
"env": {
"MCP_ALLOWED_ENTITIES": "Customers,Orders,Products" }
This is enforced on the entity you query directly and on any entity reached via an association join in select/where. For example, if Customers isn't in the allowlist, a query against Orders can't read Customers data through a customer.NAME join path either. The database user restricts access at the HANA level; MCP_ALLOWED_ENTITIES adds a second layer at the application level. Use both.
Joins
The server reads CDS associations from your schema. When the LLM references customer.BU_SORT1 in a query, CDS generates a real SQL JOIN, executed by the database.
Multiple associations in one query work:
*"Show loans in the MINING sector with borrower name and current DTI"*
Generates a single SQL statement joining Loans → BusinessPartners → BCA_DTI in one database round-trip.
One constraint: do not select the same column name from two different entities in the same query (e.g. LOAN_ID from both the main entity and a joined entity). The database rejects duplicate column names. Claude is instructed to avoid this, but worth being aware of.
Comparing two columns to each other
Most filters compare a column to a fixed value (DTI_RATIO > 5). For questions like *"which loans have collateral worth less than the loan amount"*, the comparison is between two columns instead. Use valCol in place of val:
{ "col": "collateral.VALUE", "op": "<", "valCol": "AMOUNT" }
Either side can be an association path. This is handled by the same join mechanism as everything else. No separate query, no JavaScript-side comparison.
Filtering by a coded value's human meaning
If a column has a @Common.Text value-help association (see Coded values), filter via the text field directly rather than guessing the underlying code:
{ "col": "status.TEXT", "op": "like", "val": "Active" }
like is case-insensitive (enforced via UPPER() on both sides, not relying on database collation), so the exact case of the value doesn't need to match.
Column and entity labels
The LLM only sees what's in your CDS model: column names, types, and any labels you've annotated. Plain code comments (// customer name) are invisible to it. Without a label, an ambiguous column name can cause the LLM to guess wrong, regardless of how capable the model is.
@title: reused automatically, zero extra work
If your schema already has SAP's standard @title annotation (common in projects with a Fiori UI or OData service), the server picks it up automatically. You don't need to do anything:
entity Customers {
key PARTNER : String(10); @title: 'Customer Name' BU_SORT1 : String(40); }
@NLP.label: for disambiguation @title isn't meant for
Use this when you need to tell the LLM something a UI-facing label shouldn't say, e.g. "don't use this column for X." This was a real bug we hit: a BU_TYPE code column (1=person, 2=organisation) was being picked by the LLM whenever a question asked for a customer's "name," because nothing told it otherwise. The fix:
entity Customers {
key PARTNER : String(10); @NLP.label: 'Partner type code: 1=person, 2=organisation. NOT a name, never use for name lookups' BU_TYPE : String(2); @NLP.label: 'Customer / business partner full name, use this whenever a question asks for a name' BU_SORT1 : String(40); }
After adding the
앞부분만 보여 드려요. 나머지는 저장소에서 읽어 보세요