Skip to main content
Glama
Haseeb-Ahmed-AI

customer-data-mcp

mcp-oracle-claude desktop

로컬 MCP(Model Context Protocol) 서버로, 고객 데이터를 쿼리 가능한 도구로 노출합니다. Claude는 이 서버를 직접 호출하여 고객에 대한 자연어 질문에 답할 수 있습니다.

현재 데이터는 로컬에서 목(mock) 처리되어 있습니다(data/customers.json, 주문 내역이 포함된 가짜 고객 레코드 28개). 나중에 목 데이터 계층은 MCP 도구 코드를 건드리지 않고 Oracle AI Agent Studio와의 실제 연결로 교체할 수 있습니다. 아래의 Oracle AI Agent Studio로 교체하기를 참조하세요.

이 프로젝트가 하는 일

stdio 기반 MCP 서버로서 다섯 가지 도구를 제공합니다:

도구

기능

search_customers

이름, 이메일 또는 회사로 검색(부분 일치)

get_customer_details

정확한 ID로 고객 한 명의 전체 프로필 조회

get_customer_orders

고객 한 명의 주문 내역 조회

list_customers_by_status

상태(active / inactive / churned)로 고객 필터링

get_customer_stats

고객 한 명의 총 지출액, 주문 건수, 평균 주문 금액 조회

Claude Desktop에서 사용자 지정 커넥터로 등록하면 Claude는 이 도구들을 스스로 호출해서 "어떤 고객들이 이탈했나요?" 또는 "John Smith가 무엇을 주문했나요?" 같은 질문에 답할 수 있습니다.

Related MCP server: CRM MCP Server

프로젝트 구조

/mcp-oracle-demo
  /data
    customers.json          # mock customer + order data
  /src
    data_source.ts          # ONLY file that touches raw data — the Oracle swap point
    server.ts                # MCP server entry point, registers all tools
    tools/
      search_customers.ts
      get_customer_details.ts
      get_customer_orders.ts
      list_customers_by_status.ts
      get_customer_stats.ts
  /test
    test_data_source.ts     # manual test walkthrough (npm test)
  package.json
  tsconfig.json
  README.md

로컬 설치 및 실행

Node.js 18+가 필요합니다.

cd mcp-oracle-demo
npm install
npm run build      # compiles src/ -> dist/
npm start           # runs the compiled server over stdio

빌드 단계 없이 로컬 개발하려면:

npm run dev          # runs src/server.ts directly via tsx

Claude Desktop에 연결하기 전에 모든 것이 제대로 작동하는지 확인하려면 테스트 워크스루를 실행하세요. 데이터 접근 계층과 모든 도구 핸들러를 실행하며 각 검사 결과를 PASS/FAIL로 출력합니다:

npm test

stdio MCP 서버는 자체적으로 stdout에 아무것도 출력하지 않습니다(stdout은 프로토콜 스트림 전용입니다). 서버가 시작되면 stderr에 customer-data-mcp server running on stdio 줄이 표시되고, 이후 클라이언트(예: Claude Desktop)가 연결되기를 기다립니다.

Claude Desktop에서 등록하기

claude_desktop_config.json(Claude Desktop 메뉴 → 설정 → 개발자 → 구성 편집)에 항목을 추가하고 컴파일된 서버를 가리키게 하세요:

{
  "mcpServers": {
    "customer-data": {
      "command": "node",
      "args": ["/absolute/path/to/mcp-oracle-demo/dist/server.js"]
    }
  }
}

절대 경로를 사용하세요. Claude Desktop은 이 프로젝트 폴더가 아니라 자신의 작업 디렉터리에서 프로세스를 시작합니다. 설정을 저장한 후 Claude Desktop을 다시 시작하면 새 채팅에서 "customer-data"가 연결된 도구 소스로 표시될 것입니다(🔌 / 도구 아이콘을 찾아보세요).

연결 후 시도할 만한 예시 질문

  • "모든 활성 고객을 보여 줘."

  • "[고객 이름] 고객이 무엇을 주문했나요?"

  • "이탈한 고객은 누구인가요?"

  • "고객 CUST-0012가 우리에게 지출한 금액과 평균 주문 금액은 얼마인가요?"

  • "Acme Co.의 고객을 찾아 줘."

