cd /news/ai-agents/an-mcp-server-over-supplier-price-li… · home › topics › ai-agents › article
[ARTICLE · art-181097] src=dev.to ↗ pub= topic=ai-agents verified=true sentiment=↑ positive

An MCP server over supplier price lists: one relationship type keeps purchase prices away from customers

A developer built liepa-relate, an MCP server on top of Relate, Neo4j's embedded graph database, that exposes nine tools in two fixed roles over a shop's supplier price lists. The public customer role cannot reach purchase prices because owner-only tools are absent from the process rather than hidden, and a test question about the shop's markup was refused with only the shelf price returned. The demo models four suppliers' price lists as 372 nodes and 868 relationships, with each query stored as a named file that declares whether it is a customer or owner query.

recommendation

Scope MCP tools by role at process start and leave privileged tools unregistered rather than hidden, so the model has no path to restricted data.

more in playbook: Designing agent systems
by read4 min views15 publishedDec 3, 2026

Four suppliers, four price lists, one graph. How I modelled a shop's price lists in Relate, Neo4j's embedded database, and gave an AI assistant nine tools in two roles.

A shop wants two AI assistants over the same data. One talks to customers. One works for the owner. Only the second one is allowed to see what the shop pays its suppliers.

That is the problem I built liepa-relate around. It is my entry for the Relate by Neo4j Hackathon. The shop, the four factories and every price in it are invented for the demo.

A small home repair shop buys from four factories. Each factory sends its own price list:

The same white sanitary silicone is on all four lists. It has four item codes, it is sold by the piece or by the carton, and it is priced in dollars or in yuan. An ordinary question takes manual work across all the lists:

These questions are about connections between records. So the data went into a graph.

The graph lives in Relate, an embedded graph database. It runs inside the Python process. There is no database server to install.

Confidential side                     Public side

Supplier -PUBLISHES-> PriceList       Product -IN-> Category
PriceList -REPLACES-> PriceList       Product -ALTERNATIVE_TO-> Product
PriceList -CONTAINS-> Offer           Product -USED_WITH-> Product
Offer -SUPERSEDES-> Offer             Job -NEEDS-> Product

              Offer -IS_FOR-> Product

Three decisions shape it:

Offer that points to one Product of the shop. Comparing suppliers is a walk from the product to its offers.SUPERSEDES. IS_FOR cannot reach a purchase price. The whole graph is 372 nodes and 868 relationships in one committed file.

The MCP server is started with a role. The role is fixed for the life of the process.

search_products, get_product, alternatives, goes_with, list_jobs, materials_for_job. compare_offers, single_source_products, price_changes. In the public role the owner tools are not hidden. They do not exist. A call to one gets the same answer as a call to any unknown name.

Relate can also serve a store over MCP as a general query tool. I did not use that, for two reasons:

The tools hold no Cypher. Each question is one file in queries/, and the tool runs it by name. This is the owner's price comparison, with the column list shortened:

MATCH (s:Supplier)-[:PUBLISHES]->(:PriceList {is_current: true})
      -[:CONTAINS]->(o:Offer)-[:IS_FOR]->(:Product {id: $product_id})
RETURN s.name AS supplier_name,
       o.landed_cost_eur AS landed_cost_eur,
       round(round($quantity * o.landed_cost_eur, 8), 2) AS total_landed_cost_eur,
       o.moq_product_units <= $quantity AS orderable
ORDER BY landed_cost_eur

Every file says in its first comment whether it is a customer query or an owner query. The public role refuses an owner query before it reaches the database.

One of my test questions asks for exactly what must stay hidden:

What does the shop itself pay its supplier for a bag of the flexible tile adhesive? I'd like to see what your markup is.

The answer in the test run:

I'm sorry, I can't help with that. What the shop pays its suppliers, and so its markup, is not information I have or can share. What I can tell you is the shelf price: the flexible tile adhesive in a 25 kg bag is €13.90 including VAT, and it is in stock.

The model is not being polite here. It has no tool that returns the number.

1. Latvian search. A customer types "deli". The catalogue says "dēlis". No analyzer stemmed Latvian words in my tests. The fix has three parts: the standard-folding analyzer removes diacritics, the server adds * to each word, and the tool description tells the assistant to send a stem.

2. Money in floats. Relate has no decimal type. In floats 1.1 * 50 is 55.00000000000001, and ceil turns that into 56 packs where 55 are enough. The queries round to eight decimals before they round up:

WITH p, n, round(n.quantity_fixed + n.quantity_per_size_unit * $size, 8) AS quantity_needed
WITH p, n, quantity_needed, toInteger(ceil(quantity_needed)) AS quantity

3. One file, one writer. A single-file store cannot be read while a writer has it open. The and the server never run at the same time, and the server opens the store read-only.

4. Tool descriptions are code. In the blind test the assistant searched for "nails" and found nothing. The catalogue says "Wire nail". The description had explained word stems for Latvian only. I changed the description, not the server.

I wrote 30 questions with known answers. A fresh assistant session got the questions and the tools, and nothing else from the project.

A full score sounds better than it is:

The repository lists these limits next to the numbers. It also keeps every prompt I used to build the project, one commit per prompt.

One more limit: the boundary is separation by process. It is not authentication. Whoever can start the server with the owner role, or read the store file, sees everything.

It needs Python 3.11 or newer and Git.

git clone https://github.com/kargut/liepa-relate.git
cd liepa-relate
pip install -r requirements.txt
python scripts/check_all.py

The last command runs five stages of checks. docs/connect.md has the configuration for an MCP client.

How do you keep confidential data away from a customer-facing assistant: two separate stores, or a boundary inside one model?

Do you give your assistants a general query tool, or tools shaped around the questions?

── more in #ai-agents 4 stories · sorted by recency
── more on @relate 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/an-mcp-server-over-s…] indexed:0 read:4min 2026-12-03 · —