Skip to content

Sample work · AI & Automation

MCP Server: Company Data for Claude, with Roles and Audit Log

An MCP server connects a sample company database with an AI assistant. Reading and writing depend on roles, every call is logged, and inputs with special characters cause no harm.

Sample work (demo), not a client job. Built as a trial task with invented example data; the check figures below come from the automatic test run and are not polished.

What was built

  • Tools for search, open invoices, and order status, with schema and read flag
  • Roles via token: anyone only allowed to read cannot write; unknown tokens are rejected
  • Every call logged with role, tool, and result

Download mcp-server-demo.zip

The database is an example. A real company system needs its access and a mapping of its fields; the integration into Claude Desktop is included as configuration, but was not clicked through in Claude Desktop itself during the test.

How it was checked

Automatic test run on 2026-10-31, taken from the log (test data invented, figures measured):

  • MCP server (SDK mcp 2.x, stdio subprocess) connected to sample company DB: 4 tools with schema/readOnlyHint as expected
  • 10 searches, 5 open invoice queries, 6 order statuses = target from raw tables
  • '%'/'_' literally, injection has no effect
  • Writing with read role/wrong token rejected

Limits

What this sample does not cover, so nobody expects more:

  • Authentication here local: token in the subprocess environment, role via its SHA-256 in rollen.json - fits stdio on your own machine; a remote HTTP server needs OAuth …
  • The 'existing software' is a sample SQLite database; a real customer system (ERP, shop, CRM) needs its API access or DB rights and a mapping of its fields - that is the …
  • Calls that already fail the SDK's schema check (e.g., text instead of number) do not reach the tool and are therefore not in the audit log, only in the server log
  • Audit log is a local file without tamper protection (no signature/WORM); for audit-proof compliance, it must go into a secured system
  • Permissions coarsely per tool (role -> tools), not per record (e.g., only own customers)
  • Tested with the SDK client via stdio; integration into Claude Desktop is provided as configuration, but not clicked through with Claude Desktop itself in the test

Something like this for your business?

Describe briefly what you need. You get a fixed price before I start; nothing happens without your yes.

To the workshop