Oracle AI Agent Studio로 교체하기

src/data_source.ts는 원시 고객 데이터를 다루는 유일한 파일입니다. 모든 MCP 도구는 JSON 파일을 직접 읽지 않고 이 파일이 내보내는 함수(getCustomerById, searchCustomers, getCustomerOrders, getCustomersByStatus, getCustomerStats)를 호출합니다. 따라서 이후 실제 백엔드에 연결할 때는 도구 정의나 서버가 아니라 이 파일 하나만 수정하면 됩니다.

data_source.ts 안에서 바뀌어야 할 것들:

  1. 인증 처리 — Oracle AI Agent Studio API에 대한 토큰 흐름(예: OAuth 클라이언트 자격 증명 또는 API 키)을 추가합니다. 하드코딩하는 대신 환경 변수에서 자격 증명을 읽도록 하고, 호출마다 재인증하지 않도록 수명이 짧은 토큰 캐시를 사용합니다.

  2. 로컬 JSON 읽기 대체 — loadCustomers()의 로컬 JSON 읽기를 Oracle 엔드포인트에 대한 인증된 REST 호출(예: GET /customers/{id}, GET /customers/search?q=..., GET /customers?status=...)로 대체하고, Oracle의 응답 형태를 이미 그 파일에 정의된 Customer / Order TypeScript 인터페이스에 매핑합니다(또는 Oracle 스키마가 다르면 인터페이스를 조정합니다).

  3. 오류 처리 — 실제 API는 로컬 파일 읽기에서는 발생하지 않는 타임아웃, 속도 제한, 오류가 발생할 수 있습니다. 따라서 try/catch와 도구가 Claude에게 표시할 수 있는 명확한 오류 메시지를 추가하세요.

  4. 캐싱 — 현재 인메모리 캐시는 정적 데이터를 전제로 합니다. 실제 백엔드를 대상으로 할 때는 캐시를 제거하거나 짧은 TLS을 부여해야 h요합니다.

이 각 항목에 대한 자세한 내용은 src/data_source.ts 맨 아래 주석에도 정리되어 있습니다.

테스트

npm test를 실행하는 test/test_data_source.ts는 다음과 같은 작업을 합니다:

  • data_source.ts의 모든 함수를 직접 호출하여 그 결과를 목 데이터의 알려진 속성과 확인합니다 (예: 알려진 고객 ID는 정상으로 null을 반환하고, 알 수 없는 ID는 null을 반환하며, 검색은 대소문자를 구분하지 않습니다).

  • 모든 도구 핸들러 함수를 MCP 전송을 거치지 않고 직접 호출하여, 반환된 JSON이 올바른 형식이고 기본 데이터와 일치하는지 확인합니다.

이 코드는 테스트 프레임워크가 없는 일반 스크립트이므로 화면 공유 demo에서 한 줄씩 읽고 설명하기 쉽습니다.

Available Tools

5 tools
get_customer_detailsA

Get the full profile for a single customer by their exact customer ID (e.g. 'CUST-0007'). Returns name, contact info, company, signup date, status, and order summary. If you only have a name or email, use search_customers first to find the customer ID.

NameRequiredDescriptionDefault
customer_idYesThe exact customer ID, e.g. 'CUST-0007'.

TDQS

A4.2/5.0
Behavior3/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 states that it returns a profile with specific fields, implying a read-only operation, but it doesn't explicitly confirm read-only behavior, error handling (e.g., not found), or any side effects. While adequate for a simple get, it could be more explicit about the safety and failure modes.

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 two sentences with no filler. The core purpose is front-loaded, and the alternative usage is stated concisely. Every sentence contributes information, and there is no redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a single-parameter tool with no output schema and no annotations, the description covers the essential context: what it does, what it accepts, what it returns, and how to route when the ID is unavailable. It does not detail return structure or error cases, but given the tool's simplicity, this is reasonably complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% for the single parameter, so baseline is 3. The description adds value by giving an example format ('CUST-0007') and emphasizing 'exact customer ID', which clarifies that the value must match precisely. This goes beyond the schema's description to reduce ambiguity.

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 'Get' and a specific resource 'full profile for a single customer', and identifies the key identifier (customer ID). It distinguishes from the sibling search_customers by explicitly stating when to use that alternative, and it lists the returned fields, making the tool's purpose unambiguous.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly says 'If you only have a name or email, use search_customers first', giving clear guidance on when to prefer an alternative. However, it does not address other siblings like get_customer_orders or list_customers_by_status, though the mention of 'order summary' hinted at potential overlap. The guidance is helpful but not exhaustive.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_customer_ordersA

