mcp-onprem-starter
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., "@mcp-onprem-starter show me the list of records"
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.
mcp-onprem-starter
A starter template for building single-client MCP servers that expose an existing REST API through MCP. The primary deployment profile runs as a stdio subprocess in a customer-controlled environment, including private cloud, data-center, and air-gapped infrastructure.
Architecture
MCP client / agent
│
│ stdio
▼
MCP server
├── tool handlers
├── write authorization
├── typed errors
└── HTTP client
│
▼
Configured upstream APIDevelopment note: When
UPSTREAM_BASE_URLis unset, the server uses the bundled mock upstream so the request path can run locally without an external API.
Related MCP server: mcp-server-template
Quick start
npm install
npm run devFor a reproducible development environment, use the optional Nix flake:
nix develop
npm ci
just verifyThe development shell provides Node.js, just, and the Docker CLI. Nix is a developer-environment option; the server's
runtime and package installation remain based on Node.js and npm.
This starts the server over stdio with a bundled mock upstream and the development defaults. Point an MCP client (Claude
Code, an agent runtime, or the SDK's own test client) at it and call list_records or
create_record.
Template note:
list_records,create_record, and the bundled mock are illustrative examples. Replace them with tools and upstream mappings derived from the operator's business request.
To verify the whole deployable chain — build, container boot, a real protocol round trip, and a rollback drill — run:
just verifyDocker is the default container runtime. Podman is also supported:
CONTAINER=podman just verifyWhat's included
Path | What |
| Entry point. |
| Zod-validated config. Structural settings are validated at startup with the variable named; capability settings (secrets) isolate the tool that requires them. |
| A closed error-code taxonomy, one error class, and the four rules that keep it from drifting (see the file's header comment). |
| stderr-only structured logging with automatic secret redaction and a separate audit stream for writes. |
| REST client with host-named timeout errors, a single guarded re-auth retry, normalized failure surfaces, retryable reads, and explicit write-outcome handling. |
| The tool-module shape ( |
| A tiny in-memory upstream so the template runs with zero configuration. |
| The three current distribution paths, configuration reference, operational notes, and coverage roadmap. |
| The separate shared HTTP deployment profile and its requirements. |
| Everything else considered and deferred, with the trigger for building each. |
Implementing an operator request
Agents implementing a business request should first identify the required workflows, upstream API contract, tool
behavior, security requirements, and acceptance criteria. See AGENTS.md for the complete implementation workflow and
repository rules.
Adapting this template
Use this sequence to build the business-specific server:
Understand the structure. Read
src/index.ts,src/config.ts,src/http/client.ts,src/tools/shared.ts, andsrc/errors.ts.Define the upstream contract. Identify the API base URL, authentication method, endpoints, request and response schemas, and error behavior.
Design the MCP tools. Map business operations to tools with clear names, descriptions, input schemas, annotations, and result shapes.
Implement the tool handlers. Add one module per tool under
src/tools/, use the shared HTTP client, applycheckWriteGate()to writes, and register each tool insrc/tools/index.ts.Add configuration. Extend
ConfigSchemafor required URLs, credentials, timeouts, or capability settings. Keep environment access insidesrc/config.ts.Add tests. Cover tool inputs, upstream responses, error mapping, write authorization, and the MCP initialize/tool-listing round trip.
Verify the deployment. Run
npm run ci, thenjust verifyfor the container, non-root boot, stdio, and rollback checks.
Template cleanup
After the business tools are implemented:
Replace
src/tools/_example-read.tsandsrc/tools/_example-write.ts.Update the bundled mock and its tests to represent the business domain, or retain them as a local contract-test harness.
Remove placeholder endpoint definitions and example terminology.
Update
.env.example,README.md, andDEPLOYMENT.md.Keep the shared configuration, HTTP client, error taxonomy, write gate, logging, and verification structure when they still match the deployment.
Design principles
stdio by default. The server exposes the MCP connection through stdio. The agent runtime spawns this as a child process inside its own trust boundary.
Validate at startup, isolate optional capabilities. A malformed required setting stops startup with the variable name in the message. A missing optional credential disables just the tool that needs it — the server still starts, and the disabled tool stays listed rather than silently vanishing.
Writes require deliberate authorization. A write tool needs both an environment- level flag and a per-call confirmation, and the underlying HTTP client surfaces an ambiguous write outcome for operator review rather than retrying automatically.
Every error is actionable. Error details are sanitized before they reach the caller, and every error names what to do next.
Patterns have production provenance. Every pattern in this template is ported from a pattern already shipped in a working server — see the doc comments for provenance.
License
MIT.
Available Tools
2 toolscreate_recordCreate a recordADestructive
Create a new record in the upstream system. Defaults to a dry run: confirm=true is required to execute, while the default returns a preview of the exact payload that would be sent. Set confirm=true to execute — this also requires the deployment to have ALLOW_WRITES enabled, independent of this flag.
Inputs: name (required), reason (required), confirm.
list_recordsList recordsARead-onlyIdempotent
List records from the upstream system, optionally filtered by a search query. Returns a bounded page of results with a total-matched count and a truncated flag — call again with a narrower query if truncated is true rather than assuming this is the full set. Use get_record to fetch one record in full.
Inputs: limit, query.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 2 tools
The two tools have clearly distinct purposes: list_records for querying/searching with pagination, and create_record for inserting new records. No overlap or ambiguity exists.
Both tools follow a consistent verb_noun pattern (list_records, create_record), making the API predictable and easy to navigate.
At 2 tools, the set is on the thin side, but for a 'starter' server it could be intentionally minimal. However, the reference to get_record suggests at least one more expected tool.
The set is missing get_record, update_record, and delete_record. list_records explicitly instructs agents to use get_record, but that tool does not exist, creating a clear dead end and significant coverage gap.
Maintenance
Related MCP Connectors
One OAuth connector for your team's remote MCP servers, with Tool Packs, guardrails and logs.
REST-to-MCP for UK hospitality. Safety proxy: circuit-breakers, rate limits, whitelists. Apache 2.0.
The official MCP Server from Mia-Platform to interact with Mia-Platform Console
An MCP server that provides Javelin Standalone Guardrails
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA starter template for building MCP servers in Python using the streamable HTTP transport protocol. Provides a foundation with the MCP Python SDK and example configuration to quickly develop custom MCP servers.2-
- AlicenseNot gradedqualityDmaintenanceA production-ready FastMCP server template supporting local development with stdio and secure web deployment with HTTPS and OAuth.4MIT
- FlicenseNot gradedqualityNot gradedmaintenanceA corporate MCP server template in Python, built with FastMCP for stateless, scalable deployment behind a load balancer with health/readiness endpoints and JSON structured logging.-
- FlicenseNot gradedqualityDmaintenanceThis MCP server starter template enables developers to quickly build production-ready MCP servers with Streamable HTTP, stateless design, and OAuth 2.1 authorization. It provides a structured, capability-based architecture with Postgres audit logging and centralized scope enforcement.-