FreightLens MCP
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
FreightLens MCP
An MCP server that lets AI apps such as Claude Desktop read freight documents and check invoices against quotes in FreightLens.
Principle: the LLM reads, software decides. Every number the model sees was computed by FreightLens's code, including the formatted amounts (
USD 56.00). The model only explains results; it never does arithmetic, and it cannot approve or reject documents.
Status: works locally over stdio with Claude Desktop and the MCP Inspector. Remote deployment and OAuth are next (see Roadmap). All data is synthetic, from FreightLens's own generator.
What you can ask
With the server connected, a user can ask Claude in plain English:
"Do any of my FreightLens invoices have overcharges?"
Claude lists the documents, reads each invoice's stored comparison with its quote, and answers from the computed results. In a test on the synthetic data it found, for example:
Invoice | Charge | Quoted | Invoiced | Over |
INV-791511 | Origin Terminal Handling | USD 230.00 | USD 286.00 | USD 56.00 |
Related MCP server: Bsoft TMS
How it fits together
flowchart LR
U[User] --> H[Claude Desktop<br/>MCP host]
H -- "MCP over stdio" --> S[freightlens-mcp<br/>this server]
S -- "HTTPS + login token" --> A[FreightLens API]
A --> D[(Postgres<br/>row-level security)]
W[FreightLens web app] --> AThe server is one more client of the FreightLens API, like the web app. It never touches the database, so login, tenant isolation and validation all stay in FreightLens.
What the server offers
Kind | Name | What it does | Behaviour |
Tool |
| Newest quotes and invoices with type and status | Read-only |
Tool |
| What FreightLens read from one document: route, charges, total, issues, comparison | Read-only |
Tool |
| Compares an invoice with its quote and lists every discrepancy | Writes; safe to repeat (idempotent) |
Resource |
| One document as JSON, for a user to attach to a chat | Read-only |
Prompt |
| "Explain this invoice's differences for the person who pays it" | Picked by the user |
Design decisions
Adapter over the REST API, not a second backend. The server reuses FreightLens's authentication and row-level security instead of holding database credentials.
Results shaped for a model (
views.py). Only the useful fields are returned; money comes as integer cents and adisplaystring formatted by code; each reconcile outcome comes with a fixed sentence explaining it.Human decisions stay human. Approving, correcting or rejecting a document under review is not exposed: FreightLens requires a person's note to approve over an error, and that should not be a model's choice.
Errors the model can act on. Known failures become MCP tool errors with a next step ("Document not found. Call list_documents to see valid ids."). Unexpected failures show the model only a generic message; the details go to the server log (stderr), never into the conversation.
Input checked twice. The tool schema limits values (for example
limitis 1 to 100), and the client accepts only UUIDs as document ids, so model input can never change the API path.Tool annotations mark which tools are read-only and which are idempotent, so a host can decide when to ask the user for approval.
Quick start
Requirements: Python 3.11+, and FreightLens running locally (see its Quick start) with an account and a few processed documents.
git clone https://github.com/fanuman/freightlens-mcp.git
cd freightlens-mcp
python3 -m venv venv && source venv/bin/activate
pip install -e ".[dev]"
cp .env.example .env # then fill in FREIGHTLENS_EMAIL and FREIGHTLENS_PASSWORDTry it in the MCP Inspector
npx @modelcontextprotocol/inspector "$PWD/venv/bin/freightlens-mcp"Connect it to Claude Desktop
Settings → Desktop app → Extensions → Local MCP servers → Edit config, then add:
{
"mcpServers": {
"freightlens": {
"command": "/absolute/path/to/freightlens-mcp/venv/bin/freightlens-mcp"
}
}
}Restart Claude Desktop. The server finds its .env on its own, so no other settings are needed.
Development
pytest # 28 tests: the API client against a fake API, the server through a real MCP client
ruff check . && ruff format --check .
mypy # strictThe server tests connect a real MCP Client to the server in-process and send real tools/list,
tools/call, resources/read and prompts/get requests. FreightLens is faked with httpx.MockTransport,
so the tests need no API, database or network.
src/freightlens_mcp/
client.py HTTP client for the FreightLens API (login, token refresh, clear errors)
views.py what the tools return: small typed models, money formatted by code
server.py the MCP tools, resource template and prompt
tests/
test_client.py
test_server.pyRoadmap
Local server over stdio: three tools, a resource template, a prompt, 28 tests
Remote server over Streamable HTTP, deployed to AWS
OAuth 2.1 instead of a password in
.env, with each caller mapped to their own FreightLens companyThreat model (tool poisoning, confused deputy, token passthrough)
Tool-selection evaluation: does the model pick the right tool with the right arguments, and does it ever do arithmetic itself?
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
EU AI Act risk classifier, TARIC code validator, and 3-way freight reconciliation MCP server.
Invoicing you drive by talking to your AI: log time, raise invoices and track what's owed via MCP.
Connect Claude, ChatGPT and other MCP clients to your Cybership warehouse account.
Furgonetka MCP Server is an extension for LLMs (such as Claude) that integrates AI assistants with Poland's most popular courier brokerage platform. The server enables models to interact directly with services from various couriers (including InPost, DPD, DHL, UPS, and Poczta Polska) through a single, unified interface. With this integration, your AI stops just "writing about logistics" and starts actually managing it.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to manage logistics operations including orders, shipments, tracking, and warehouse management through standardized MCP tools.-
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to read and write Brazilian carrier transportation management data, including fiscal documents (CT-e, MDF-e, NF-e), financial records, fleet and maintenance, trip control, and people registries via MCP over HTTP.MIT
- AlicenseNot gradedqualityBmaintenanceEnables evidence-driven motor-carrier search, qualification, risk assessment, monitoring, and TMS integration directly from Claude Code and MCP clients.1Apache 2.0
- AlicenseCqualityBmaintenanceEnables AI agents to render documents, check e-invoicing compliance, manage customers, and reach the full public API through MCP tools, including searching and executing any operation.30224 npmMIT