Get the full order history for a single customer by their exact customer ID (e.g. 'CUST-0007'). Returns a list of orders, each with an order ID, date, product, amount, and order status. If you only have a name or email, use search_customers first to find the customer ID.

NameRequiredDescriptionDefault
customer_idYesThe exact customer ID, e.g. 'CUST-0007'.

TDQS

A4.1/5.0
Behavior3/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 implies read-only behavior via 'Get' but does not explicitly state non-mutating or any error/edge-case behavior. It does describe the return structure (list with fields), which adds some value, but lacks disclosure on empty results, pagination, or access requirements. For a simple read operation this is adequate but not rich.

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?

Two sentences, front-loaded with the primary action and example. The second sentence adds return details and a redirect to search_customers. Zero waste, every clause earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a single-parameter read tool with no output schema, the description fully explains what it returns (list with order fields) and provides an alternative when prerequisites are unmet. There is no missing information an agent needs to invoke it correctly.

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 coverage is 100% and the schema itself documents customer_id with the same example and description. The description adds the qualifier 'exact' and repeats the example, but this is marginal beyond the schema. Baseline 3 is appropriate since the schema does the heavy lifting.

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 tool gets the full order history for a single customer by exact customer ID, with the example 'CUST-0007'. It also specifies return fields, making the purpose unambiguous. It does not explicitly contrast with every sibling, but it does name search_customers as an alternative, which helps differentiation.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear usage context: use when you have the exact customer ID, and if you only have a name/email, use search_customers first. This explicitly sets a condition for when not to use this tool. However, it does not mention other siblings like get_customer_details or get_customer_stats, so coverage of alternatives is incomplete but sufficient for basic routing.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_customer_statsA

Get summary spend statistics for a single customer by their exact customer ID (e.g. 'CUST-0007'): total order count, total spend (excluding cancelled/refunded orders), average order value, and lifetime value. Use this for questions about how much a specific customer has spent, rather than their raw order list.

NameRequiredDescriptionDefault
customer_idYesThe exact customer ID, e.g. 'CUST-0007'.

TDQS

A4.1/5.0
Behavior3/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 discloses a key behavioral detail—total spend excludes cancelled/refunded orders—which is essential to interpret the output. However, it does not cover edge cases like nonexistent customer IDs or permission requirements, but for a read-only summary tool this is acceptable.

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?

Two concise sentences: the first lists the purpose and metrics, the second gives usage guidance. The phrase 'e.g. CUST-0007' repeats the schema example, but the description is otherwise efficient and front-loaded.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a single-parameter read tool with no output schema, the description adequately covers the return values (metrics listed), a hidden behavioral detail (exclusion of cancelled/refunded), and clear usage context. No critical information is missing for correct 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?

Schema coverage is 100%; the schema already describes customer_id with an example. The description reinforces 'exact' and repeats the same example, adding no new semantic information. It meets the baseline for high schema coverage.

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 verb ('Get'), the resource ('summary spend statistics for a single customer'), and specifies the exact metrics returned (total order count, total spend, average order value, lifetime value). It also explicitly differentiates from raw order lists via the phrase 'rather than their raw order list,' distinguishing it from the sibling get_customer_orders.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides an explicit when: 'Use this for questions about how much a specific customer has spent,' and a when-not with an alternative: 'rather than their raw order list.' This gives clear guidance without ambiguity.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_customers_by_statusA

List all customers with a given status. Valid statuses are 'active', 'inactive', or 'churned'. Returns each matching customer's basic profile info. Use this for questions like 'show me all active customers' or 'which customers have churned?'

