Qeasy Cloud
Get Started
Model Context Protocol · Knowledge Retrieval

Qeasy Knowledge MCP Server

An MCP server that gives AI agents expert-level access to Qeasy's e-commerce financial reconciliation knowledge: 748 production-tested knowledge atoms across 15 finance domains, 15 platform topics and 17 customer cases (topics include boundary/onboarding knowledge, not necessarily live reconciliation support). 82 atoms of general methodology and accounting standards are public today; platform playbooks and customer cases require authorization. Agents search, inspect and fetch exact evidence with Git-traceable citations — then generate the answer themselves. One stateless HTTP endpoint: POST /api/mcp.

Live Now: Three Knowledge Tools

The tool surface is discoverable at runtime through MCP `tools/list`. No SDK or generated client is required — any MCP-compatible agent (Claude, Cursor, custom) can connect over plain JSON-RPC.

knowledge_search — find evidence

Hybrid vector + keyword retrieval over the reconciliation knowledge base. Parameters: query (required); product, type filters; limit (1–20, default 8); granularity ('doc' default, or 'atom' for one hit per KA-* knowledge atom); includeMeta (add domain/platform metadata). Returns ranked hits with citation, score and visibility.

knowledge_fetch — open the source

Fetch a full document, or a single knowledge atom, by docId, citation (sourcePath#atomId) or atomId. Optional maxChars caps the response for your token budget. Restricted documents return -32403 unless the key is authorized.

knowledge_domains — route before searching

List the product × type knowledge domains visible to your identity, with document counts. Free of quota — call it first to decide where to search.

Getting Started

The endpoint is stateless: every request carries its own authentication, so it works from serverless agents and multi-instance deployments alike.

Endpoint: POST https://qeasy.cloud/api/mcp — JSON-RPC 2.0 over MCP Streamable HTTP (stateless mode). GET/DELETE return 405 and no session is maintained.

Authentication is optional. Omit the Authorization header for anonymous access (10 tool calls/day per IP, public knowledge only). Add `Authorization: Bearer qk_live_...` for a standard key (10 calls/day, self-serve at /account) or an authorized key (unlimited + restricted knowledge, granted by Qeasy).

Recommended flow: initialize → tools/list → knowledge_domains (free) → knowledge_search → knowledge_fetch(citation#atomId).

Claude Desktop / Cursor — mcp.json

{
  "mcpServers": {
    "qeasy-knowledge": {
      "url": "https://qeasy.cloud/api/mcp",
      "headers": {
        "Authorization": "Bearer qk_live_YOUR_KEY"
      }
    }
  }
}

Raw JSON-RPC — initialize / tools/list / search / fetch

# 1) handshake
curl -s https://qeasy.cloud/api/mcp \
  -H 'content-type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"my-agent","version":"1.0"}}}'

# 2) discover tools (schemas + descriptions)
curl -s https://qeasy.cloud/api/mcp \
  -H 'content-type: application/json' \
  -d '{"jsonrpc":"2.0","id":2,"method":"tools/list"}'

# 3) search public knowledge (anonymous, no key required)
curl -s https://qeasy.cloud/api/mcp \
  -H 'content-type: application/json' \
  -d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"knowledge_search","arguments":{"query":"费用按收入占比分摊什么时候合理","granularity":"atom","includeMeta":true}}}'

# 4) authorized key: search restricted playbooks and fetch one atom
curl -s https://qeasy.cloud/api/mcp \
  -H 'content-type: application/json' \
  -H 'Authorization: Bearer qk_live_YOUR_KEY' \
  -d '{"jsonrpc":"2.0","id":4,"method":"tools/call","params":{"name":"knowledge_fetch","arguments":{"citation":"docs/knowledge/platforms/jdpop.md#KA-PARSE-JDPOP-HEADER-001"}}}'

Response & Citation Contract

Tools return retrieval evidence, never generated prose. The calling agent owns the answer and must cite what it used.

  • Search hits: { docId, title, excerpt (≤500 chars), score, product, type, citation, url, visibility, atomId?, docMeta? } — atomId is present whenever the hit maps to a KA-* knowledge atom, and docMeta only when includeMeta=true.
  • citation format: `docs/knowledge/<file>.md#KA-...` — the Git source path plus the atom anchor. Always cite this value in the answer; it is stable and auditable.
  • granularity="atom" returns one hit per knowledge atom (best for expert rules, thresholds, error codes and edge cases); granularity="doc" folds each document to its best-matching atom.
  • A successful fetch returns the full text (or one atom) plus citation, product/type, visibility and docMeta; maxChars adds truncated:true and originalChars when the response was capped.
  • quota { remaining, resetAt } is included for anonymous and standard identities; authorized keys are unlimited and omit it.
  • Empty results are not errors: hits:[] plus suggestions. No match usually means the knowledge is restricted (needs an authorized key) or the question is outside the reconciliation domain.

