Postgres and REST twins
Local Postgres and REST stand-ins that refuse out-of-contract calls and write a report
- Pricing
- Open source
- Platforms
- CLI, macOS, Linux
- Runs
- Locally
- Version
- 0.7.1
- Listing updated
- 3 days ago
About Postgres and REST twins
Postgres and REST twins is an open-source MCP server for databases. It runs locally on your machine and is started by your AI client.
Testing an agent against a real database or live API risks damage, and a loose mock hides mistakes. A twin here is generated from a Postgres schema or an OpenAPI spec and serves only that declared contract. A write that breaks a constraint comes back with the real SQLSTATE and a reason, and anything outside the contract is refused with an explanation instead of being guessed.
This MCP server is a local manager that starts and stops twins, reports health, keeps reports from stopped twins and can compare Postgres snapshots by replaying a query set, which helps check a migration. The vendor's checked REST example posts to a greeting route with a header: valid calls returned the declared greeting, while a missing header, wrong value type and unknown route returned 401, 422 and 404, and the stopped twin's report recorded all four requests.
The limits are stated plainly: a twin tests declared behaviour only and does not prove production fidelity, the manager has no MCP or Snowflake twin kinds, and the Windows archive includes the CLI but not the MCP server. Refused-SQL capture can keep literal values locally, so it is off unless needed. It is open source, runs locally over stdio and has no hosted endpoint.
Install
Run in a terminal
claude mcp add twinning -- npx -y @cmdrvl/twinning-mcpAdd to claude_desktop_config.json
{
"mcpServers": {
"twinning": {
"command": "npx",
"args": [
"-y",
"@cmdrvl/twinning-mcp"
]
}
}
}Add to ~/.cursor/mcp.json
{
"mcpServers": {
"twinning": {
"command": "npx",
"args": [
"-y",
"@cmdrvl/twinning-mcp"
]
}
}
}Add to .vscode/mcp.json
{
"servers": {
"twinning": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@cmdrvl/twinning-mcp"
]
}
}
}Add to ~/.codeium/windsurf/mcp_config.json
{
"mcpServers": {
"twinning": {
"command": "npx",
"args": [
"-y",
"@cmdrvl/twinning-mcp"
]
}
}
}Add to your client's MCP settings (most use this shape)
{
"mcpServers": {
"twinning": {
"command": "npx",
"args": [
"-y",
"@cmdrvl/twinning-mcp"
]
}
}
}What it does
- Postgres twins
- Serve a declared subset of a Postgres schema with real SQLSTATE errors on violations.
- REST twins
- Serve routes defined by an OpenAPI spec and refuse anything else.
- Run reports
- Reports from stopped twins record the requests received and how they were answered.
- Snapshot comparison
- Replays a query set against old and new snapshots to check a migration.
- Local stdio manager
- Starts, stops and inspects twins without a hosted endpoint.
- Checksum-verified install
- Prebuilt macOS and Linux archives come with SHA256SUMS to verify.
Good for
- Rehearse extraction code against a stand-in before touching a real database
- Replay queries on old and new schemas to check a migration
- Test an API client against a spec-defined contract
- See exactly why an agent's call was refused
Pricing
Open source
Prices change. Check cmdrvl.com before you buy.
Postgres and REST twins FAQ
Does a passing twin test prove production behaviour?
No. The vendor says a twin tests declared behaviour only and does not establish production fidelity.
Which platforms have the MCP server?
Prebuilt macOS and Linux archives include twinning-mcp; the Windows archive has the CLI only.
Can it model Snowflake or MCP servers?
No. The manager supports Postgres and REST twin kinds only.
Is there a hosted endpoint?
No. It controls twins through local stdio.
What was tested?
The v0.7.1 bundle on Intel macOS on 2 November 2026; other platforms were not tested in that run.
Is Postgres and REST twins free?
Yes. Postgres and REST twins is open source, so you can use and self-host it for free.
How do I add Postgres and REST twins to Claude Code?
Run this command in your terminal: claude mcp add twinning -- npx -y @cmdrvl/twinning-mcp
What are the best alternatives to Postgres and REST twins?
The closest alternatives to Postgres and REST twins are REA, Codebase Memory, GitHub, Serena MCP: the IDE for your agent and XERJ.
Alternatives to Postgres and REST twins

REA
MCP serverCLI and MCP server that lets coding agents reverse engineer apps and binaries
Runs locally- Open source
- 464K GitHub stars
- Developer tools

Codebase Memory
MCP serverLocal MCP server that builds a code knowledge graph for AI coding agents
Runs locally- Open source
- 48.7K GitHub stars
- Knowledge and memory

GitHub
MCP serverOfficial MCP server connecting AI assistants to GitHub repos, issues and workflows
Not checked yet- Remote
- Open source
- 34.5K GitHub stars
- Developer tools

Serena MCP: the IDE for your agent
MCP serverMCP toolkit giving coding agents symbol-level code retrieval and editing
Runs locally- Open source
- 31.5K GitHub stars
- Developer tools

XERJ
MCP serverLocal search engine for AI agents with cited answers over your code and docs
Runs locally- Open source
- 19.2K GitHub stars
- Knowledge and memory

Ouroboros
MCP serverSpec-first layer that pins requirements and verifies results of AI coding agent work
Runs locally- Open source
- 6.4K GitHub stars
- Developer tools