NameRequiredDescriptionDefault
statusYesThe customer status to filter by.

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are present, so the description bears full responsibility for behavioral disclosure. It states that the tool returns 'basic profile info', implying a read-only operation and summarizing the output. It does not mention pagination, ordering, or potential limitations, but for a simple list-by-status tool this is sufficient. The description is honest and does not contradict any annotations (there are none).

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 two concise sentences: the first delivers the core action and valid values, the second states the return type and provides query examples. It is front-loaded with the essential purpose and contains zero filler, making it easy for an agent to parse quickly.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a single-parameter tool with no output schema and no annotations, the description covers the essential context: what it does, valid inputs, return nature, and usage examples. It does not mention pagination or any edge cases, but given the simplicity of the operation, this is adequate. A 5 would require addressing potential limitations or more specific return details, which are not critical here.

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 coverage is 100% — the single 'status' parameter already has an enum and a clear description. The description repeats the valid statuses and gives usage examples, which adds a little context but does not provide new semantic meaning beyond what the schema declares. This matches the baseline of 3 for full schema coverage.

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 action ('List'), the resource ('all customers'), and the specific filter ('with a given status'). It also gives concrete example queries, which makes the purpose unambiguous. The verb 'list' distinguishes it from sibling tools like search_customers (search) and get_customer_details (single customer), so an agent can easily tell them apart.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit usage context with example questions ('show me all active customers', 'which customers have churned?'), telling the agent when to invoke this tool. However, it does not mention when not to use it or explicitly contrast with alternatives like search_customers or get_customer_details, so it stops short of the full 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_customersA

Search for customers by name, email, or company name. Performs a case-insensitive partial match, so 'smith' will match 'John Smith' and 'jane.smith@...'. Returns a list of matching customers with their basic profile info (does not include full order history — use get_customer_details or get_customer_orders for that). Use this when the user gives a name, email, or company rather than an exact customer ID.

NameRequiredDescriptionDefault
queryYesSearch text to match against customer name, email, or company (partial match, case-insensitive). Example: 'smith', 'acme', 'john@example.com'.

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the behavioral burden. It discloses case-insensitive partial matching, indicates the return content ('basic profile info'), and explicitly excludes full order history, directing to other tools. It does not mention pagination or error behavior, but for a read-only search these are minor gaps.

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?

Three sentences, front-loaded with the core purpose, each earning its place. No redundancy, and the secondary alternatives are mentioned succinctly without digressing.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple one-parameter search tool, it covers the essential context: what it matches, what it returns (basic profile), what it excludes (order history), and when to use it. It could elaborate on what 'basic profile info' includes, but given the single parameter and no output schema, this is adequate.

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 already fully documents the query parameter with description and example, covering the matching behavior (partial, case-insensitive). The tool description restates the same info but adds no new semantic detail beyond the schema, so baseline 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?

Description states a specific verb ('Search for customers'), identifies the resource ('customers'), and enumerates searchable fields (name, email, company). It also distinguishes from siblings by noting it's for partial text matches rather than exact IDs and mentions get_customer_details/get_customer_orders for order history, making it clear what this tool is for.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explicitly states when to use: 'Use this when the user gives a name, email, or company rather than an exact customer ID.' It also guides toward alternatives for order history, providing clear when-to-use and when-not-to-use guidance.

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.

  1. 5 tool updatesv1.0.0
    • First observedget_customer_details
    • First observedget_customer_orders
    • First observedget_customer_stats
    • First observedlist_customers_by_status
    • First observedsearch_customers

TDQS

A4.4/5.0

Scored across 5 tools

Disambiguation5/5

Each tool has a clearly distinct purpose: search by name/email/company, get details by ID, get orders by ID, list by status, and get stats by ID. There is no overlap; the descriptions explicitly clarify when to use each (e.g., search_customers vs. get_customer_details).

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern using snake_case: search_customers, get_customer_details, get_customer_orders, list_customers_by_status, get_customer_stats. The verbs (search, get, list, get) and nouns are uniform and predictable.

Tool Count5/5

5 tools is well-scoped for a customer data server, sitting comfortably within the ideal 3-15 range. Each tool addresses a distinct query type without redundancy, making the surface concise and maintainable.

Completeness4/5

The tool set covers the core read-oriented workflows: search, details, orders, status-based listing, and stats. The only minor gap is a lack of a way to list all customers regardless of status (e.g., a list_customers tool), but list_customers_by_status can approximate this with a single status, and the domain appears read-only by design.

Maintenance

ActivityStale
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers