Cin7 Core Meta MCP Server
This server gives an AI model full, self-discovering access to the Cin7 Core (DEAR) REST API through three generic API-walking tools plus a structured bug-report tool.
Discover endpoints —
list_api_endpoints(keyword, methods, limit)searches Cin7's endpoint paths, summaries, groups, and parameter names by keyword, returning ranked results with pagination info.Inspect an endpoint —
get_api_endpoint_schema(method, path)returns the full schema for any endpoint: query params, request body schema/example, response schema/example, and adid_you_meanhint on typos.Execute arbitrary API calls —
invoke_api_endpoint(method, path, query_params, body)validates the request against a vendored API Blueprint spec (catching unknown endpoints, wrong methods, missing required params, and type mismatches before any network call) and then calls Cin7, returning status, data, and remaining rate limit.Self-throttle — surfaces Cin7's
X-RateLimit-Remainingso the model can pace its calls.Operate read-only — with
CIN7_READ_ONLY=1, only GET requests execute; all writes are refused before hitting the network.Report bugs —
report_issue(...)files structured reports (severity, tool, arguments, observed/expected behavior, error message, response excerpt) to both a log file and stderr, returning a quotablereport_id.Deploy flexibly — runs as a local stdio server for Claude Desktop or as a remote Streamable HTTP service with ScaleKit OAuth 2.0.
Covers the entire Cin7 Core REST surface (Brands, Categories, Carriers, Chart of Accounts, Disassembly, Finished Goods, sale orders, etc.) with a tool list that doesn't grow as the API grows.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Cin7 Core Meta MCP Server List all available API endpoints"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Cin7 Core Meta MCP Server
This is a Model Context Protocol (MCP) server for the Cin7 Core (DEAR) API. Instead of exposing one tool per Cin7 endpoint, this server exposes three generic API-walking tools plus a structured bug-report tool. The model finds what it needs at runtime: list endpoints → read an endpoint's schema → invoke it.
It's a sibling to mcp-cin7-core — that server ships hand-curated tools (cin7_products, cin7_create_purchase_order, …) for common operations. This one covers the full Cin7 Core API surface (Brands, Categories, Carriers, Chart of Accounts, Disassembly, Finished Goods, anything Cin7 ships) with a tiny tool list that doesn't grow as the API grows. Both servers can be installed in the same client; they're complementary.
Features
Four MCP tools that cover the full Cin7 Core REST API surface
API-walking pattern (
list → describe → invoke) keeps the tool list tinyRequest validation against a vendored API Blueprint spec — unknown endpoints, wrong methods, missing required params, and type mismatches are caught before any network call
Rate-limit passthrough — Cin7's
X-RateLimit-Remainingheader is surfaced so the model can self-throttleStructured bug-report tool — appends
ISSUE_REPORT <json>to both a controlled file and stderrScaleKit OAuth 2.0 / Streamable HTTP transport for remote deployments
Stdio transport for local Claude Desktop integration
MCP protocol compliance
Related MCP server: invoiceninja-mcp-server
Prerequisites
Python 3.11+
uv package manager
A Cin7 Core (DEAR) account with API access — get your
AccountIDandApplication Keyfrom Integrations → API
Docs and Links
docs/tools.md— full reference for the four MCP toolsdocs/spec_refresh.md— how/when to refresh the vendored API Blueprint spec
Setup
Get Cin7 Core API credentials
Log in to Cin7 Core (DEAR)
Navigate to Integrations → API
Copy the AccountID and create/copy the Application Key
Authentication
There are 2 modes of running the Cin7 Core Meta MCP server:
1. Streamable HTTP with OAuth (Recommended for production)
This mode runs the server as a web service with OAuth 2.0 authentication via ScaleKit. This is the recommended approach for shared or remote deployments, including connecting via Claude Desktop's remote MCP connector.
Required environment variables:
CIN7_ACCOUNT_ID- Your Cin7 AccountIDCIN7_API_KEY- Your Cin7 Application KeySCALEKIT_ENVIRONMENT_URL- ScaleKit environment URL (e.g.,https://yourapp.scalekit.com)SCALEKIT_RESOURCE_ID- ScaleKit resource identifier (e.g.,res_xxx)SERVER_URL- Your MCP server's public URL (e.g.,https://your-server.example.com)
Optional:
CIN7_BASE_URL- Override the Cin7 base URL (defaulthttps://inventory.dearsystems.com/ExternalApi/v2/)CIN7_READ_ONLY- Set to1to execute GET requests only; every other verb is refused before the network. See Read-only mode.ISSUE_REPORT_PATH- Wherereport_issueappends itsISSUE_REPORT <json>lines (default./data/issue_reports.log)MCP_LOG_LEVEL- Logging level (defaultINFO)MCP_LOG_FILE- Enable file logging with rotation
Running the server:
uv run python -m cin7_meta.server_httpEndpoints:
GET /health- Health check (no auth required)GET /.well-known/oauth-protected-resource- OAuth discovery (no auth required)POST /mcp- MCP endpoint (requires OAuth 2.0 Bearer token)
Connecting from Claude Desktop (remote):
Deploy your server (e.g., to Render — see
render.yaml)Open Claude Desktop > Settings > Connectors
Click "Add Connector" and enter your server URL:
https://your-server.com/mcpClaude will auto-discover OAuth configuration
Click "Authorize" and log in
See CLAUDE.md for detailed ScaleKit setup and interceptor configuration.
2. Stdio Transport (Local development)
This mode runs the server locally using stdio transport for direct integration with Claude Desktop. No OAuth configuration needed — Cin7 credentials are used directly.
Required environment variables:
CIN7_ACCOUNT_IDCIN7_API_KEY
Optional: CIN7_BASE_URL, CIN7_READ_ONLY, ISSUE_REPORT_PATH, MCP_LOG_LEVEL, MCP_LOG_FILE.
Claude Desktop configuration:
Add this to your claude_desktop_config.json:
{
"mcpServers": {
"cin7-meta": {
"command": "uv",
"args": [
"--directory",
"/absolute/path/to/mcp-cin7-meta",
"run",
"python",
"-m",
"cin7_meta.server_stdio"
],
"env": {
"CIN7_ACCOUNT_ID": "your-account-id",
"CIN7_API_KEY": "your-application-key"
}
}
}
}Replace /absolute/path/to/mcp-cin7-meta with the actual path to your clone of this repository.
If you're running both servers together, give them distinct names (e.g. cin7-core for the curated server and cin7-meta for this one) so Claude lists their tools separately.
Installation
# Create virtual environment and install dependencies
uv venv
uv pip install -e .
# Quick import check
uv run python -c "import cin7_meta.server; print('OK')"Vendor the API Blueprint spec (one-time)
This server validates requests against a vendored API Blueprint that ships at cin7_meta/spec/cin7_v2.apib, plus a derived normalized JSON catalog at cin7_meta/spec/cin7_v2.json. A fresh clone won't have these — generate them:
uv run python scripts/refresh_spec.pyRe-run any time the Cin7 API changes or you want to pick up new endpoints. See docs/spec_refresh.md for the full workflow.
Testing with MCP Inspector
# Start the HTTP server
uv run python -m cin7_meta.server_http
# In another terminal, open MCP Inspector
npx @modelcontextprotocol/inspector http://localhost:3000/mcpAvailable MCP Tools
API walking:
list_api_endpoints(keyword, methods, limit)— Ranked keyword search across endpoint paths, summaries, groups, and parameter names. Returns{"results": [...], "total": int, "truncated": bool}.get_api_endpoint_schema(method, path)— Return the full schema for one endpoint: query params (with types and defaults), request body schema, response schema, and JSON examples.
Execution:
invoke_api_endpoint(method, path, query_params, body)— Validate, then execute, an arbitrary Cin7 Core API call. Validation errors (unknown endpoint, wrong method, missing required param, type mismatch) are returned without a network call. Returns{"status", "data", "rate_limit_remaining"}— userate_limit_remainingfor self-throttling. UnderCIN7_READ_ONLY=1any non-GET call is refused without a network call.
Issue reporting:
report_issue(summary, tool_name, tool_arguments, observed_behavior, expected_behavior, ...)— File a structured bug report when a tool doesn't behave as expected. Each report is appended as oneISSUE_REPORT <json>line todata/issue_reports.logand emitted on stderr in the same format, so reports survive even on hosts with ephemeral filesystems (Render's log stream captures the stderr line). Returns areport_idthe model can quote in follow-ups.
For detailed signatures, examples, and return shapes, see docs/tools.md.
For the underlying Cin7 Core API documentation, refer to the Cin7 Core API Reference.
For Developers
Running Tests
# Full test suite
uv run pytest -v
# Quick pass/fail check
uv run pytest --tb=short
# Specific test file
uv run pytest tests/test_invoke_api_endpoint.py -vContributing — Test-Driven Development
This project follows a strict test-driven development (TDD) workflow. Every utility and tool was implemented test-first:
Add fixtures to
tests/fixtures/— either using the small hand-rolledmini_spec.py(fast, deterministic) or the vendoredcin7_v2.jsonfor contract testsWrite failing tests — unit tests against the mini spec, contract tests against the real vendored spec where relevant
Implement to make the tests pass
No new code should be merged without corresponding test coverage. See CLAUDE.md for detailed test patterns, the mock_cin7 fixture, and the EXPECTED_TOOLS registration assertion.
Architecture
cin7_client.py- Async REST client for the Cin7 Core API with retry and error handling (ported frommcp-cin7-core)spec_loader.py- Loads the vendored normalized JSON catalog at startup, builds the in-memory endpoint and search indexesspec_parser.py- Parses API Blueprint markdown into the normalized JSON catalog (used byscripts/refresh_spec.py)spec_search.py- Ranked substring search over the spec index (exact path > prefix > substring > summary/param-name match)validator.py- Validates query params (unknowns, required, types) and body (required fields) against the loaded spec; returns structured error responses instead of raisingissue_reporter.py- Single-function entry point forreport_issuestorage — appends oneISSUE_REPORT <json>line to a controlled file and to stderrserver.py- FastMCP server with the four tool registrationsserver_http.py- Starlette wrapper with MCP Streamable HTTP transport and ScaleKit OAuth (ported)server_stdio.py- Stdio transport for local Claude Desktop integrationresources/- Tool implementations (endpoints.py,invoke.py,issues.py)utils/- Shared utilities
See CLAUDE.md for comprehensive development documentation, test patterns, and architecture details.
Read-only mode
This server exposes exactly one data tool, invoke_api_endpoint, and it walks the
entire Cin7 REST spec — so the same tool that fetches a sale order can also create
or void one. There is no read-only subset to grant instead. That makes the tool
ungrantable to an agent whose read-only boundary is absolute, no matter how the
consuming host's tool allowlist is written.
Setting CIN7_READ_ONLY=1 fixes that at the server:
"env": {
"CIN7_ACCOUNT_ID": "...",
"CIN7_API_KEY": "...",
"CIN7_READ_ONLY": "1"
}Accepted truthy values: 1, true, yes, on (case-insensitive, surrounding
whitespace ignored). Anything else — including unset — leaves the server in normal
read-write mode, so existing deployments are unaffected.
What it does. Only GET is executed. POST, PUT, PATCH and DELETE are
refused before any request is built, so no write can reach Cin7. Enforcement sits
in two independent places, neither load-bearing alone:
invoke_api_endpointchecks first and returns a structured error on the same shape as a validation failure, so the model reads a clear refusal;Cin7Client.invoke()raisesCin7ReadOnlyError— the chokepoint every request passes through, including any future caller that skips layer 1.
The server's MCP instructions also announce the mode, so the model is told up front rather than discovering it by failing.
What it does not do. list_api_endpoints still returns write endpoints: it
describes the Cin7 API, not your permissions. Discovery is harmless; execution is
what is blocked.
This is a second layer, not the only one. The consuming host should still grant the tool deliberately. The point is that the guarantee no longer depends on the host's allowlist or on the model's restraint — it holds inside this process.
Security
Do not commit your .env file or any Cin7 API credentials to version control (it is included in .gitignore as a safe default).
Issue reports written by report_issue may contain raw request bodies, query parameters, and response excerpts — review data/issue_reports.log before sharing it with anyone outside the project.
License
MIT
Available Tools
4 toolsget_api_endpoint_schemaA
Return the full schema for one Cin7 API endpoint.
Args: method: HTTP verb. Case-insensitive. path: Endpoint path. Leading slashes are stripped; the lookup is case-sensitive on the path itself.
Returns:
{"method","path","group","summary","description", "query_params","request_body_schema","request_body_example", "response_schema","response_example"}.
On unknown endpoint, returns {"error": "..."} with a did_you_mean
hint if a close match exists.
Inputs: method (required), path (required). Returns: object
invoke_api_endpointA
Validate, then execute, a Cin7 Core REST API call.
Args:
method: HTTP verb (GET, POST, PUT, PATCH, DELETE).
Case-insensitive.
path: Endpoint path, e.g. "Product", "advanced-purchase",
"sale/order". Leading slashes are stripped.
query_params: Query-string parameters. Validated against the
endpoint's declared params.
body: JSON request body. Validated against the endpoint's required
body fields (extras are permitted).
Returns:
Success: {"status": 200, "data": <json>, "rate_limit_remaining": "59"}.
Cin7 4xx response: {"status": 4xx, "data": <body or null>, "errors": [...]}.
Validation failure: {"status": null, "data": null, "errors": [...]}.
Raises: Cin7AuthError | Cin7NotFoundError | Cin7RateLimitError | Cin7APIError: Transport-level failures the model cannot fix.
Inputs: method (required), path (required), query_params, body. Returns: object
list_api_endpointsA
Search Cin7 Core's REST endpoints by keyword.
Args:
keyword: Substring to match against path, summary, group, and
parameter names. Case-insensitive.
methods: Optional list of HTTP methods to restrict results to.
Valid values: GET, POST, PUT, PATCH, DELETE.
limit: Maximum number of results to return. Default 25.
Returns:
{"results": [{"method","path","summary","group"}, ...], "total": int, "truncated": bool}.
On empty keyword, returns the same shape with an additional error key.
Inputs: keyword (required), methods, limit. Returns: object
report_issueA
File a structured bug report for later developer review.
Args:
summary: One-line headline of what went wrong.
tool_name: Which MCP tool was being used when the issue occurred.
One of list_api_endpoints, get_api_endpoint_schema,
invoke_api_endpoint.
tool_arguments: The exact kwargs you passed to the tool. Include
enough information for someone else to reproduce the call.
observed_behavior: What actually happened. Be specific.
expected_behavior: What you expected to happen instead.
severity: low, medium, or high. Default medium.
error_message: Exception class + message, if one was raised.
response_excerpt: Truncated snippet of the response body.
Capped at 2000 chars.
client_context: Optional notes — model name, conversation topic,
any context that would help the developer reproduce.
Returns:
{"report_id", "stored_in_file", "stored_in_log", "thanks"} on success,
or {"error": "..."} if a required field is invalid.
Inputs: summary (required), tool_name (required), tool_arguments (required), observed_behavior (required), +5 more. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool has a unique, clearly defined purpose: listing endpoints, getting schemas, invoking endpoints, and reporting issues. There is no overlap or ambiguity.
All tool names follow a consistent snake_case verb_noun pattern (e.g., get_api_endpoint_schema, invoke_api_endpoint, list_api_endpoints, report_issue).
With 4 tools, the server is well-scoped for managing API interactions (discovery, schema inspection, execution, and issue reporting). Neither too sparse nor excessive.
The set covers core workflows: discover endpoints, fetch schemas, make API calls, and report issues. A minor gap is the lack of explicit rate limit querying, but rate limit info is included in invocation responses.
Maintenance
Related MCP Connectors
AI-callable tools for API mocking, testing, monitoring, security, and automation.
Turn any task into the right API calls: discover, evaluate, and integrate public APIs.
Search 16,000+ API operations and 95 built tools by need, then call any of them by name
Verified, pay-per-use API tools for AI agents through one authenticated connection.
Related MCP Servers
- FlicenseNot gradedqualityNot gradedmaintenanceEnables AI agents to dynamically discover and interact with APIs through Swagger/OpenAPI specifications and Postman collections using a strategic four-tool approach. It streamlines API integration by providing universal tools for endpoint discovery, detailed request information, and authenticated execution.1-
- AlicenseAqualityCmaintenanceExposes all 379 Invoice Ninja v5 REST API endpoints through three consolidated tools (list, describe, call), enabling full invoice management and business operations via natural language.318 npmAGPL 3.0
- AlicenseNot gradedqualityDmaintenanceEnables Claude to fully interact with the Cin7 Omni API, including listing, fetching, creating, updating, and deleting records across resources like products, stock, sales orders, and purchase orders, plus uploading product images. Supports read-only mode and respects Cin7 rate limits with automatic retries.MIT
- FlicenseNot gradedqualityBmaintenanceEnables AI agents to discover and call all Roblox Open Cloud API endpoints through five small tools, without loading an API reference into context.-