Access Tiers & Quotas

Two tiers and three identities. Registration never raises the quota — only explicit authorization does.

Quota resets daily at 00:00 Asia/Shanghai. The 11th counted call returns JSON-RPC -32029 with data.retryAfter and data.resetAt. knowledge_domains, initialize and tools/list are free.

Every tool call is authenticated, visibility-filtered in SQL, quota-checked and written to an audit log (tool, identity tier, key prefix, IP, latency, status; never the plaintext key or document body).

Anonymous — no key

10 tool calls/day per IP, public knowledge only (currently 82 atoms: expense accounting/allocation, platform onboarding methodology, revenue recognition, VAT & invoicing). Best for trying the endpoint and discovering the tool schema.

Standard — self-serve key

Create a key at /account (max 5 active keys per user). 10 calls/day per key, public knowledge only. Use it for stable identity and fixed credentials in your MCP client.

Authorized — granted by Qeasy

Unlimited calls and the full 748-atom knowledge base (public + restricted: platform playbooks, variance labels, customer cases), with configurable product/type scope and expiry. Issued through Qeasy's admin console; contact us to apply.

Errors & Limits

  • -32001 UNAUTHORIZED — invalid, revoked or expired key (HTTP 401). Fix the Bearer token.
  • -32403 FORBIDDEN — the document is restricted and your identity is not authorized. data.upgradeHint explains the next step.
  • -32029 RATE_LIMITED — daily quota exhausted. data.retryAfter (seconds) and data.resetAt (Asia/Shanghai midnight).
  • -32602 INVALID_PARAMS — argument validation failed; message names the offending field (e.g. query empty, limit > 20, bad atomId format).
  • -32601 METHOD_NOT_FOUND — unknown JSON-RPC method; -32600 INVALID_REQUEST — missing method or batch array; -32700 PARSE_ERROR — body is not valid JSON (HTTP 400).
  • -32603 INTERNAL_ERROR — server-side failure; retry with backoff. Request bodies are single JSON objects (batches are rejected).
  • Knowledge scope: currently the Qeasy e-commerce financial reconciliation corpus (52 documents / 748 atoms; 82 public). Data-integration knowledge and business write tools are on the roadmap; public domains appear in knowledge_domains as they are onboarded.

R18 Retrieval & Runtime Hardening

  • Search adds domain/platform filters, stable cursor pagination and minScore. score is normalized 0–1 with vector/keyword/rrf breakdown and matchedOn; off-topic queries return hits:[] instead of unrelated evidence.
  • initialize and tools/list read live identity-visible corpus statistics; knowledge_domains adds stats and domain/platform facets; all three tools declare outputSchema.
  • Query embeddings and retrieval results use TTL caches with same-request coalescing and corpus-revision invalidation. Responses expose X-Qeasy-Cache and Server-Timing.
  • Every response carries X-Request-ID linked to audit logs. CORS/OPTIONS, 401 WWW-Authenticate, a 64 KiB body limit, and default 60 requests/minute per key/IP with RateLimit/Retry-After headers are enabled.
  • Health: GET /api/v1/mcp/health reports PG, Redis, embedding and public knowledge status.

Roadmap

This endpoint is intentional about scope: it is a retrieval server, not a general-purpose business API. The following capability families are planned, not available today — do not build against them yet.

  • connector.invoke / connector.describe — call prebuilt ERP, e-commerce, CRM, WMS and MES connectors with schema-validated parameters.
  • pipeline.run / pipeline.status — trigger and monitor data-integration pipelines.
  • reconciliation.query / reconciliation.explain / reconciliation.draft — query reconciliation results, trace discrepancies and draft vouchers for human confirmation.

Give your agent the reconciliation expert it lacks

Start with a free standard key at /account to explore public knowledge, or apply for an authorized key to unlock the full restricted knowledge base and unlimited calls.

Qeasy Knowledge MCP Server — E-commerce Reconciliation Knowledge for AI Agents | Qeasy Cloud